DedeV6移动版
Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

1026 рядки
44KB

  1. <?php
  2. if (!defined('DEDEINC')) exit('dedebiz');
  3. /**
  4. * 手机端文档列表
  5. *
  6. * @version $id:listview.m.class.php 10:46 2023年1月10日 xushubieli $
  7. * @package DedeBIZ.Libraries
  8. * @copyright Copyright (c) 2022 DedeBIZ.COM
  9. * @license https://www.dedebiz.com/license
  10. * @link https://www.dedebiz.com
  11. */
  12. require_once(DEDEINC.'/archive/partview.class.php');
  13. helper('cache');
  14. @set_time_limit(0);
  15. class ListViewMobile
  16. {
  17. var $dsql;
  18. var $dtp;
  19. var $dtp2;
  20. var $TypeID;
  21. var $TypeLink;
  22. var $PageNo;
  23. var $TotalPage;
  24. var $TotalResult;
  25. var $pagesize;
  26. var $ChannelUnit;
  27. var $ListType;
  28. var $Fields;
  29. var $PartView;
  30. var $upPageType;
  31. var $addSql;
  32. var $IsError;
  33. var $CrossID;
  34. var $IsReplace;
  35. var $remoteDir;
  36. var $is_mobile;
  37. /**
  38. * php5构造函数
  39. *
  40. * @access public
  41. * @param int $typeid 栏目id
  42. * @param int $uppage 上一页
  43. * @return string
  44. */
  45. function __construct($typeid, $uppage = 1)
  46. {
  47. global $dsql, $envs;
  48. $envs['url_type'] = 1;
  49. $this->TypeID = $typeid;
  50. $this->dsql = &$dsql;
  51. $this->CrossID = '';
  52. $this->IsReplace = false;
  53. $this->IsError = false;
  54. $this->dtp = new DedeTagParse();
  55. $this->dtp->SetRefObj($this);
  56. $this->dtp->SetNameSpace("dede", "{", "}");
  57. $this->dtp2 = new DedeTagParse();
  58. $this->dtp2->SetNameSpace("field", "[", "]");
  59. $this->TypeLink = new TypeLink($typeid);
  60. $this->upPageType = $uppage;
  61. $this->remoteDir = '';
  62. $this->is_mobile = true;
  63. $this->TotalResult = is_numeric($this->TotalResult) ? $this->TotalResult : "";
  64. if (!is_array($this->TypeLink->TypeInfos)) {
  65. $this->IsError = true;
  66. }
  67. if (!$this->IsError) {
  68. $this->ChannelUnit = new ChannelUnit($this->TypeLink->TypeInfos['channeltype']);
  69. $this->Fields = $this->TypeLink->TypeInfos;
  70. $this->Fields['id'] = $typeid;
  71. $this->Fields['position'] = $this->TypeLink->GetPositionLink(true);
  72. $this->Fields['title'] = preg_replace("/[<>]/", " / ", $this->TypeLink->GetPositionLink(false));
  73. //添加联动单筛选
  74. if (isset($_REQUEST['tid'])) {
  75. foreach($_GET as $key => $value) {
  76. if ($key!="tid" && $key!="TotalResult" && $key!="PageNo") {
  77. $this->Fields[string_filter($key)] = string_filter(urldecode($value));
  78. }
  79. }
  80. }
  81. //设置一些全局参数的值
  82. foreach ($GLOBALS['PubFields'] as $k => $v) $this->Fields[$k] = $v;
  83. $this->Fields['rsslink'] = $GLOBALS['cfg_cmsurl']."/static/rss/".$this->TypeID.".xml";
  84. //设置环境变量
  85. SetSysEnv($this->TypeID, $this->Fields['typename'], 0, '', 'list');
  86. $this->Fields['typeid'] = $this->TypeID;
  87. //获得交叉栏目id
  88. if ($this->TypeLink->TypeInfos['cross'] > 0 && $this->TypeLink->TypeInfos['ispart'] == 0) {
  89. $selquery = '';
  90. if ($this->TypeLink->TypeInfos['cross'] == 1) {
  91. $selquery = "SELECT id,topid FROM `#@__arctype` WHERE typename LIKE '{$this->Fields['typename']}' AND id<>'{$this->TypeID}' AND topid<>'{$this->TypeID}' ";
  92. } else {
  93. $this->Fields['crossid'] = preg_replace('/[^0-9,]/', '', trim($this->Fields['crossid']));
  94. if ($this->Fields['crossid'] != '') {
  95. $selquery = "SELECT id,topid FROM `#@__arctype` WHERE id in({$this->Fields['crossid']}) AND id<>{$this->TypeID} AND topid<>{$this->TypeID} ";
  96. }
  97. }
  98. if ($selquery != '') {
  99. $this->dsql->SetQuery($selquery);
  100. $this->dsql->Execute();
  101. while ($arr = $this->dsql->GetArray()) {
  102. $this->CrossID .= ($this->CrossID == '' ? $arr['id'] : ','.$arr['id']);
  103. }
  104. }
  105. }
  106. }//!error
  107. }
  108. //php4构造函数
  109. function ListView($typeid, $uppage = 0)
  110. {
  111. $this->__construct($typeid, $uppage);
  112. }
  113. //关闭相关资源
  114. function Close()
  115. {
  116. }
  117. /**
  118. * 统计列表里的记录
  119. *
  120. * @access public
  121. * @param string
  122. * @return string
  123. */
  124. function CountRecord()
  125. {
  126. global $cfg_list_son, $cfg_need_typeid2, $cfg_cross_sectypeid;
  127. if (empty($cfg_need_typeid2)) $cfg_need_typeid2 = 'N';
  128. $filtersql = '';
  129. //获得附加表的相关信息,联动单筛选
  130. $addtable = $this->ChannelUnit->ChannelInfos['addtable'];
  131. if ($addtable!="") {
  132. $addJoin = " LEFT JOIN `$addtable` ON arc.id = ".$addtable.'.aid ';
  133. $addField = '';
  134. $fields = explode(',',$this->ChannelUnit->ChannelInfos['listfields']);
  135. foreach($fields as $k=>$v)
  136. {
  137. $nfields[$v] = $k;
  138. }
  139. if (is_array($this->ChannelUnit->ChannelFields) && !empty($this->ChannelUnit->ChannelFields)) {
  140. foreach($this->ChannelUnit->ChannelFields as $k=>$arr)
  141. {
  142. if (isset($nfields[$k])) {
  143. if (!empty($arr['rename'])) {
  144. $addField .= ','.$addtable.'.'.$k.' as '.$arr['rename'];
  145. } else {
  146. $addField .= ','.$addtable.'.'.$k;
  147. }
  148. }
  149. }
  150. }
  151. if (isset($_REQUEST['tid'])) {
  152. foreach ($_GET as $key => $value) {
  153. $filtersql .= ($key!="tid" && $key!="TotalResult" && $key!="PageNo") ? " AND $addtable.".string_filter($key)." = '".string_filter(urldecode($value))."'" : '';
  154. }
  155. }
  156. } else {
  157. $addField = '';
  158. $addJoin = '';
  159. }
  160. //统计数据库记录
  161. $this->TotalResult = -1;
  162. if (isset($GLOBALS['TotalResult'])) $this->TotalResult = $GLOBALS['TotalResult'];
  163. if (isset($GLOBALS['PageNo'])) $this->PageNo = $GLOBALS['PageNo'];
  164. else $this->PageNo = 1;
  165. $this->addSql = " arc.arcrank > -1 ";
  166. $typeid2like = " '%,{$this->TypeID},%' ";
  167. if ($cfg_list_son == 'N') {
  168. if ($cfg_need_typeid2 == 'N') {
  169. if ($this->CrossID == '') $this->addSql .= " AND (arc.typeid='".$this->TypeID."') ";
  170. else $this->addSql .= " AND (arc.typeid in({$this->CrossID},{$this->TypeID})) ";
  171. } else {
  172. if ($this->CrossID == '') {
  173. $this->addSql .= " AND ( (arc.typeid='".$this->TypeID."') OR CONCAT(',', arc.typeid2, ',') LIKE $typeid2like) ";
  174. } else {
  175. if ($cfg_cross_sectypeid == 'Y') {
  176. $typeid2Clike = " '%,{$this->CrossID},%' ";
  177. $this->addSql .= " AND ( arc.typeid IN({$this->CrossID},{$this->TypeID}) OR CONCAT(',', arc.typeid2, ',') LIKE $typeid2like OR CONCAT(',', arc.typeid2, ',') LIKE $typeid2Clike)";
  178. } else {
  179. $this->addSql .= " AND ( arc.typeid IN({$this->CrossID},{$this->TypeID}) OR CONCAT(',', arc.typeid2, ',') LIKE $typeid2like)";
  180. }
  181. }
  182. }
  183. } else {
  184. $sonids = GetSonIds($this->TypeID, $this->Fields['channeltype']);
  185. if (!preg_match("/,/", $sonids)) {
  186. $sonidsCon = " arc.typeid = '$sonids' ";
  187. } else {
  188. $sonidsCon = " arc.typeid IN($sonids) ";
  189. }
  190. if ($cfg_need_typeid2 == 'N') {
  191. if ($this->CrossID == '') $this->addSql .= " AND ( $sonidsCon ) ";
  192. else $this->addSql .= " AND ( arc.typeid IN ({$sonids},{$this->CrossID}) ) ";
  193. } else {
  194. if ($this->CrossID == '') {
  195. $this->addSql .= " AND ( $sonidsCon OR CONCAT(',', arc.typeid2, ',') like $typeid2like ) ";
  196. } else {
  197. if ($cfg_cross_sectypeid == 'Y') {
  198. $typeid2Clike = " '%,{$this->CrossID},%' ";
  199. $this->addSql .= " AND ( arc.typeid IN ({$sonids},{$this->CrossID}) OR CONCAT(',', arc.typeid2, ',') LIKE $typeid2like OR CONCAT(',', arc.typeid2, ',') LIKE $typeid2Clike) ";
  200. } else {
  201. $this->addSql .= " AND ( arc.typeid IN ({$sonids},{$this->CrossID}) OR CONCAT(',', arc.typeid2, ',') LIKE $typeid2like) ";
  202. }
  203. }
  204. }
  205. }
  206. if ($this->TotalResult==-1) {
  207. //添加联动单筛选
  208. $cquery = "SELECT COUNT(*) AS dd FROM `#@__arctiny` arc $addJoin WHERE ".$this->addSql.$filtersql;
  209. $row = $this->dsql->GetOne($cquery);
  210. if (is_array($row)) {
  211. $this->TotalResult = $row['dd'];
  212. } else {
  213. $this->TotalResult = 0;
  214. }
  215. }
  216. //初始化列表模板,并统计页面总数
  217. $tempfile = $GLOBALS['cfg_basedir'].$GLOBALS['cfg_templets_dir']."/".$this->TypeLink->TypeInfos['templist'];
  218. $tempfile = str_replace("{tid}", $this->TypeID, $tempfile);
  219. $tempfile = str_replace("{cid}", $this->ChannelUnit->ChannelInfos['nid'], $tempfile);
  220. if ($this->is_mobile) {
  221. $tempfile = str_replace('.htm', '_m.htm', $tempfile);
  222. }
  223. if (!file_exists($tempfile)) {
  224. $tempfile = $GLOBALS['cfg_basedir'].$GLOBALS['cfg_templets_dir']."/".$GLOBALS['cfg_df_style']."/list_default.htm";
  225. if ($this->is_mobile) {
  226. $tempfile = str_replace('.htm', '_m.htm', $tempfile);
  227. }
  228. }
  229. if (!file_exists($tempfile) || !is_file($tempfile)) {
  230. echo "主题模板文件不存在,无法发布文档";
  231. exit();
  232. }
  233. $this->dtp->LoadTemplate($tempfile);
  234. $ctag = $this->dtp->GetTag("page");
  235. if (!is_object($ctag)) {
  236. $ctag = $this->dtp->GetTag("list");
  237. }
  238. if (!is_object($ctag)) {
  239. $this->pagesize = 30;
  240. } else {
  241. if ($ctag->GetAtt("pagesize") != "") {
  242. $this->pagesize = $ctag->GetAtt("pagesize");
  243. } else {
  244. $this->pagesize = 30;
  245. }
  246. }
  247. $this->TotalPage = ceil($this->TotalResult / $this->pagesize);
  248. }
  249. /**
  250. * 列表创建网页
  251. *
  252. * @access public
  253. * @param string $startpage 开始页面
  254. * @param string $makepagesize 创建文件数目
  255. * @param string $isremote 是否为远程
  256. * @return string
  257. */
  258. function MakeHtml($startpage = 1, $makepagesize = 0, $isremote = 0)
  259. {
  260. global $dedebiz_path, $dedebiz_typerule, $dedebiz_usetype;
  261. if (empty($startpage)) {
  262. $startpage = 1;
  263. }
  264. //创建封面模板文件
  265. if ($this->TypeLink->TypeInfos['isdefault'] == -1) {
  266. echo '这个是动态栏目';
  267. return '../m/list.php?tid='.$this->TypeLink->TypeInfos['id'];
  268. }
  269. //单独页面
  270. else if ($this->TypeLink->TypeInfos['ispart'] > 0) {
  271. $reurl = $this->MakePartTemplets();
  272. return $reurl;
  273. }
  274. if (empty($this->TotalResult)) $this->CountRecord();
  275. //初步给固定值的标记赋值
  276. $this->ParseTempletsFirst();
  277. $totalpage = ceil($this->TotalResult / $this->pagesize);
  278. if ($totalpage == 0) {
  279. $totalpage = 1;
  280. }
  281. //栏目规则
  282. $dedebiz_path = rtrim($dedebiz_path,'/') ? rtrim($dedebiz_path,'/') : '/m';
  283. if ($dedebiz_usetype==0 && $dedebiz_typerule) {
  284. $typedir = str_replace("{cmspath}","",$this->Fields['typedir']);
  285. $this->Fields['typedir'] = '{cmspath}'.$dedebiz_path.$typedir;
  286. $this->Fields['typedir'] = substr($this->Fields['typedir'],0,9).$dedebiz_path.substr($this->Fields['typedir'],9);
  287. $this->Fields['namerule2'] = $dedebiz_typerule;
  288. } else {
  289. $typedir = str_replace("{cmspath}","",$this->Fields['typedir']);
  290. $this->Fields['typedir'] = '{cmspath}'.$dedebiz_path.$typedir;
  291. }
  292. CreateDir(MfTypedir($this->Fields['typedir']));
  293. $murl = '';
  294. if ($makepagesize > 0) {
  295. $endpage = $startpage + $makepagesize;
  296. } else {
  297. $endpage = ($totalpage + 1);
  298. }
  299. if ($endpage >= $totalpage + 1) {
  300. $endpage = $totalpage + 1;
  301. }
  302. if ($endpage == 1) {
  303. $endpage = 2;
  304. }
  305. for ($this->PageNo = $startpage; $this->PageNo < $endpage; $this->PageNo++) {
  306. $this->ParseDMFields($this->PageNo, 1);
  307. $makeFile = $this->GetMakeFileRule($this->Fields['id'], 'list', $this->Fields['typedir'], '', $this->Fields['namerule2']);
  308. $makeFile = str_replace("{page}", $this->PageNo, $makeFile);
  309. $murl = $makeFile;
  310. if (!preg_match("/^\//", $makeFile)) {
  311. $makeFile = "/".$makeFile;
  312. }
  313. $makeFile = $this->GetTruePath().$makeFile;
  314. $makeFile = preg_replace("/\/{1,}/", "/", $makeFile);
  315. $murl = $this->GetTrueUrl($murl);
  316. $this->dtp->SaveTo($makeFile);
  317. if (PHP_SAPI === 'cli') {
  318. DedeCli::showProgress(ceil(($this->PageNo / ($endpage-1)) * 100), 100);
  319. }
  320. }
  321. if ($startpage == 1) {
  322. //如果列表启用封面文件,复制这个文件第一页
  323. if ($this->TypeLink->TypeInfos['isdefault'] == 1 && $this->TypeLink->TypeInfos['ispart'] == 0) {
  324. $onlyrule = $this->GetMakeFileRule($this->Fields['id'], "list", $this->Fields['typedir'], '', $this->Fields['namerule2']);
  325. $onlyrule = str_replace("{page}", "1", $onlyrule);
  326. $list_1 = $this->GetTruePath().$onlyrule;
  327. $murl = MfTypedir($this->Fields['typedir']).'/'.$this->Fields['defaultname'];
  328. $indexname = $this->GetTruePath().$murl;
  329. copy($list_1, $indexname);
  330. }
  331. }
  332. return $murl;
  333. }
  334. /**
  335. * 显示列表
  336. *
  337. * @access public
  338. * @return void
  339. */
  340. function Display()
  341. {
  342. if ($this->TypeLink->TypeInfos['ispart'] > 0) {
  343. $this->DisplayPartTemplets();
  344. return;
  345. }
  346. $this->CountRecord();
  347. if ((empty($this->PageNo) || $this->PageNo == 1) && $this->TypeLink->TypeInfos['ispart'] == 1) {
  348. $tmpdir = $GLOBALS['cfg_basedir'].$GLOBALS['cfg_templets_dir'];
  349. $tempfile = str_replace("{tid}", $this->TypeID, $this->Fields['tempindex']);
  350. $tempfile = str_replace("{cid}", $this->ChannelUnit->ChannelInfos['nid'], $tempfile);
  351. $tempfile = $tmpdir."/".$tempfile;
  352. if ($this->is_mobile) {
  353. $tempfile = str_replace('.htm', '_m.htm', $tempfile);
  354. }
  355. if (!file_exists($tempfile)) {
  356. $tempfile = $tmpdir."/".$GLOBALS['cfg_df_style']."/index_default.htm";
  357. if ($this->is_mobile) {
  358. $tempfile = str_replace('.htm', '_m.htm', $tempfile);
  359. }
  360. }
  361. $this->dtp->LoadTemplate($tempfile);
  362. }
  363. $this->ParseTempletsFirst();
  364. $this->ParseDMFields($this->PageNo, 0);
  365. $this->dtp->Display();
  366. }
  367. /**
  368. * 创建单独模板页面
  369. *
  370. * @access public
  371. * @return string
  372. */
  373. function MakePartTemplets()
  374. {
  375. global $dedebiz_path, $dedebiz_usetype, $dedebiz_typerule;
  376. $this->PartView = new PartView($this->TypeID, false);
  377. $this->PartView->SetTypeLink($this->TypeLink);
  378. $nmfa = 0;
  379. $tmpdir = $GLOBALS['cfg_basedir'].$GLOBALS['cfg_templets_dir'];
  380. if ($this->Fields['ispart'] == 1) {
  381. $tempfile = str_replace("{tid}", $this->TypeID, $this->Fields['tempindex']);
  382. $tempfile = str_replace("{cid}", $this->ChannelUnit->ChannelInfos['nid'], $tempfile);
  383. $tempfile = $tmpdir."/".$tempfile;
  384. if ($this->is_mobile) {
  385. $tempfile = str_replace('.htm', '_m.htm', $tempfile);
  386. }
  387. if (!file_exists($tempfile)) {
  388. $tempfile = $tmpdir."/".$GLOBALS['cfg_df_style']."/index_default.htm";
  389. if ($this->is_mobile) {
  390. $tempfile = str_replace('.htm', '_m.htm', $tempfile);
  391. }
  392. }
  393. $this->PartView->SetTemplet($tempfile);
  394. } else if ($this->Fields['ispart'] == 2) {
  395. //跳转网址
  396. return $this->Fields['typedir'];
  397. }
  398. //栏目规则
  399. $dedebiz_path = rtrim($dedebiz_path,'/') ? rtrim($dedebiz_path,'/') : '/m';
  400. if ($dedebiz_usetype==0 && $dedebiz_typerule) {
  401. $typedir = str_replace("{cmspath}","",$this->Fields['typedir']);
  402. $this->Fields['typedir'] = '{cmspath}'.$dedebiz_path.$typedir;
  403. $this->Fields['typedir'] = substr($this->Fields['typedir'],0,9).$dedebiz_path.substr($this->Fields['typedir'],9);
  404. $this->Fields['namerule2'] = $dedebiz_typerule;
  405. } else {
  406. $typedir = str_replace("{cmspath}","",$this->Fields['typedir']);
  407. $this->Fields['typedir'] = '{cmspath}'.$dedebiz_path.$typedir;
  408. }
  409. CreateDir(MfTypedir($this->Fields['typedir']));
  410. $makeUrl = $this->GetMakeFileRule($this->Fields['id'], "index", MfTypedir($this->Fields['typedir']), $this->Fields['defaultname'], $this->Fields['namerule2']);
  411. $makeUrl = preg_replace("/\/{1,}/", "/", $makeUrl);
  412. $makeFile = $this->GetTruePath().$makeUrl;
  413. if ($nmfa == 0) {
  414. $this->PartView->SaveToHtml($makeFile);
  415. } else {
  416. if (!file_exists($makeFile)) {
  417. $this->PartView->SaveToHtml($makeFile);
  418. }
  419. }
  420. return $this->GetTrueUrl($makeUrl);
  421. }
  422. /**
  423. * 显示单独模板页面
  424. *
  425. * @access public
  426. * @param string
  427. * @return string
  428. */
  429. function DisplayPartTemplets()
  430. {
  431. $this->PartView = new PartView($this->TypeID, false);
  432. $this->PartView->SetTypeLink($this->TypeLink);
  433. $nmfa = 0;
  434. $tmpdir = $GLOBALS['cfg_basedir'].$GLOBALS['cfg_templets_dir'];
  435. if ($this->Fields['ispart'] == 1) {
  436. //封面模板
  437. $tempfile = str_replace("{tid}", $this->TypeID, $this->Fields['tempindex']);
  438. $tempfile = str_replace("{cid}", $this->ChannelUnit->ChannelInfos['nid'], $tempfile);
  439. $tempfile = $tmpdir."/".$tempfile;
  440. if ($this->is_mobile) {
  441. $tempfile = str_replace('.htm', '_m.htm', $tempfile);
  442. }
  443. if (!file_exists($tempfile)) {
  444. $tempfile = $tmpdir."/".$GLOBALS['cfg_df_style']."/index_default.htm";
  445. if ($this->is_mobile) {
  446. $tempfile = str_replace('.htm', '_m.htm', $tempfile);
  447. }
  448. }
  449. $this->PartView->SetTemplet($tempfile);
  450. } else if ($this->Fields['ispart'] == 2) {
  451. //跳转网址
  452. $gotourl = $this->Fields['typedir'];
  453. header("Location:$gotourl");
  454. exit();
  455. }
  456. CreateDir(MfTypedir($this->Fields['typedir']));
  457. $makeUrl = $this->GetMakeFileRule($this->Fields['id'], "index", MfTypedir($this->Fields['typedir']), $this->Fields['defaultname'], $this->Fields['namerule2']);
  458. $makeFile = $this->GetTruePath().$makeUrl;
  459. if ($nmfa == 0) {
  460. $this->PartView->Display();
  461. } else {
  462. if (!file_exists($makeFile)) {
  463. $this->PartView->Display();
  464. } else {
  465. include($makeFile);
  466. }
  467. }
  468. }
  469. /**
  470. * 获得站点的真实根路径
  471. *
  472. * @access public
  473. * @return string
  474. */
  475. function GetTruePath()
  476. {
  477. $truepath = $GLOBALS["cfg_basedir"];
  478. return $truepath;
  479. }
  480. /**
  481. * 获得真实连接路径
  482. *
  483. * @access public
  484. * @param string $nurl 地址
  485. * @return string
  486. */
  487. function GetTrueUrl($nurl)
  488. {
  489. if ($this->Fields['moresite'] == 1) {
  490. if ($this->Fields['sitepath'] != '') {
  491. $nurl = preg_replace("/^".$this->Fields['sitepath']."/", '', $nurl);
  492. }
  493. $nurl = $this->Fields['siteurl'].$nurl;
  494. }
  495. return $nurl;
  496. }
  497. /**
  498. * 解析模板,对固定的标记进行初始给值
  499. *
  500. * @access public
  501. * @return string
  502. */
  503. function ParseTempletsFirst()
  504. {
  505. if (isset($this->TypeLink->TypeInfos['reid'])) {
  506. $GLOBALS['envs']['reid'] = $this->TypeLink->TypeInfos['reid'];
  507. }
  508. $GLOBALS['envs']['typeid'] = $this->TypeID;
  509. $GLOBALS['envs']['topid'] = GetTopid($this->Fields['typeid']);
  510. $GLOBALS['envs']['cross'] = 1;
  511. MakeOneTag($this->dtp, $this);
  512. }
  513. /**
  514. * 解析模板,对文档里的变动进行赋值
  515. *
  516. * @access public
  517. * @param int $PageNo 页数
  518. * @param int $ismake 是否编译
  519. * @return string
  520. */
  521. function ParseDMFields($PageNo, $ismake = 1)
  522. {
  523. //替换第二页后的文档
  524. if (($PageNo > 1 || strlen($this->Fields['content']) < 10) && !$this->IsReplace) {
  525. $this->dtp->SourceString = str_replace('[cmsreplace]', 'display:none', $this->dtp->SourceString);
  526. $this->IsReplace = true;
  527. }
  528. foreach ($this->dtp->CTags as $tagid => $ctag) {
  529. if ($ctag->GetName() == "list") {
  530. $limitstart = ($this->PageNo - 1) * $this->pagesize;
  531. $row = $this->pagesize;
  532. if (trim($ctag->GetInnerText()) == "") {
  533. $InnerText = GetSysTemplets("list_fulllist.htm");
  534. } else {
  535. $InnerText = trim($ctag->GetInnerText());
  536. }
  537. $this->dtp->Assign(
  538. $tagid,
  539. $this->GetArcList(
  540. $limitstart,
  541. $row,
  542. $ctag->GetAtt("col"),
  543. $ctag->GetAtt("titlelen"),
  544. $ctag->GetAtt("infolen"),
  545. $ctag->GetAtt("imgwidth"),
  546. $ctag->GetAtt("imgheight"),
  547. $ctag->GetAtt("listtype"),
  548. $ctag->GetAtt("orderby"),
  549. $InnerText,
  550. $ctag->GetAtt("tablewidth"),
  551. $ismake,
  552. $ctag->GetAtt("orderway")
  553. )
  554. );
  555. } else if ($ctag->GetName() == "pagelist") {
  556. $list_len = trim($ctag->GetAtt("listsize"));
  557. $ctag->GetAtt("listitem") == "" ? $listitem = "index,pre,pageno,next,end,option" : $listitem = $ctag->GetAtt("listitem");
  558. if ($list_len == "") {
  559. $list_len = 3;
  560. }
  561. if ($ismake == 0) {
  562. $this->dtp->Assign($tagid, $this->GetPageListDM($list_len, $listitem));
  563. } else {
  564. $this->dtp->Assign($tagid, $this->GetPageListST($list_len, $listitem));
  565. }
  566. } else if ($PageNo != 1 && $ctag->GetName() == 'field' && $ctag->GetAtt('display') != '') {
  567. $this->dtp->Assign($tagid, '');
  568. }
  569. }
  570. }
  571. /**
  572. * 获得要创建的文件名称规则
  573. *
  574. * @access public
  575. * @param int $typeid 栏目id
  576. * @param string $wname
  577. * @param string $typedir 栏目目录
  578. * @param string $defaultname 默认名称
  579. * @param string $namerule2 栏目规则
  580. * @return string
  581. */
  582. function GetMakeFileRule($typeid, $wname, $typedir, $defaultname, $namerule2)
  583. {
  584. $typedir = MfTypedir($typedir);
  585. if ($wname == 'index') {
  586. return $typedir.'/'.$defaultname;
  587. } else {
  588. $namerule2 = str_replace('{tid}', $typeid, $namerule2);
  589. $namerule2 = str_replace('{typedir}', $typedir, $namerule2);
  590. return $namerule2;
  591. }
  592. }
  593. /**
  594. * 获得一个单列的文档列表
  595. *
  596. * @access public
  597. * @param int $limitstart 限制开始
  598. * @param int $row 行数
  599. * @param int $col 列数
  600. * @param int $titlelen 标题长度
  601. * @param int $infolen 描述长度
  602. * @param int $imgwidth 图片宽度
  603. * @param int $imgheight 图片高度
  604. * @param string $listtype 列表类型
  605. * @param string $orderby 排列顺序
  606. * @param string $innertext 底层模板
  607. * @param string $tablewidth 表格宽度
  608. * @param string $ismake 是否编译
  609. * @param string $orderWay 排序方式
  610. * @return string
  611. */
  612. function GetArcList(
  613. $limitstart = 0,
  614. $row = 10,
  615. $col = 1,
  616. $titlelen = 30,
  617. $infolen = 250,
  618. $imgwidth = 120,
  619. $imgheight = 90,
  620. $listtype = "all",
  621. $orderby = "default",
  622. $innertext = "",
  623. $tablewidth = "100",
  624. $ismake = 1,
  625. $orderWay = 'desc'
  626. ) {
  627. global $cfg_list_son, $cfg_digg_update;
  628. $typeid = $this->TypeID;
  629. if ($row == '') $row = 10;
  630. if ($limitstart == '') $limitstart = 0;
  631. if ($titlelen == '') $titlelen = 100;
  632. if ($infolen == '') $infolen = 250;
  633. if ($imgwidth == '') $imgwidth = 120;
  634. if ($imgheight == '') $imgheight = 120;
  635. if ($listtype == '') $listtype = 'all';
  636. if ($orderWay == '') $orderWay = 'desc';
  637. if ($orderby == '') {
  638. $orderby = 'default';
  639. } else {
  640. $orderby = strtolower($orderby);
  641. }
  642. $tablewidth = str_replace('%', '', $tablewidth);
  643. if ($tablewidth == '') $tablewidth = 100;
  644. if ($col == '') $col = 1;
  645. $colWidth = ceil(100 / $col);
  646. $tablewidth = $tablewidth.'%';
  647. $colWidth = $colWidth.'%';
  648. $innertext = trim($innertext);
  649. if ($innertext == '') {
  650. $innertext = GetSysTemplets('list_fulllist.htm');
  651. }
  652. //排序方式
  653. $ordersql = '';
  654. if ($orderby == "senddate" || $orderby == "id") {
  655. $ordersql = " ORDER BY arc.id $orderWay";
  656. } else if ($orderby == "hot" || $orderby == "click") {
  657. $ordersql = " ORDER BY arc.click $orderWay";
  658. } else if ($orderby == "lastpost") {
  659. $ordersql = " ORDER BY arc.lastpost $orderWay";
  660. } else {
  661. $ordersql = " ORDER BY arc.sortrank $orderWay";
  662. }
  663. //获得附加表的相关信息
  664. $addtable = $this->ChannelUnit->ChannelInfos['addtable'];
  665. $filtersql = "";
  666. if ($addtable!="")
  667. {
  668. $addJoin = " LEFT JOIN `$addtable` ON arc.id = ".$addtable.'.aid ';
  669. $addField = '';
  670. $fields = explode(',',$this->ChannelUnit->ChannelInfos['listfields']);
  671. foreach($fields as $k=>$v)
  672. {
  673. $nfields[$v] = $k;
  674. }
  675. if (is_array($this->ChannelUnit->ChannelFields) && !empty($this->ChannelUnit->ChannelFields)) {
  676. foreach($this->ChannelUnit->ChannelFields as $k=>$arr)
  677. {
  678. if (isset($nfields[$k])) {
  679. if (!empty($arr['rename'])) {
  680. $addField .= ','.$addtable.'.'.$k.' as '.$arr['rename'];
  681. }
  682. else {
  683. $addField .= ','.$addtable.'.'.$k;
  684. }
  685. }
  686. }
  687. }
  688. //添加联动单筛选
  689. if (isset($_REQUEST['tid'])) {
  690. foreach($_GET as $key => $value)
  691. {
  692. $filtersql .= ($key!="tid" && $key!="TotalResult" && $key!="PageNo") ? " AND $addtable.".string_filter($key)." = '".string_filter(urldecode($value))."'" : '';
  693. }
  694. }
  695. } else {
  696. $addField = '';
  697. $addJoin = '';
  698. }
  699. //如果不用默认的sortrank或id排序,使用联合查询数据量大时非常缓慢
  700. if (preg_match('/hot|click|lastpost/', $orderby)) {
  701. $query = "SELECT arc.*,tp.typedir,tp.typename,tp.isdefault,tp.defaultname,tp.namerule,tp.namerule2,tp.ispart,tp.moresite,tp.siteurl,tp.sitepath,mb.uname,mb.face $addField FROM `#@__archives` arc LEFT JOIN `#@__arctype` tp ON arc.typeid=tp.id LEFT JOIN `#@__member` mb ON arc.mid=mb.mid $addJoin WHERE {$this->addSql} $filtersql $ordersql LIMIT $limitstart,$row";
  702. }
  703. //普通情况先从arctiny表查出id,然后按di查询速度非常快
  704. else {
  705. $t1 = ExecTime();
  706. $ids = array();
  707. $query = "SELECT id FROM `#@__arctiny` arc $addJoin WHERE {$this->addSql} $filtersql $ordersql LIMIT $limitstart,$row";
  708. $this->dsql->SetQuery($query);
  709. $this->dsql->Execute();
  710. while ($arr = $this->dsql->GetArray()) {
  711. $ids[] = $arr['id'];
  712. }
  713. $idstr = join(',', $ids);
  714. if ($idstr == '') {
  715. return '';
  716. } else {
  717. $query = "SELECT arc.*,tp.typedir,tp.typename,tp.corank,tp.isdefault,tp.defaultname,tp.namerule,tp.namerule2,tp.ispart,tp.moresite,tp.siteurl,tp.sitepath,mb.uname,mb.face $addField FROM `#@__archives` arc LEFT JOIN `#@__arctype` tp ON arc.typeid=tp.id LEFT JOIN `#@__member` mb ON arc.mid=mb.mid $addJoin WHERE arc.id in($idstr) $ordersql ";
  718. }
  719. $t2 = ExecTime();
  720. }
  721. $this->dsql->SetQuery($query);
  722. $this->dsql->Execute('al');
  723. $t2 = ExecTime();
  724. $artlist = '';
  725. $this->dtp2->LoadSource($innertext);
  726. $GLOBALS['autoindex'] = 0;
  727. for ($i = 0; $i < $row; $i++) {
  728. if ($col > 1) {
  729. $artlist .= "<div>";
  730. }
  731. for ($j = 0; $j < $col; $j++) {
  732. if ($row = $this->dsql->GetArray("al")) {
  733. $GLOBALS['autoindex']++;
  734. $ids[$row['id']] = $row['id'];
  735. //处理一些特殊字段
  736. $row['infos'] = cn_substr($row['description'], $infolen);
  737. $row['id'] = $row['id'];
  738. if ($row['corank'] > 0 && $row['arcrank'] == 0) {
  739. $row['arcrank'] = $row['corank'];
  740. }
  741. $row['filename'] = $row['arcurl'] = GetFileUrl(
  742. $row['id'],
  743. $row['typeid'],
  744. $row['senddate'],
  745. $row['title'],
  746. $row['ismake'],
  747. $row['arcrank'],
  748. $row['namerule'],
  749. $row['typedir'],
  750. $row['money'],
  751. $row['filename'],
  752. $row['moresite'],
  753. $row['siteurl'],
  754. $row['sitepath']
  755. );
  756. $row['typeurl'] = GetTypeUrl(
  757. $row['typeid'],
  758. MfTypedir($row['typedir']),
  759. $row['isdefault'],
  760. $row['defaultname'],
  761. $row['ispart'],
  762. $row['namerule2'],
  763. $row['moresite'],
  764. $row['siteurl'],
  765. $row['sitepath']
  766. );
  767. if ($row['litpic'] == '-' || $row['litpic'] == '') {
  768. $row['litpic'] = $GLOBALS['cfg_cmspath'].'/static/web/img/thumbnail.jpg';
  769. }
  770. /*if (!preg_match("/^http:\/\//i", $row['litpic']) && $GLOBALS['cfg_multi_site'] == 'Y') {
  771. $row['litpic'] = $GLOBALS['cfg_mainsite'].$row['litpic'];
  772. }*/
  773. $row['picname'] = $row['litpic'];
  774. $row['stime'] = GetDateMK($row['pubdate']);
  775. $row['typelink'] = "<a href='".$row['typeurl']."'>".$row['typename']."</a>";
  776. $row['image'] = "<img src='".$row['picname']."' width='$imgwidth' height='$imgheight' title='".preg_replace("/['><]/", "", $row['title'])."'>";
  777. $row['imglink'] = "<a href='".$row['filename']."'>".$row['image']."</a>";
  778. $row['fulltitle'] = $row['title'];
  779. $row['title'] = cn_substr($row['title'], $titlelen);
  780. if ($row['color'] != '') {
  781. $row['title'] = "<span style='color:".$row['color']."'>".$row['title']."</span>";
  782. }
  783. if (preg_match('/c/', $row['flag'])) {
  784. $row['title'] = "".$row['title']."";
  785. }
  786. $row['face'] = empty($row['face'])? $GLOBALS['cfg_mainsite'].'/static/web/img/admin.png' : $row['face'];
  787. $row['textlink'] = "<a href='".$row['filename']."'>".$row['title']."</a>";
  788. $row['plusurl'] = $row['phpurl'] = $GLOBALS['cfg_phpurl'];
  789. $row['memberurl'] = $GLOBALS['cfg_memberurl'];
  790. $row['templeturl'] = $GLOBALS['cfg_templeturl'];
  791. //编译附加表里的数据
  792. foreach ($row as $k => $v) {
  793. $row[strtolower($k)] = $v;
  794. }
  795. foreach ($this->ChannelUnit->ChannelFields as $k => $arr) {
  796. if (isset($row[$k])) {
  797. $row[$k] = $this->ChannelUnit->MakeField($k, $row[$k]);
  798. }
  799. }
  800. if (is_array($this->dtp2->CTags)) {
  801. foreach ($this->dtp2->CTags as $k => $ctag) {
  802. if ($ctag->GetName() == 'array') {
  803. //传递整个数组,在runphp模式中有特殊作用
  804. $this->dtp2->Assign($k, $row);
  805. } else {
  806. if (isset($row[$ctag->GetName()])) {
  807. $this->dtp2->Assign($k, $row[$ctag->GetName()]);
  808. } else {
  809. $this->dtp2->Assign($k, '');
  810. }
  811. }
  812. }
  813. }
  814. $artlist .= $this->dtp2->GetResult();
  815. }//if hasRow
  816. }//Loop Col
  817. if ($col > 1) {
  818. $i += $col - 1;
  819. $artlist .= "</div>";
  820. }
  821. }//Loop Line
  822. $t3 = ExecTime();
  823. $this->dsql->FreeResult('al');
  824. return $artlist;
  825. }
  826. /**
  827. * 获取静态的分页列表
  828. *
  829. * @access public
  830. * @param string $list_len 列表宽度
  831. * @param string $list_len 列表样式
  832. * @return string
  833. */
  834. function GetPageListST($list_len, $listitem = "index,end,pre,next,pageno")
  835. {
  836. global $cfg_cmspath;
  837. $prepage = $nextpage = '';
  838. $prepagenum = $this->PageNo - 1;
  839. $nextpagenum = $this->PageNo + 1;
  840. if ($list_len == '' || preg_match("/[^0-9]/", $list_len)) {
  841. $list_len = 3;
  842. }
  843. $totalpage = ceil($this->TotalResult / $this->pagesize);
  844. if ($totalpage <= 1 && $this->TotalResult > 0) {
  845. return "<li class='page-item disabled'><span class='page-link'>1页".$this->TotalResult."条</span></li>\r\n";
  846. }
  847. if ($this->TotalResult == 0) {
  848. return "<li class='page-item disabled'><span class='page-link'>0页".$this->TotalResult."条</span></li>\r\n";
  849. }
  850. $purl = $this->GetCurUrl();
  851. $maininfo = "<li class='page-item disabled'><span class='page-link'>{$totalpage}页".$this->TotalResult."条</span></li>\r\n";
  852. $tnamerule = $this->GetMakeFileRule($this->Fields['id'], "list", $this->Fields['typedir'], $this->Fields['defaultname'], $this->Fields['namerule2']);
  853. $tnamerule = preg_replace("/^(.*)\//", '', $tnamerule);
  854. //获得上一页和首页的链接
  855. if ($this->PageNo != 1) {
  856. $prepage .= "<li class='page-item'><a class='page-link' href='".str_replace("{page}", $prepagenum, $tnamerule)."'>上一页</a></li>\r\n";
  857. $indexpage = "<li class='page-item'><a class='page-link' href='".str_replace("{page}", 1, $tnamerule)."'>首页</a></li>\r\n";
  858. } else {
  859. $indexpage = "<li class='page-item'><span class='page-link'>首页</span></li>\r\n";
  860. }
  861. //下一页和未页的链接
  862. if ($this->PageNo != $totalpage && $totalpage > 1) {
  863. $nextpage .= "<li class='page-item'><a class='page-link' href='".str_replace("{page}", $nextpagenum, $tnamerule)."'>下一页</a></li>\r\n";
  864. $endpage = "<li class='page-item'><a class='page-link' href='".str_replace("{page}", $totalpage, $tnamerule)."'>末页</a></li>\r\n";
  865. } else {
  866. $endpage = "<li class='page-item'><span class='page-link'>末页</span></li>\r\n";
  867. }
  868. //option链接
  869. $optionlist = '';
  870. $optionlen = strlen($totalpage);
  871. $optionlen = $optionlen * 12 + 18;
  872. if ($optionlen < 36) $optionlen = 36;
  873. if ($optionlen > 100) $optionlen = 100;
  874. $optionlist = "<li><select name='sldd' style='width:{$optionlen}px' onchange='location.href=this.options[this.selectedIndex].value;'>\r\n";
  875. for ($mjj = 1; $mjj <= $totalpage; $mjj++) {
  876. if ($mjj == $this->PageNo) {
  877. $optionlist .= "<option value='".str_replace("{page}", $mjj, $tnamerule)."' selected>$mjj</option>\r\n";
  878. } else {
  879. $optionlist .= "<option value='".str_replace("{page}", $mjj, $tnamerule)."'>$mjj</option>\r\n";
  880. }
  881. }
  882. $optionlist .= "</select></li>\r\n";
  883. //获得数字链接
  884. $listdd = "";
  885. $total_list = $list_len * 2 + 1;
  886. if ($this->PageNo >= $total_list) {
  887. $j = $this->PageNo - $list_len;
  888. $total_list = $this->PageNo + $list_len;
  889. if ($total_list > $totalpage) {
  890. $total_list = $totalpage;
  891. }
  892. } else {
  893. $j = 1;
  894. if ($total_list > $totalpage) {
  895. $total_list = $totalpage;
  896. }
  897. }
  898. for ($j; $j <= $total_list; $j++) {
  899. if ($j == $this->PageNo) {
  900. $listdd .= "<li class='page-item active'><span class='page-link'>$j</span></li>\r\n";
  901. } else {
  902. $listdd .= "<li class='page-item'><a class='page-link' href='".str_replace("{page}", $j, $tnamerule)."'>".$j."</a></li>\r\n";
  903. }
  904. }
  905. $plist = '';
  906. if (preg_match('/index/i', $listitem)) $plist .= $indexpage;
  907. if (preg_match('/pre/i', $listitem)) $plist .= $prepage;
  908. if (preg_match('/pageno/i', $listitem)) $plist .= $listdd;
  909. if (preg_match('/next/i', $listitem)) $plist .= $nextpage;
  910. if (preg_match('/end/i', $listitem)) $plist .= $endpage;
  911. if (preg_match('/option/i', $listitem)) $plist .= $optionlist;
  912. if (preg_match('/info/i', $listitem)) $plist .= $maininfo;
  913. return $plist;
  914. }
  915. /**
  916. * 获取动态的分页列表
  917. *
  918. * @access public
  919. * @param string $list_len 列表宽度
  920. * @param string $list_len 列表样式
  921. * @return string
  922. */
  923. function GetPageListDM($list_len, $listitem = "index,end,pre,next,pageno")
  924. {
  925. global $cfg_cmspath, $cfg_rewrite;
  926. $prepage = $nextpage = '';
  927. $prepagenum = $this->PageNo - 1;
  928. $nextpagenum = $this->PageNo + 1;
  929. if ($list_len == '' || preg_match("/[^0-9]/", $list_len)) {
  930. $list_len = 3;
  931. }
  932. $totalpage = ceil($this->TotalResult / $this->pagesize);
  933. if ($totalpage <= 1 && $this->TotalResult > 0) {
  934. return "<li class='d-none d-sm-block page-item disabled'><span class='page-link'>1页".$this->TotalResult."条</span></li>\r\n";
  935. }
  936. if ($this->TotalResult == 0) {
  937. return "<li class='d-none d-sm-block page-item disabled'><span class='page-link'>0页".$this->TotalResult."条</span></li>\r\n";
  938. }
  939. $maininfo = "<li class='d-none d-sm-block page-item disabled'><span class='page-link'>{$totalpage}页".$this->TotalResult."条</span></li>\r\n";
  940. $purl = $this->GetCurUrl();
  941. //如果开启为静态,则对规则进行替换
  942. if ($cfg_rewrite == 'Y') {
  943. $nowurls = preg_replace("/\-/", ".php?", $purl);
  944. $nowurls = explode("?", $nowurls);
  945. $purl = $nowurls[0];
  946. }
  947. $geturl = "tid=".$this->TypeID."&TotalResult=".$this->TotalResult."&";
  948. $purl .= '?'.$geturl;
  949. $optionlist = '';
  950. //添加联动单筛选
  951. $pageaddurl = "";
  952. foreach($_GET as $key => $value) {
  953. $pageaddurl .= ($key!="tid" && $key!="TotalResult" && $key!="PageNo") ? "&".string_filter($key)."=".string_filter($value) : '';
  954. }
  955. //获得上一页和下一页的链接
  956. if ($this->PageNo != 1) {
  957. $prepage .= "<li class='page-item'><a href='".$purl."PageNo=$prepagenum".$pageaddurl."' class='page-link'>上一页</a></li>\r\n";
  958. $indexpage = "<li class='page-item'><a href='".$purl."PageNo=1".$pageaddurl."' class='page-link'>首页</a></li>\r\n";
  959. } else {
  960. $indexpage = "<li class='page-item'><span class='page-link'>首页</span></li>\r\n";
  961. }
  962. if ($this->PageNo != $totalpage && $totalpage > 1) {
  963. $nextpage .= "<li class='page-item'><a href='".$purl."PageNo=$nextpagenum".$pageaddurl."' class='page-link'>下一页</a></li>\r\n";
  964. $endpage = "<li class='page-item'><a href='".$purl."PageNo=$totalpage".$pageaddurl."' class='page-link'>末页</a></li>\r\n";
  965. } else {
  966. $endpage = "<li class='page-item'><span class='page-link'>末页</span></li>\r\n";
  967. }
  968. //获得数字链接
  969. $listdd = "";
  970. $total_list = $list_len * 2 + 1;
  971. if ($this->PageNo >= $total_list) {
  972. $j = $this->PageNo - $list_len;
  973. $total_list = $this->PageNo + $list_len;
  974. if ($total_list > $totalpage) {
  975. $total_list = $totalpage;
  976. }
  977. } else {
  978. $j = 1;
  979. if ($total_list > $totalpage) {
  980. $total_list = $totalpage;
  981. }
  982. }
  983. for ($j; $j <= $total_list; $j++) {
  984. if ($j == $this->PageNo) {
  985. $listdd .= "<li class='page-item active'><span class='page-link'>$j</span></li>\r\n";
  986. } else {
  987. $listdd .= "<li class='page-item'><a href='".$purl."PageNo=$j".$pageaddurl."' class='page-link'>".$j."</a></li>\r\n";
  988. }
  989. }
  990. $plist = "";
  991. if (preg_match('/index/i', $listitem)) $plist .= $indexpage;
  992. if (preg_match('/pre/i', $listitem)) $plist .= $prepage;
  993. if (preg_match('/pageno/i', $listitem)) $plist .= $listdd;
  994. if (preg_match('/next/i', $listitem)) $plist .= $nextpage;
  995. if (preg_match('/end/i', $listitem)) $plist .= $endpage;
  996. if (preg_match('/option/i', $listitem)) $plist .= $optionlist;
  997. if (preg_match('/info/i', $listitem)) $plist .= $maininfo;
  998. //伪静态分页
  999. if ($cfg_rewrite == 'Y') {
  1000. $plist = str_replace('.php?tid=','-',$plist);
  1001. $plist = preg_replace("/&TotalResult=(\d+)/i","",$plist);//去掉总结果数值
  1002. //目录版默认
  1003. $plist = preg_replace("/&PageNo=(\d+)/i",'-\\1',$plist);
  1004. //网页版$plist = preg_replace("/&PageNo=(\d+)/i",'-\\1.html',$plist);
  1005. }
  1006. return $plist;
  1007. }
  1008. /**
  1009. * 获得当前的页面文件链接
  1010. *
  1011. * @access public
  1012. * @return string
  1013. */
  1014. function GetCurUrl()
  1015. {
  1016. if (!empty($_SERVER['REQUEST_URI'])) {
  1017. $nowurl = $_SERVER['REQUEST_URI'];
  1018. $nowurls = explode('?', $nowurl);
  1019. $nowurl = $nowurls[0];
  1020. } else {
  1021. $nowurl = $_SERVER['PHP_SELF'];
  1022. }
  1023. return $nowurl;
  1024. }
  1025. }//End Class
  1026. ?>