怎样在系统中增加自定义功能页
作者:系统管理员    发布于:2010-12-10 16:58:11

一、如果仅仅是增加个自定义页,不计较文件所在目录和名称,可以在后台增加专题,会自动在news/project/下增加目录和文件

二、如果要增加有特别功能的页面,可以自定义页面。会员功能页和非会员功能页的区别是:

1、会员功能页有SecureMember();  调用这个函数时,访问页面时会判断是否登录,没有登录会跳转到login.php
2、会员功能页要包含member.inc.php
3、会员功能页PageSet函数的第一个参数是member,否则是news (即模块名):

会员功能页程序样例:

define("ROOTPATH", "../");    #定义文件相对路径,如程序在一级目录下就是../,如果在二级目录下就是../../ 依次类推
include(ROOTPATH."includes/common.inc.php");   #包含函数库
include(ROOTPATH."member/includes/member.inc.php");   #会员页面要包含member函数库
include("language/".&sLan.".php"); #包含当前模块语言包
include("includes/news.inc.php");  #包含本模块函数库

SecureMember();  #会员身份验证

//定义模块名和页面名
PageSet("member","mytest");


然后在_base_pageset数据表中插入一条记录

name varchar(50)    ASCII CHAR SOUNDEX LCASE UCASE PASSWORD OLD_PASSWORD MD5 SHA1 ENCRYPT COMPRESS UNCOMPRESS LAST_INSERT_ID USER CONCAT -------- NOW RAND COUNT AVG SUM CURDATE CURTIME FROM_DAYS FROM_UNIXTIME PERIOD_ADD PERIOD_DIFF TO_DAYS UNIX_TIMESTAMP WEEKDAY      
coltype varchar(50)    ASCII CHAR SOUNDEX LCASE UCASE PASSWORD OLD_PASSWORD MD5 SHA1 ENCRYPT COMPRESS UNCOMPRESS LAST_INSERT_ID USER CONCAT -------- NOW RAND COUNT AVG SUM CURDATE CURTIME FROM_DAYS FROM_UNIXTIME PERIOD_ADD PERIOD_DIFF TO_DAYS UNIX_TIMESTAMP WEEKDAY      
pagename varchar(50)    ASCII CHAR SOUNDEX LCASE UCASE PASSWORD OLD_PASSWORD MD5 SHA1 ENCRYPT COMPRESS UNCOMPRESS LAST_INSERT_ID USER CONCAT -------- NOW RAND COUNT AVG SUM CURDATE CURTIME FROM_DAYS FROM_UNIXTIME PERIOD_ADD PERIOD_DIFF TO_DAYS UNIX_TIMESTAMP WEEKDAY      

 

 

非会员功能页程序样例:

define("ROOTPATH", "../");
include(ROOTPATH."includes/common.inc.php");
include("language/".&sLan.".php");
include("includes/news.inc.php");

//定义模块名和页面名
PageSet("news","mytest");


然后在_base_pageset数据表中插入一条记录

name varchar(50)    ASCII CHAR SOUNDEX LCASE UCASE PASSWORD OLD_PASSWORD MD5 SHA1 ENCRYPT COMPRESS UNCOMPRESS LAST_INSERT_ID USER CONCAT -------- NOW RAND COUNT AVG SUM CURDATE CURTIME FROM_DAYS FROM_UNIXTIME PERIOD_ADD PERIOD_DIFF TO_DAYS UNIX_TIMESTAMP WEEKDAY      
coltype varchar(50)    ASCII CHAR SOUNDEX LCASE UCASE PASSWORD OLD_PASSWORD MD5 SHA1 ENCRYPT COMPRESS UNCOMPRESS LAST_INSERT_ID USER CONCAT -------- NOW RAND COUNT AVG SUM CURDATE CURTIME FROM_DAYS FROM_UNIXTIME PERIOD_ADD PERIOD_DIFF TO_DAYS UNIX_TIMESTAMP WEEKDAY      
pagename varchar(50)    ASCII CHAR SOUNDEX LCASE UCASE PASSWORD OLD_PASSWORD MD5 SHA1 ENCRYPT COMPRESS UNCOMPRESS LAST_INSERT_ID USER CONCAT -------- NOW RAND COUNT AVG SUM CURDATE CURTIME FROM_DAYS FROM_UNIXTIME PERIOD_ADD PERIOD_DIFF TO_DAYS UNIX_TIMESTAMP WEEKDAY     

 

注:因为美元符号无法正常显示,页面内容单引号已被“ &  ”代替。


 

嘿,我来帮您!