EXCMS 排行文件

来自站长百科
跳转至: 导航、​ 搜索

导航:返回上一页

EXCMS的排行文件为:top.php,用于显示按天,周,月显示某栏内容排行。

代码[ ]

01	<?
02	 
03	/**
04	 * Project:     EXCMS: the PHP content management system.
05	 * File:        top.php
06	 *
07	 * A product of SINOICAN Inc.
08	 *
09	 * EXCMS is a ten million data-level,high speed,human-based content management system.
10	 *
11	 * EX is Excellence & Express & Exceed & Expert.
12	 *
13	 * For questions, help, comments, discussion, please join the
14	 * EXCMS mailing list. Send a blank e-mail to
15	 * excms@sinoican.com
16	 * or join the EXCMS forum
17	 * www.excms.cn/forum
18	 *
19	 * @link http://www.excms.cn/
20	 * @copyright Copyright (c) 2007-2009 SINOICAN Inc.
21	 * @license http://www.excms.cn/licenses/LICENSE-1.0
22	 * @category EXCMS
23	 * @author hukuizhi@sinoican.com
24	 * @version $Rev: 146 $
25	 */
26	  
27	 /* $Id: top.php 146 2009-11-10 07:58:36Z zhangxuelin $ */
28	  
29	 /**
30	  * 获取排行
31	  */
32	 
33	//加载系统配置文件
34	require_once ('configuration/inc/common.inc.php');
35	 
36	//加载栏目更新方法成员类
37	excms_import("EXCMS.update.ChannelFunction");
38	 
39	$_page_title_txt = '排行';
40	 
41	//栏目ID
42	$channelid = $_GET['channelid'] ? $_GET['channelid'] : $_GET['id'];
43	$channelid = excms_func_id_decode($channelid);
44	 
45	//获取当前栏目信息
46	if(is_numeric($channelid) && $channelid > 0){
47	  $_PAGE_CHANNEL = excms_func_getChannelCacheById($channelid);
48	}else{
49	  $_PAGE_CHANNEL['channelid'] = $channelid;
50	}
51	 
52	//获取交叉栏目信息
53	$_PAGE['crossid'] = excms_func_id_decode($_GET['crossid']);
54	if(is_numeric($_PAGE['crossid']) && $_PAGE['crossid'] > 0){
55	    $_PAGE_CHANNEL['crosschannel'] = excms_func_getChannelCacheById($_PAGE['crossid']);
56	    $_PAGE_CHANNEL['href'] = ChannelFunction::listName($_PAGE_CHANNEL, 1, $_PAGE_CHANNEL['crosschannel']['channelid']);
57	    $_PAGE['title'] = $_PAGE_CHANNEL['crosschannel']['name'] . $_page_title_txt;
58	}else{
59	    $_PAGE_CHANNEL['crosschannel'] = null;
60	    $_PAGE['title'] = $_PAGE_CHANNEL['name'] . $_page_title_txt;
61	}
62	 
63	//页面字段
64	$_PAGE['keywords'] = &$_PAGE_CHANNEL['keywords'];
65	$_PAGE['description'] = &$_PAGE_CHANNEL['description'];
66	 
67	//当前位置
68	$split_str = $_PAGE_CHANNEL['original_channelid'] > 0 ? ' ' . text2Html($EXCMS['list_symbol']).' ' : '';
69	$_PAGE['position'] = ChannelFunction::getNavigation($_PAGE_CHANNEL['original_channelid'], $_PAGE['crossid']);
70	$_PAGE['position'] .= $split_str . $_page_title_txt;
71	 
72	//Display
73	excms_func_templateDisplay('top.html');
74	 
75	?>

代码说明[ ]

  • $channelid = excms_func_id_decode($channelid); //解密栏目ID。
  • $crossid = excms_func_id_decode($_GET['crossid']); //解密交叉栏目。
  • $_PAGE_CHANNEL = excms_func_getChannelCacheById($channelid); //根据栏目ID获取栏目缓存。
  • $_PAGE_CHANNEL['href'] = ChannelFunction::listName($_PAGE_CHANNEL,1,$_PAGE_CHANNEL['crosschannel']['channelid']); //根据栏目以及交叉栏目获取当前栏

目的链接地址。

  • $_PAGE['position'] = ChannelFunction::getNavigation($_PAGE_CHANNEL['original_channelid'], $_PAGE['crossid']) . $split_str . *$type_array[$_PAGE['type']]; //根据当前栏目和交叉栏目获取当前导航栏。

页面字段数据放在$_PAGE变量数组,栏目的所有字段信息放在$_PAGE_CHANNEL变量数组。

  • 页面参数:
$_PAGE['title'](排行标题)
$_PAGE['keywords'] (排行关键字)
$_PAGE['description'](排行描述)
$_PAGE['position'](排行导航栏地址)
$_PAGE['crossid'](交叉栏目)
$_PAGE_CHANNEL包含当前栏目的所用信息,以上这些参数供模板里面标签使用。

代码修改[ ]

页面参数可以自由修改,根据模板的需要来增加和修改页面参数。模板中可自由调用页面的参数,例如:{$_PAGE.title}显示页面标题。