Exemplo n.º 1
0
 public function run()
 {
     $this->controller->layout = false;
     //rss创建
     $obj = new Sitemap();
     $rss = $obj->show();
     $this->controller->render('sitemap', array('rss' => $rss));
 }
Exemplo n.º 2
0
 public function actionSitemap()
 {
     $page = $_GET['id'];
     $page = isset($page) ? $page : 1;
     $dir = Yii::app()->basePath . '/runtime/site/sitemap' . $page . '.xml';
     $a = $_GET['a'];
     $obj = new Sitemap();
     if ($a == 'update' || !file_exists($dir)) {
         $limit = 10000;
         $start = ($page - 1) * $limit;
         $rss = $obj->show(Posts::CLASSIFY_POST, $start, $limit);
         if ($rss) {
             $obj->saveToFile($dir);
         } else {
             exit($page . '-->empty');
         }
     } else {
         $rss = $obj->getFile($dir);
     }
     //rss创建
     $this->render('//site/sitemap', array('rss' => $rss));
 }
Exemplo n.º 3
0
 /**
  * sitemap列表
  */
 public function actionSitemap()
 {
     $this->layout = false;
     //rss创建
     $obj = new Sitemap();
     $this->render('sitemap', array('rss' => $obj->show()));
 }