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.      * Карта HTML
  25.      */
  26.     function html({
  27.  
  28.         $j=0;
  29.         $dir="pageHTML/";
  30.  
  31.         $this->set('pageFrom',$this->getValue('system.path'));
  32.         if ($dh opendir($dir)) {
  33.             while (($file readdir($dh)) !== false{
  34.                 if($file != "." and $file != ".."{
  35.                     $fp fopen($dir.$file"r");
  36.                     $fstat fstat($fp);
  37.                     $Content=@fread($fp,$fstat['size']);
  38.                     fclose($fp);
  39.  
  40.                     $filename=explode(".",$file);
  41.  
  42.                     $meta=$this->getMeta($Content);
  43.                     if(empty($title)) $title=$filename[0].".html";
  44.  
  45.                     if(!empty($meta['title'])) {
  46.  
  47.                         // Определяем переменные
  48.                         $this->set('productName',$meta['title']);
  49.                         $this->set('pageWords',$this->words);
  50.                         $this->set('productKey',substr(strip_tags($Content),0,300)."...");
  51.                         $this->set('pageLink',$filename[0].".html");
  52.                         $i++;
  53.                         $this->set('productNum',$i);
  54.  
  55.                         $this->addToTemplate($this->getValue('templates.main_search_forma'));
  56.                     }
  57.                 }
  58.  
  59.             }
  60.  
  61.             closedir($dh);
  62.         }
  63.  
  64.         $this->add('<p><br></p>',true);
  65.     }
  66.  
  67.  
  68.     /**
  69.      * Экшен по умолчанию, вывод карты по страницам, новостям и отзывам
  70.      */
  71.     function index({
  72.  
  73.         $this->html();
  74.  
  75.         $this->set('searchString',$this->words);
  76.  
  77.         // Мета
  78.         $this->title="Карта сайта - ".$this->PHPShopSystem->getValue("name");
  79.  
  80.         $this->parseTemplate($this->getValue('templates.map_page_list'));
  81.     }
  82. }
  83. ?>

Documentation generated on Mon, 25 Jun 2012 15:09:48 +0400 by phpDocumentor 1.4.3