本文整理汇总了PHP中url_base函数的典型用法代码示例。如果您正苦于以下问题:PHP url_base函数的具体用法?PHP url_base怎么用?PHP url_base使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了url_base函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: select_profile
function select_profile($cmd)
{
// Request for a random profile.
//
if ($cmd == "rand") {
$profiles = array();
$pic = get_int('pic');
if ($pic == 0) {
$profiles = BoincProfile::enum("has_picture=0", "limit 1000");
} else {
if ($pic == 1) {
$profiles = BoincProfile::enum("has_picture=1", "limit 1000");
} else {
if ($pic == -1) {
$profiles = BoincProfile::enum(null, "limit 1000");
}
}
}
if (count($profiles) == 0) {
page_head(tra("No profiles"));
echo tra("No profiles matched your query.");
page_tail();
exit;
}
shuffle($profiles);
$userid = $profiles[0]->userid;
header("Location: " . url_base() . "view_profile.php?userid={$userid}");
exit;
}
}
示例2: url_next_post
function url_next_post($params = '')
{
$post_number_to_display = get_stored_parameter('post_number_to_display');
$num_posts_available = get_stored_parameter('num_posts_available');
$url = url_base() . '?post_number=';
if ($post_number_to_display >= $num_posts_available) {
// indicate to the view that there is not a next post
return '';
} else {
return $url . ($post_number_to_display + 1);
}
}
示例3: show_form
function show_form()
{
start_table();
table_header("ID", "name", "title", "image URL", "type<br><p class=\"text-muted\">0=user<br>1=team<br>optional</p>", "description<br><p class=\"text-muted\">optional</p>", "level<br><p class=\"text-muted\">optional</p>", "tags<br><p class=\"text-muted\">optional</p>", "SQL rule<br><p class=\"text-muted\">optional</p>", "", "");
$badges = BoincBadge::enum("");
$i = 0;
foreach ($badges as $badge) {
echo "<tr class=row{$i} valign=top><form action=badge_admin.php method=POST>";
$i = 1 - $i;
echo "<td>{$badge->id}</td>\n";
echo "<input type=hidden name=id value={$badge->id}>";
$nu = BoincBadgeUser::count("badge_id={$badge->id}");
$nt = BoincBadgeTeam::count("badge_id={$badge->id}");
$x = "<br><p class=\"text-muted\">Assigned to {$nu} users<br>Assigned to {$nt} teams</p>";
echo "<td><input name=\"name\" value=\"{$badge->name}\">{$x}</td>\n";
echo "<td><input name=\"title\" value=\"{$badge->title}\"></td>\n";
$x = "";
if ($badge->image_url) {
if (strstr($badge->image_url, "http") == $badge->image_url) {
$y = $badge->image_url;
} else {
$y = url_base() . $badge->image_url;
}
$x = " <img align=right height=64 src=\"{$y}\">";
}
echo "<td><input name=\"image_url\" value=\"{$badge->image_url}\">{$x}</td>\n";
echo "<td><input name=\"type\" size=4 value=\"{$badge->type}\"></td>\n";
echo "<td><input name=\"description\" value=\"{$badge->description}\"></td>\n";
echo "<td><input name=\"level\" value=\"{$badge->level}\"></td>\n";
echo "<td><input name=\"tags\" value=\"{$badge->tags}\"></td>\n";
echo "<td><input name=\"sql_rule\" value=\"{$badge->sql_rule}\"></td>\n";
echo "<td><input class=\"btn btn-default\" type=submit name=\"update\" value=Update>\n";
echo "<td><input class=\"btn btn-danger\" type=submit name=\"delete\" value=Delete>\n";
echo "</form></tr>\n";
}
echo "<tr><form action=badge_admin.php method=POST>";
echo "<td><br></td>\n";
echo "<td><input name=\"name\"></td>\n";
echo "<td><input name=\"title\"></td>\n";
echo "<td><input name=\"image_url\"></td>\n";
echo "<td><input name=\"type\" size=4></td>\n";
echo "<td><input name=\"description\"></td>\n";
echo "<td><input name=\"level\"></td>\n";
echo "<td><input name=\"tags\"></td>\n";
echo "<td><input name=\"sql_rule\"></td>\n";
echo "<td colspan=2><input class=\"btn btn-primary\" type=submit name=\"add_badge\" value=\"Create badge\"></td>\n";
echo "</form></tr>\n";
end_table();
}
示例4: drawNavigationRow
function drawNavigationRow($pages, $module = false, $pq = false)
{
global $_josh;
$count = count($pages);
if ($count < 2) {
return false;
}
$return = '<table class="navigation" cellspacing="1">
<tr class="hilite">';
$cellwidth = round(100 / $count, 2);
$match = $pq ? $_josh["request"]["path_query"] : $_josh["request"]["path"];
//echo $match; don't put url_base in match, if you can help it
foreach ($pages as $url => $name) {
if ($url == $match || $url == url_base() . $match) {
$cell = ' class="selected">' . $name . '';
} else {
$cell = '><a href="' . $url . '">' . $name . '</a>';
}
$return .= '<td width="' . $cellwidth . '%"' . $cell . '</td>';
}
return $return . '</tr>
</table>';
}
示例5: db_init
//
// BOINC is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
// See the GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with BOINC. If not, see <http://www.gnu.org/licenses/>.
// Redirect user to PayPal system
require_once "../inc/util.inc";
db_init();
$logged_in_user = get_logged_in_user(false);
$amount = post_str("inV");
$item_id = post_int("item_id", true);
if ($item_id == null) {
$item_id = 1;
}
$currency = post_str("currency");
if (post_int("anonymous", true) == 1 || $logged_in_user == null) {
$userid = 0;
} else {
$userid = $logged_in_user->id;
}
$order_time = time();
// Write user id to paypal table, so the return script knows it's expecting this payment
_mysql_query("INSERT INTO donation_paypal SET order_time = '" . $order_time . "', userid = '{$userid}', item_number=" . $item_id . ", order_amount = '" . boinc_real_escape_string($amount) . "'");
$payment_id = _mysql_insert_id();
$URL = "www.paypal.com/cgi-bin/webscr";
$fields = "cmd=_xclick&lc=US&business=" . PAYPAL_ADDRESS . "&quantity=1&item_name=Donation&item_number=" . $payment_id . "_" . $order_time . "&amount=" . $amount . "&no_shipping=1&return=" . url_base() . "donated.php?st=Completed&rm=2&cancel_return=" . url_base() . "/donated.php&no_note=1¤cy_code=" . $currency . "&bn=PP-BuyNowBF";
header("Location: https://{$URL}?{$fields}");
exit;
示例6: show_post_and_context
$thread = BoincThread::lookup_id($post->thread);
if (!$thread) {
continue;
}
$forum = BoincForum::lookup_id($thread->forum);
if (!$forum) {
continue;
}
if (!is_forum_visible_to_user($forum, $logged_in_user)) {
continue;
}
if (!$show_hidden_posts) {
if ($thread->hidden) {
continue;
}
if ($post->hidden) {
continue;
}
}
show_post_and_context($post, $thread, $forum, $options, $n);
$n++;
}
end_table();
}
if (!count($threads) && !count($posts)) {
echo "<p>" . tra("Sorry, couldn't find anything matching your search query. You can try to broaden your search by using less words (or less specific words).") . "</p>\n <p>" . tra("You can also %1try the same search on Google.%2", "<a href=\"http://www.google.com/search?domains=" . url_base() . "&sitesearch=" . url_base() . "forum_thread.php&q=" . htmlentities($search_keywords) . "\">", "</a>") . "</p>";
}
echo "<p><a href=\"forum_search.php\">" . tra("Perform another search") . "</a></p>";
page_tail();
$cvs_version_tracker[] = "\$Id\$";
//Generated automatically - do not edit
示例7: emailPassword
function emailPassword($user_id)
{
$user = db_grab('SELECT u.email, l.code language FROM users u JOIN languages l ON u.language_id = l.id WHERE u.is_active = 1 AND u.id = ' . $user_id);
$message = getString('email_password_message', $user['language']);
$message = str_replace('%LINK%', url_base() . '/login/password_reset.php?id=' . $user_id, $message);
emailUser($user['email'], getString('email_password_subject', $user['language']), $message);
}
示例8: session_start
<?php
session_start();
$dir = dirname(__FILE__) . DIRECTORY_SEPARATOR . "../";
define("RAIZ", $dir);
include_once RAIZ . "configuracion.php";
if (!(isset($_SESSION["LoginSistema"]) && $_SESSION['LoginSistema'] == 1)) {
include_once RAIZ . "funciones/url.php";
header("Location:" . url_base() . $directory . "login/?u=" . $_SERVER['PHP_SELF']);
} else {
include_once RAIZ . "funciones/funciones.php";
}
示例9: m
</ul>
<div class="r_b">
<?php
if (defined('__SAMSONCMS_LOGO')) {
?>
<div class="logo"></div>
<?php
}
?>
<?php
m('i18n')->render('list');
?>
<a href="<?php
url_base('signin', 'logout');
?>
" class="logout" title="<?php
t('Выход');
?>
">.</a>
</div>
</nav>
<div class="sub_menu_wrapper <?php
isv('submenu', 'control');
?>
">
<?php
if (isv('submenu')) {
?>
示例10: session_start
<?php
session_start();
include_once "../configuracion.php";
include_once "../funciones/url.php";
foreach ($_SESSION as $k => $v) {
// echo $k."-".$v;
unset($_SESSION[$k]);
}
unset($_SESSION["Login"]);
unset($_SESSION["CodUsuarioLog"]);
unset($_SESSION["Nivel"]);
unset($_SESSION["LoginSistemaContable"]);
unset($_SESSION["CodEmpresa"]);
session_destroy();
header("Location:" . url_base() . $directory);
示例11: db_grab
<?php
include '../include.php';
if (url_action('delete')) {
if (!isset($_GET['delete_id']) && isset($_GET['id'])) {
$_GET['delete_id'] = $_GET['id'];
}
$r = db_grab('SELECT firstname, lastname, endDate FROM users WHERE id = ' . $_GET['delete_id']);
if ($r['endDate']) {
db_query('UPDATE users SET is_active = 0, deleted_user = ' . $_SESSION['user_id'] . ', deleted_date = GETDATE() WHERE id = ' . $_GET['delete_id']);
} else {
db_query('UPDATE users SET is_active = 0, deleted_user = ' . $_SESSION['user_id'] . ', deleted_date = GETDATE(), endDate = GETDATE() WHERE id = ' . $_GET['delete_id']);
}
if (getOption('staff_alertdelete')) {
emailAdmins('Intranet: Staff Deleted', draw_link(url_base() . '/staff/view.php?id=' . $_GET['staffID'], $r['firstname'] . ' ' . $r['lastname']) . ' was just deactivated on the Intranet.');
}
url_query_drop('action,delete_id');
}
function drawJumpToStaff($selectedID = false)
{
global $page;
$nullable = $selectedID === false;
$return = drawPanel(getString('jump_to') . ' ' . drawSelectUser('', $selectedID, $nullable, 0, true, true, 'Staff Member:'));
if ($page['is_admin'] && db_grab('SELECT COUNT(*) FROM users_requests WHERE is_active = 1')) {
$return = drawMessage('There are pending <a href="requests.php">account requests</a> for you to review.') . $return;
}
return $return;
}
示例12: db_table
<?php
include '../include.php';
$result = db_table('SELECT
u.id link,
u.firstname,
u.lastname,
u.title,
d.departmentName department,
o.title organization,
u.email,
(SELECT CASE WHEN u.rankID = 9 THEN "No" ELSE "Yes" END) is_staff
FROM users u
LEFT JOIN departments d ON u.departmentID = d.departmentID
JOIN organizations o ON u.organization_id = o.id
WHERE u.is_active = 1
ORDER BY u.lastname, u.firstname');
foreach ($result as &$r) {
$r['link'] = draw_link(url_base() . '/staff/view.php?id=' . $r['link'], $r['link']);
}
file_array($result, 'employees');
示例13: request
$title = request()->filter('trim', 'strip_tags')->input('title');
$content = request()->filter('trim', 'strip_tags')->input('content');
if (empty($title)) {
$error = '标题不能为空';
} elseif (empty($content)) {
$error = '内容不能为空';
} else {
(new \Model\Post())->update($pid, $title, $content);
response()->redirect(url_base() . '/post/' . $pid);
}
}
return view('post-edit.php', ['post' => $post, 'error' => $error]);
})->conditions(['pid' => '[0-9]+'])->name('post-edit');
}, function () {
// 路由分组的过滤
if (empty($_SESSION['uid'])) {
response()->redirect(url_base() . '/login');
}
});
// 路由参数
$app->get('/post/<pid>', function () {
$pid = request()->filter('intval')->params('pid');
$post = (new \Model\Post())->get($pid);
if (!$post) {
throw new \Lime\Exception\NotFoundException("Post not found");
}
return view('content.php', ['post' => $post]);
})->conditions(['pid' => '[0-9]+'])->name('post-page');
// 使用条件限制数组 和 路由命名
// 执行 Lime 应用
$app->run();
示例14: draw_navigation
function draw_navigation($options, $match = false, $type = "text", $class = "navigation")
{
//type could be text, images or rollovers
global $_josh;
//debug();
$return = $_josh["newline"] . $_josh["newline"] . "<!--start nav-->" . $_josh["newline"] . "<ul class='" . $class . "'>";
if ($match === false) {
$match = $_josh["request"]["path"];
} elseif ($match === true) {
$match = $_josh["request"]["path_query"];
} elseif ($match == "//") {
//to take care of a common / . folder . / scenario
$match = "/";
}
error_debug("<b>draw_navigation</b> match is " . $match);
$counter = 1;
$javascript = $_josh["newline"];
foreach ($options as $title => $url) {
$name = 'option' . $counter;
$return .= $_josh["newline"] . '<li><a href="' . $url . '" class="' . $name;
if (str_replace(url_base(), "", $url) == $match) {
$img_state = "_on";
$return .= ' selected';
} else {
$img_state = "_off";
if ($type == "rollovers") {
$return .= '" onmouseover="javascript:roll(\'' . $name . '\',\'on\');" onmouseout="javascript:roll(\'' . $name . '\',\'off\');';
}
}
$return .= '">';
if ($type == "text") {
$return .= $title;
} elseif ($type == "images" || $type == "rollovers") {
$img = str_replace("/", "", $url);
if (empty($img)) {
$img = "home";
}
$img = "/images/navigation/" . $img;
if ($type == "rollovers") {
$javascript .= $name . "_on\t\t = new Image;" . $_josh["newline"];
$javascript .= $name . "_off\t = new Image;" . $_josh["newline"];
$javascript .= $name . "_on.src\t = '" . $img . "_on.png';" . $_josh["newline"];
$javascript .= $name . "_off.src = '" . $img . "_off.png';" . $_josh["newline"];
}
$img .= $img_state . ".png";
$return .= draw_img($img, false, false, $name);
}
$return .= '</a></li>';
$counter++;
}
$return .= $_josh["newline"] . "</ul>";
if ($type == "rollovers") {
$return = draw_javascript('if (document.images) {' . $javascript . '}
function roll(what, how) { eval("document." + what + ".src = " + what + "_" + how + ".src;"); }') . $return;
}
return $return;
}
示例15: tra
if (!DISABLE_TEAMS) {
echo "\n <li><a href=\"team.php\">Teams</a> - create or join a team\n ";
}
echo "\n </ul>\n <h2 class=headline>" . tra("Community") . "</h2>\n <ul>\n ";
if (!DISABLE_PROFILES) {
echo "\n <li><a href=\"profile_menu.php\">" . tra("Profiles") . "</a>\n ";
}
echo "\n <li><a href=\"user_search.php\">User search</a>\n <li><a href=ffmail_form.php>Share</a>\n ";
if (!DISABLE_FORUMS) {
echo "\n <li><a href=\"forum_index.php\">" . tra("Message boards") . "</a>\n <li><a href=\"forum_help_desk.php\">" . tra("Questions and Answers") . "</a>\n ";
}
echo "\n <li><a href=\"stats.php\">Statistics</a>\n <li><a href=language_select.php>Languages</a>\n </ul>\n </div>\n ";
}
$stopped = web_stopped();
$rssname = PROJECT . " RSS 2.0";
$rsslink = url_base() . "rss_main.php";
header("Content-type: text/html; charset=utf-8");
echo "<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">";
echo "<html>\n <head>\n <title>" . PROJECT . "</title>\n <link rel=\"stylesheet\" type=\"text/css\" href=\"main.css\" media=\"all\" />\n <link rel=\"stylesheet\" type=\"text/css\" href=\"" . STYLESHEET . "\">\n <link rel=\"alternate\" type=\"application/rss+xml\" title=\"" . $rssname . "\" href=\"" . $rsslink . "\">\n";
include 'schedulers.txt';
if (defined("SHORTCUT_ICON")) {
echo '<link rel="icon" type="image/x-icon", href="' . SHORTCUT_ICON . '"/>';
}
echo "\n </head><body>\n <div class=page_title>" . PROJECT . "</div>\n";
if (!$stopped) {
get_logged_in_user(false);
show_login_info();
}
echo "\n <table cellpadding=\"8\" cellspacing=\"4\" class=\"table table-bordered\">\n <tr><td rowspan=\"2\" valign=\"top\" width=\"40%\">\n";
if ($stopped) {
echo "\n <b>" . PROJECT . " is temporarily shut down for maintenance.\n Please try again later</b>.\n ";