当前位置: 首页>>代码示例>>PHP>>正文


PHP Rewrite::GetURL方法代码示例

本文整理汇总了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;
 }
开发者ID:qexyorg,项目名称:webMCR-1,代码行数:39,代码来源:catalog.class.php


注:本文中的Rewrite::GetURL方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。