本文整理汇总了PHP中createURL函数的典型用法代码示例。如果您正苦于以下问题:PHP createURL函数的具体用法?PHP createURL怎么用?PHP createURL使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了createURL函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: UserService
function UserService(&$db)
{
$this->db =& $db;
$this->tablename = $GLOBALS['tableprefix'] . 'users';
$this->sessionkey = $GLOBALS['cookieprefix'] . '-currentuserid';
$this->cookiekey = $GLOBALS['cookieprefix'] . '-login';
$this->profileurl = createURL('profile', '%2$s');
}
示例2: __construct
protected function __construct($db)
{
$this->db = $db;
$this->tablename = $GLOBALS['tableprefix'] . 'users';
$this->sessionkey = INSTALLATION_ID . '-currentuserid';
$this->cookiekey = INSTALLATION_ID . '-login';
$this->profileurl = createURL('profile', '%2$s');
$this->updateSessionStability();
}
示例3: matchingURL
function matchingURL($url1, $url2)
{
$url_obj1 = createURL($url1);
$url_obj2 = createURL($url2);
if ($url_obj1->host == $url_obj2->host && $url_obj1->protocol == $url_obj2->protocol && $url_obj1->port == $url_obj2->port && $url_obj1->dest == $url_obj2->dest) {
return "True";
} else {
return "False";
}
}
示例4: main
function main()
{
require '../includes/connect.php';
$mainTickerSQL = "SELECT * FROM tickers";
$ticker_result = mysqli_query($connect, $mainTickerSQL);
while ($row = mysqli_fetch_array($ticker_result)) {
$companyTicker = $row['ticker'];
$fileURL = createURL($companyTicker);
$companyTextFile = "../TextFiles/" . $companyTicker . ".txt";
$file = getCsvFile($fileURL, $companyTextFile);
fileToDatabase($companyTextFile, $companyTicker);
}
}
示例5: main
function main()
{
$mainTickerFile = fopen("tickerMaster.txt", "r");
$myfile = fopen("tableName.txt", "w");
while (!feof($mainTickerFile)) {
$companyTicker = fgets($mainTickerFile);
$companyTicker = trim($companyTicker);
$fileURL = createURL($companyTicker);
$companyTxtFile = "txtFiles/" . $companyTicker . ".txt";
getCSVFile($fileURL, $companyTxtFile);
$tableName = fileToDatabase($companyTxtFile, $companyTicker);
fwrite($myfile, $tableName . "\n");
}
fclose($myfile);
}
示例6: list
/* Managing path info */
list($url, $tag) = explode('/', $_SERVER['PATH_INFO']);
//$tag = isset($_GET['query']) ? $_GET['query'] : NULL;
$template = 'tagrename.tpl';
if (POST_CONFIRM) {
if (trim(POST_OLD) != '') {
$old = trim(POST_OLD);
} else {
$old = NULL;
}
if (trim(POST_NEW) != '') {
$new = trim(POST_NEW);
} else {
$new = NULL;
}
if (!is_null($old) && !is_null($new) && $tagservice->renameTag($currentUser->getId(), $old, $new) && $b2tservice->renameTag($currentUser->getId(), $old, $new) && $tag2tagservice->renameTag($currentUser->getId(), $old, $new)) {
$tplVars['msg'] = T_('Tag renamed');
header('Location: ' . createURL('bookmarks', $currentUser->getUsername()));
} else {
$tplVars['error'] = T_('Failed to rename the tag');
$template = 'error.500.tpl';
}
} elseif (POST_CANCEL) {
header('Location: ' . createURL('bookmarks', $currentUser->getUsername() . '/' . $tag));
} else {
$tplVars['subtitle'] = T_('Rename Tag') . ': ' . $tag;
$tplVars['formaction'] = $_SERVER['SCRIPT_NAME'] . '/' . $tag;
$tplVars['referrer'] = $_SERVER['HTTP_REFERER'];
$tplVars['old'] = $tag;
}
$templateservice->loadTemplate($template, $tplVars);
示例7: ob_start
<?php
ob_start();
/* config */
require 'config.php';
/* site functions */
require 'functions/functions.php';
# set default page
if (!isset($_GET['page'])) {
$_GET['page'] = "dashboard";
}
# reset url for base
$url = createURL();
# if not install fetch settings etc
if ($_GET['page'] != "install") {
# database object
$Database = new Database_PDO();
# check if this is a new installation
require 'functions/checks/check_db_install.php';
# initialize objects
$Result = new Result();
$User = new User($Database);
$Sections = new Sections($Database);
$Subnets = new Subnets($Database);
$Tools = new Tools($Database);
$Addresses = new Addresses($Database);
}
/** include proper subpage **/
if ($_GET['page'] == "install") {
require "app/install/index.php";
} elseif ($_GET['page'] == "upgrade") {
示例8: T_
} else {
$new = NULL;
}
if (is_null($old) || is_null($new)) {
$tplVars['error'] = T_('Failed to rename the tag');
$templateservice->loadTemplate('error.500.tpl', $tplVars);
exit;
} else {
// Rename the tag.
if ($tagservice->renameTag($userservice->getCurrentUserId(), $old, $new, true)) {
$tplVars['msg'] = T_('Tag renamed');
$logged_on_user = $userservice->getCurrentUser();
header('Location: ' . createURL('bookmarks', $logged_on_user[$userservice->getFieldName('username')]));
} else {
$tplVars['error'] = T_('Failed to rename the tag');
$templateservice->loadTemplate('error.500.tpl', $tplVars);
exit;
}
}
} elseif ($_POST['cancel']) {
$logged_on_user = $userservice->getCurrentUser();
header('Location: ' . createURL('bookmarks', $logged_on_user[$userservice->getFieldName('username')] . '/' . $tags));
}
$tplVars['subtitle'] = T_('Rename Tag') . ': ' . $tag;
$tplVars['formaction'] = $_SERVER['SCRIPT_NAME'] . '/' . $tag;
$tplVars['referrer'] = $_SERVER['HTTP_REFERER'];
$tplVars['old'] = $tag;
$templateservice->loadTemplate('tagrename.tpl', $tplVars);
?>
示例9: getSortOrder
$start = 0;
}
// Set template vars
$tplVars['page'] = $page;
$tplVars['start'] = $start;
$tplVars['bookmarkCount'] = $start + 1;
$bookmarks =& $bookmarkservice->getBookmarks($start, $perpage, $userid, NULL, NULL, getSortOrder(), true);
$tplVars['sidebar_blocks'] = array('watchlist');
$tplVars['watched'] = true;
$tplVars['total'] = $bookmarks['total'];
$tplVars['bookmarks'] =& $bookmarks['bookmarks'];
$tplVars['cat_url'] = createURL('tags', '%2$s');
$tplVars['nav_url'] = createURL('watchlist', '%s/%s%s');
if ($user == $currentUsername) {
$title = T_('My Watchlist');
} else {
$title = T_('Watchlist') . ': ' . $user;
}
$tplVars['pagetitle'] = $title;
$tplVars['subtitle'] = $title;
$tplVars['rsschannels'] = array(array(filter($sitename . ': ' . $title), createURL('rss', 'watchlist/' . filter($user, 'url'))));
$templateservice->loadTemplate('bookmarks.tpl', $tplVars);
} else {
$tplVars['error'] = T_('Username was not specified');
$templateservice->loadTemplate('error.404.tpl', $tplVars);
exit;
}
if ($usecache) {
// Cache output if existing copy has expired
$cacheservice->End($hash);
}
示例10: isset
$userid = isset($userid) ? $userid : 0;
$currenttag = isset($currenttag) ? str_replace('+', ',', $currenttag) : '';
//$summarizeLinkedTags = isset($summarizeLinkedTags)?$summarizeLinkedTags:false;
$logged_on_userid = $userservice->getCurrentUserId();
$editingMode = $logged_on_userid !== false;
?>
<h2><?php
echo T_('Linked Tags');
?>
</h2>
<div id="related">
<?php
if ($editingMode) {
echo '<p style="margin-bottom: 13px;text-align:center;">';
echo ' (<a href="' . createURL('tag2tagadd', '') . '" rel="tag">' . T_('Add new link') . '</a>) ';
echo ' (<a href="' . createURL('tag2tagdelete', '') . '" rel="tag">' . T_('Delete link') . '</a>)';
echo '</p>';
}
?>
<div id="related-content"></div>
<script type="text/javascript">//<![CDATA[
jQuery("#related-content")
.jstree({
"themes" : {
"theme": "default",
"dots": false,
"icons": true,
"url": '<?php
echo ROOT_JS;
?>
themes/default/style.css'
示例11: sprintf
$end = $end - $size + 1;
}
if ($mod == 1) {
$end = $end - 1;
}
$st = $end - $size + 1;
if ($end > $totalPage) {
$end = $totalPage;
}
if ($st <= 0) {
$st = 1;
$end = $size <= $totalPage ? $size : $totalPage;
}
$qs .= !empty($qs) ? '&' : '';
$url .= '?' . $qs . 'page=';
$pageList = '<div class="pagination"><ul>';
if ($currPage - 1 > 0) {
$pageList .= sprintf('<li><a href="%s" title="上一頁">«</a></li>', createURL($url, $qs, $route, $params, $currPage - 1));
}
for ($i = $st; $i <= $end; $i++) {
$num = str_pad($i, 2, "0", STR_PAD_LEFT);
if ($i != $currPage) {
$pageList .= sprintf('<li><a href="%s">%s</a></li>', createURL($url, $qs, $route, $params, $i), $num);
} else {
$pageList .= sprintf('<li class="active"><a href="%s">%s</a></li>', createURL($url, $qs, $route, $params, $i), $num);
}
}
if ($currPage + 1 <= $totalPage) {
$pageList .= sprintf('<li><a href="%s" title="上一頁">»</a></li>', createURL($url, $qs, $route, $params, $currPage + 1));
}
echo $pageList .= '</ul></div>';
示例12: switch
switch ($others) {
case 0:
break;
case 1:
$copy .= sprintf(T_(' and %s1 other%s'), $ostart, $oend);
break;
default:
$copy .= sprintf(T_(' and %2$s%1$s others%3$s'), $others, $ostart, $oend);
}
}
// Copy link
if ($userservice->isLoggedOn() && $logged_on_userid != $row['uId']) {
// Get the username of the current user
$currentUser = $userservice->getCurrentUser();
$currentUsername = $currentUser[$userservice->getFieldName('username')];
$copy .= ' - <a href="' . createURL('bookmarks', $currentUsername . '?action=add&address=' . urlencode($row['bAddress']) . '&title=' . urlencode($row['bTitle'])) . '">' . T_('Copy') . '</a>';
}
// Nofollow option
$rel = '';
if ($GLOBALS['nofollow']) {
$rel = ' rel="nofollow"';
}
$address = filter($row['bAddress']);
// Redirection option
if ($GLOBALS['useredir']) {
$address = $GLOBALS['url_redir'] . $address;
}
// Output
echo '<li class="xfolkentry' . $access . '">' . "\n";
echo '<div class="link"><a href="' . $address . '"' . $rel . ' class="taggedlink">' . filter($row['bTitle']) . "</a></div>\n";
if ($row['bDescription'] != '') {
示例13: foreach
foreach ($watching as $watchuser) {
$list .= '<a href="' . createURL('bookmarks', $watchuser) . '">' . $watchuser . '</a>, ';
}
echo substr($list, 0, -2);
?>
</dd>
<?php
}
$watchnames = $userservice->getWatchNames($userid, true);
if ($watchnames) {
?>
<dt><?php
echo T_('Watched By');
?>
</dt>
<dd>
<?php
$list = '';
foreach ($watchnames as $watchuser) {
$list .= '<a href="' . createURL('bookmarks', $watchuser) . '">' . $watchuser . '</a>, ';
}
echo substr($list, 0, -2);
?>
</dd>
<?php
}
?>
</dl>
<?php
$this->includeTemplate($GLOBALS['bottom_include']);
示例14: T_
<?php
/* Service creation: only useful services are created */
//No specific services
if ($userservice->isLoggedOn()) {
if ($currentUser->getUsername() != $user) {
$result = $userservice->getWatchStatus($userid, $userservice->getCurrentUserId());
if ($result) {
$linkText = T_('Remove from Watchlist');
} else {
$linkText = T_('Add to Watchlist');
}
$linkAddress = createURL('watch', $user);
?>
<h2><?php
echo T_('Actions');
?>
</h2>
<div id="watchlist">
<ul>
<li><a href="<?php
echo $linkAddress;
?>
"><?php
echo $linkText;
?>
</a></li>
</ul>
</div>
示例15: squash_slug
// ok so the visitor has come along to www.mysite.com/links/tag/something lets show them all links tagged "something"
case 'tag':
// we need $x to be a valid variable so lets check it
$x = squash_slug($x);
$rz = safe_rows('*', 'pixie_module_links', "tags REGEXP '[[:<:]]" . $x . "[[:>:]]'");
if ($rz) {
// we have found a entry tagged "something" to lets change the page title to reflect that
// first lets get the current sites title
$site_title = safe_field('site_name', 'pixie_settings', "settings_id = '1'");
// $ptitle will overwrite the current page title
$ptitle = $site_title . " - Links - Tagged - {$x}";
} else {
// no tags were found, lets redirect back to the defualt view again.
// createURL is your friend... its one of the most useful functions in Pixie
if (isset($s)) {
$redirect = createURL($s);
header("Location: {$redirect}");
}
exit;
}
break;
default:
// By default this module is called the links module, Pixie will work this out for us so I do not need
// to set $ptitle here. Pixie will always TRY and create a unique, accurate page title if one is not set.
break;
}
break;
// Head
// This will output code into the end of the head section of the HTML, this allows you to load in external CSS, JavaScript etc
// Head
// This will output code into the end of the head section of the HTML, this allows you to load in external CSS, JavaScript etc