phpDocumentor PHPShopCore
[ class tree: PHPShopCore ] [ all elements ]

Source for file map.core.php

Documentation is available at map.core.php

  1. <?php
  2. /**
  3.  * Обработчик карты сайта
  4.  * @author PHPShop Software
  5.  * @version 1.1
  6.  * @package PHPShopCore
  7.  */
  8. class PHPShopMap extends PHPShopCore {
  9.  
  10.     /**
  11.      * Конструктор
  12.      */
  13.     function PHPShopMap({
  14.  
  15.         // Отладка
  16.         $this->debug=false;
  17.  
  18.         parent::PHPShopCore();
  19.     }
  20.  
  21.  
  22.     /**
  23.      * Карта страниц
  24.      */
  25.     function pagemap({
  26.  
  27.         $this->set('pageFrom',"page");
  28.         $this->set('pageDomen',$_SERVER['SERVER_NAME']."/page/");
  29.         $PHPShopOrm &new PHPShopOrm($this->getValue('base.table_name11'));
  30.         $PHPShopOrm->debug=$this->debug;
  31.         $dataArray=$PHPShopOrm->select(array('*'),array('category'=>'!=2000','enabled'=>'!=0'),array('order'=>'link'),array('limit'=>1000));
  32.         $j==0;
  33.  
  34.         if(is_array($dataArray))
  35.             foreach($dataArray as $row{
  36.  
  37.                 // Определяем переменные
  38.                 $this->set('productName',$row['name']);
  39.                 $this->set('productKey',substr(strip_tags($row['content']),0,200)."...");
  40.                 $this->set('pageLink',$row['link'].".html");
  41.                 $i++;
  42.                 $this->set('productNum',$i);
  43.  
  44.                 if($j==0{
  45.                     $this->set('pageTitle',$this->PHPShopSystem->getParam('name').' / Страницы');
  46.                     $this->set('pageNumN',"Результат: страниц - "count($dataArray));
  47.                 }
  48.                 else {
  49.                     $this->set('pageTitle',false);
  50.                     $this->set('pageNumN',false);
  51.                 }
  52.  
  53.                 $j++;
  54.  
  55.  
  56.  
  57.                 // Подключаем шаблон
  58.                 $this->addToTemplate($this->getValue('templates.main_search_forma'));
  59.             }
  60.  
  61.         $this->add('<p><br></p>',true);
  62.     }
  63.  
  64.  
  65.     /**
  66.      * Карта новостей
  67.      */
  68.     function newsmap(){
  69.         $this->set('pageFrom',"news");
  70.         $this->set('pageDomen',$_SERVER['SERVER_NAME']."/news/");
  71.         $j=0;
  72.  
  73.  
  74.         $PHPShopOrm &new PHPShopOrm($this->getValue('base.table_name8'));
  75.         $PHPShopOrm->debug=$this->debug;
  76.         $PHPShopOrm->Option['where']=" or ";
  77.         $dataArray=$PHPShopOrm->select(array('*'),false,array('order'=>'id desc'),array('limit'=>1000));
  78.         if(is_array($dataArray))
  79.             foreach($dataArray as $row{
  80.  
  81.                 // Определяем переменные
  82.                 $this->set('productName',$row['title']);
  83.                 $this->set('pageWords',$this->words);
  84.                 $this->set('productKey',substr(strip_tags($row['description']),0,200)."...");
  85.                 $this->set('pageLink',"ID_".$row['id'].".html");
  86.                 $i++;
  87.                 $this->set('productNum',$i);
  88.  
  89.                 if($j==0{
  90.                     $this->set('pageTitle',$this->PHPShopSystem->getParam('name').' / Новости');
  91.                     $this->set('pageNumN',"Результат: страниц - "count($dataArray));
  92.                 }
  93.                 else {
  94.                     $this->set('pageTitle',false);
  95.                     $this->set('pageNumN',false);
  96.                 }
  97.  
  98.                 $j++;
  99.  
  100.                 // Подключаем шаблон
  101.                 $this->addToTemplate($this->getValue('templates.main_search_forma'));
  102.             }
  103.  
  104.         $this->add('<p><br></p>',true);
  105.  
  106.     }
  107.  
  108.     /**
  109.      * Карта отзывов
  110.      */
  111.     function gbookmap(){
  112.  
  113.         $this->set('pageFrom',"gbook");
  114.         $this->set('pageDomen',$_SERVER['SERVER_NAME']."/gbook/");
  115.         $j=0;
  116.  
  117.  
  118.         $PHPShopOrm &new PHPShopOrm($this->getValue('base.table_name7'));
  119.         $PHPShopOrm->debug=$this->debug;
  120.         $PHPShopOrm->Option['where']=" or ";
  121.         $dataArray=$PHPShopOrm->select(array('*'),array('enabled'=>"='1'"),array('order'=>'id desc'),array('limit'=>1000));
  122.         if(is_array($dataArray))
  123.             foreach($dataArray as $row{
  124.  
  125.                 // Определяем переменные
  126.                 $this->set('productName',$row['title']);
  127.                 $this->set('pageWords',$this->words);
  128.                 $this->set('productKey',substr(strip_tags($row['question']),0,200)."...");
  129.                 $this->set('pageLink',"ID_".$row['id'].".html");
  130.                 $i++;
  131.                 $this->set('productNum',$i);
  132.  
  133.                 if($j==0{
  134.                     $this->set('pageTitle',$this->PHPShopSystem->getParam('name').' / Отзывы');
  135.                     $this->set('pageNumN',"Результат: страниц - "count($dataArray));
  136.                 }
  137.                 else {
  138.                     $this->set('pageTitle',false);
  139.                     $this->set('pageNumN',false);
  140.                 }
  141.  
  142.                 $j++;
  143.  
  144.                 // Подключаем шаблон
  145.                 $this->addToTemplate($this->getValue('templates.main_search_forma'));
  146.             }
  147.     }
  148.     
  149.     /**
  150.      * Экшен по умолчанию, вывод карты по страницам, новостям и отзывам
  151.      */
  152.     function index({
  153.  
  154.         $this->pagemap();
  155.         $this->newsmap();
  156.         $this->gbookmap();
  157.  
  158.         $this->set('searchString',$this->words);
  159.  
  160.         // Мета
  161.         $this->title="Карта сайта - ".$this->PHPShopSystem->getValue("name");
  162.  
  163.         $this->parseTemplate($this->getValue('templates.map_page_list'));
  164.     }
  165. }
  166. ?>

Documentation generated on Thu, 17 Feb 2011 15:58:38 +0300 by phpDocumentor 1.4.3