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