=================================================================
<?php
defined('IN_PHPCMS') or exit('Access Denied');
defined('INSTALL') or exit('Access Denied');
$module = 'guestbook';
$modulename = '留言板';
$introduce = '留言模块';
$author = '个人团队';
$authorsite = 'http://www.phpcms.cn';
$authoremail = '';
?>
<?php
//是否在后台主导航条上
$guestbook=$menu_db->get_one(array('name'=>'guestbook','parentid'=>'0'));
if($guestbook)
{
$parentid=$guestbook['id'];
}
else
{
$parentid=$menu_db->insert(
array(
'name'=>'a1',
'parentid'=>0,
'm'=>'guestbook',
'c'=>'index',
'a'=>'init',
'data'=>'',
'listorder'=>'10',
'display'=>'1'
),true);
}
//左侧主菜单
$id=$menu_db->insert(
array(
'name'=>'a2',
'parentid'=>$parentid,
'm'=>'guestbook',
'c'=>'guestbook',
'a'=>'init',
'data'=>'',
'listorder'=>'1',
'display'=>'1'
),true);
//左侧菜单项
$idd=$menu_db->insert(
array(
'name'=>'a3',
'parentid'=>$id,
'm'=>'guestbook',
'c'=>'guestbook',
'a'=>'guestbook_list',
'data'=>'',
'listorder'=>'1',
'display'=>'1'
),true);
$language =array(
'a1'=>'留言板',
'a2'=>'留言板',
'a3'=>'留言列表'
);
?>
INSERT INTO `phpcms_module` VALUES ('guestbook', '留言板', '', '0', '1.0', '', 'array (\n 1 => \n array (\n \'is_post\' => \'1\',\n \'enablecheckcode\' => \'0\',\n ),\n)', '0', '0', '2010-09-06', '2010-09-06');
`title` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_general_ci NULL ,
`content` TEXT CHARACTER SET utf8 COLLATE utf8_general_ci NULL ,
`author` VARCHAR( 100 ) CHARACTER SET utf8 COLLATE utf8_general_ci NULL ,
`cellphone` VARCHAR( 15 ) CHARACTER SET utf8 COLLATE utf8_general_ci NULL ,
`qq` VARCHAR( 20 ) CHARACTER SET utf8 COLLATE utf8_general_ci NULL ,
`email` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_general_ci NULL ,
`msn` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_general_ci NULL ,
`addtime` INT NULL ,
`ip` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_general_ci NULL ,
`reply_admin` VARCHAR( 200 ) CHARACTER SET utf8 COLLATE utf8_general_ci NULL ,
`reply_content` TEXT CHARACTER SET utf8 COLLATE utf8_general_ci NULL ,
`reply_time` INT NULL ,
`status` INT NULL DEFAULT '-1')
<?php
defined('IN_PHPCMS') or exit('No permission resources.');
pc_base::load_app_class('admin','admin',0);
class guestbook extends admin {
function __construct() {
parent::__construct();
$this->db = pc_base::load_model('guestbook_model');
}
public function guestbook_list()
{
$infos=$this->db->select();
include $this->admin_tpl('guestbook_list');
}
public function guestbook_edit()
{
}
public functionguestbook_del()
{
}
}
?>
------------------------------------------------------------------
<form name="searchform" action="" method="get" >
<input type="hidden" value='guestbook' name="m">
<input type="hidden" value='guestbook' name="c">
<input type="hidden" value='guestbook_list'name="a">
<table width="100%" cellspacing="0" class="search-form">
<tbody>
<tr>
<td>
<div class="explain-col">
标题:<input name="title" type="text" value="<?php if(isset($_GET['title'])) {echo $_GET['title'];}?>" class="input-text" />
姓名:<input name="author" type="text" value="<?php if(isset($_GET['author'])) {echo $_GET['author'];}?>" class="input-text" />
手机:<input name="cellphone" type="text" value="<?php if(isset($_GET['cellphone'])) {echo $_GET['cellphone'];}?>" class="input-text" />
QQ:<input name="qq" type="text" value="<?php if(isset($_GET['qq'])) {echo $_GET['qq'];}?>" class="input-text" />
<input type="submit" name="search" class="button" value="<?php echo L('search')?>" />
</div>
</td>
</tr>
</tbody>
</table>
<?php
defined('IN_PHPCMS') or exit('Access Denied');
defined('INSTALL') or exit('Access Denied');
return array('guestbook');
?>