本文整理汇总了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;
}