本文整理匯總了PHP中Rewrite::GetURL方法的典型用法代碼示例。如果您正苦於以下問題:PHP Rewrite::GetURL方法的具體用法?PHP Rewrite::GetURL怎麽用?PHP Rewrite::GetURL使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Rewrite
的用法示例。
在下文中一共展示了Rewrite::GetURL方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: ShowNewsListing
public function ShowNewsListing($list = 1)
{
global $bd_names, $config;
$sql = '';
if ($this->category_id > 0) {
$sql = ' WHERE category_id=' . $this->category_id . ' ';
}
$list = (int) $list;
if ($list <= 0) {
$list = 1;
}
if ($this->category_id > 0) {
$category = CategoryManager::GetNameByID($this->category_id);
} else {
$category = 'Последние новости';
}
$category_id = $this->category_id;
$category_link = Rewrite::GetURL(array('category', $category_id), array('', 'cid'));
ob_start();
include $this->GetView('news_header.html');
$html_news = ob_get_clean();
$news_pnum = $config['news_by_page'];
$line = getDB()->fetchRow("SELECT COUNT(*) FROM `{$bd_names['news']}`" . $sql, false, 'num');
$newsnum = (int) $line[0];
if (!$newsnum) {
$html_news .= $this->ShowPage('news_empty.html');
return $html_news;
}
$result = getDB()->ask("SELECT `id` FROM `{$bd_names['news']}`" . $sql . "ORDER BY `time` DESC LIMIT " . $news_pnum * ($list - 1) . "," . $news_pnum);
while ($line = $result->fetch('num')) {
$news_item = new News_Item($line[0], $this->st_subdir);
$html_news .= $news_item->Show();
unset($news_item);
}
if ($newsnum) {
$html_news .= $this->arrowsGenerator($this->work_link, $list, $newsnum, $news_pnum, 'news');
}
return $html_news;
}