新闻中心
消费主张 IT业界 今日观察 消费警示 曝光台 热点专栏 奇闻趣事 一语惊人 专利之窗 动态备忘
领券购
生活必须 吃货优选 学习艺术 旅游出行 手机电脑 电子电器 热血男装 热销女装
图片中心
美女欣赏 风景欣赏 艺术欣赏 实物图片 制作美图 生活图片
下载中心
手机软件 语文数学 常用软件 红绿软件 信息社政 音体美合 科学自然 英语外语
映讯频道
浓缩电影 邻国热剧 一技之长 艺术无界 教育教学 纪录之窗 战争片 动作片 情感片 国内片 喜剧片 恐怖片 科幻片 大陆剧 港澳台剧 动漫片 明星云集 欧美剧集
聚划算
数码产品 服装服饰 家电家具 装潢装饰 商旅游玩 生活必备 二手特色 健康保健
FLASH频道
MTV类 运动游戏 益智游戏 女生游戏 休闲游戏 电脑运用 有声故事 有声艺术
社会专题
美文园地 制作教程 历史天空 游山玩水 美食天下 科技科幻 天文地理 时尚酷玩 健康保健 寻医问药 有书有道 农村特色 幽默笑话 汽车电子 星新一代 教育咨询 天下军事 硬件网络 黑白社会 靓丽女人 代码效果 免费资源 便民服务 办公达人 玄幻奇幻 软件技术
关闭
当前位置:首页 → 社会专题 → 硬件网络
齐博v9:添加整站核心系统(文章模型)自定义字段应用教程

一般情况下,大家可以在网站内容模型管理界面下添加自定义模型的字段,如果你想添加默认的文章模型字段,就是在p8_article数据表中,并给予后台设置和前台调用的话,就需要参考本帖。下面关键词用红色标注。

1.先在数据表p8_article中添加新的数据字段,留意自己安装时设置的表区分符,默认是p8_

VARCHAR(100中这个100是指字节长度,可以加大比如1000.

ALTER TABLE `p8_article` ADD `diy001` VARCHAR( 100 ) NOT NULL ;

编辑admin\template\post\post.htm:在

<input type="checkbox" name="postdb[target]" value="1" $target>

新窗口打开 $baseSpecial</td>

</tr>

下添加:

<tr bgcolor="#FFFFFF" class="basetr">

<td class="tdL">自定义001:</td>

<td class="tdR">

<input type="text" name="postdb[diy001]" size="60" value="$rsdb[diy001]">

</td>

</tr>

编辑根目录下inc\artic_function.php:把

$db->query("

INSERT INTO `{$pre}article$erp`

( `title`, `smalltitle`,  `fid`,`fname`, `hits`, `pages`, `posttime`, `list`, `uid`, `username`, `author`, `copyfrom`, `copyfromurl`, `titlecolor`, `fonttype`, `picurl`, `ispic`, `yz`, `yzer`, `yztime`, `keywords`, `jumpurl`, `iframeurl`, `style`, `template`, `target`,`ip`, `lastfid`, `money`, `passwd`, `editer`, `edittime`, `begintime`, `endtime`, `description`, `levels`,allowdown,allowview,mid,htmlname,forbidcomment)

VALUES

('$postdb[title]','$postdb[smalltitle]','$fid','$fidDB[name]','$postdb[hits]','1','$postdb[posttime]','$postdb

','$lfjdb[uid]','$lfjdb[username]','$postdb[author]','$postdb[copyfrom]','$postdb[copyfromurl]','$postdb[titlecolor]','$postdb[fonttype]','$postdb[picurl]','$postdb[ispic]','$postdb[yz]','$postdb[yzer]','$postdb[yztime]','$postdb[keywords]','$postdb[jumpurl]','$postdb[iframeurl]','$postdb[style]','$postdb[template]','$postdb[target]','$onlineip','0','$postdb[money]','$postdb[passwd]','$postdb[editer]','$postdb[edittime]','$postdb[begintime]','$postdb[endtime]','$postdb[description]','$postdb[levels]','$postdb[allowdown]','$postdb[allowview]','$mid','$postdb[htmlname]','$postdb[forbidcomment]')

");

换成:

$db->query("

INSERT INTO `{$pre}article$erp`

( `title`, `smalltitle`,  `fid`,`fname`, `hits`, `pages`, `posttime`, `list`, `uid`, `username`, `author`, `copyfrom`, `copyfromurl`, `titlecolor`, `fonttype`, `picurl`, `ispic`, `yz`, `yzer`, `yztime`, `keywords`, `jumpurl`, `iframeurl`, `style`, `template`, `target`,`ip`, `lastfid`, `money`, `passwd`, `editer`, `edittime`, `begintime`, `endtime`, `description`, `levels`,allowdown,allowview,mid,htmlname,forbidcomment,diy001)

VALUES ('$postdb[title]','$postdb[smalltitle]','$fid','$fidDB[name]','$postdb[hits]','1','$postdb[posttime]','$postdb[list]','$lfjdb[uid]','$lfjdb[username]','$postdb[author]','$postdb[copyfrom]','$postdb[copyfromurl]','$postdb[titlecolor]','$postdb[fonttype]','$postdb[picurl]','$postdb[ispic]','$postdb[yz]','$postdb[yzer]','$postdb[yztime]','$postdb[keywords]','$postdb[jumpurl]','$postdb[iframeurl]','$postdb[style]','$postdb[template]','$postdb[target]','$onlineip','0','$postdb[money]','$postdb[passwd]','$postdb[editer]','$postdb[edittime]','$postdb[begintime]','$postdb[endtime]','$postdb[description]','$postdb[levels]','$postdb[allowdown]','$postdb[allowview]','$mid','$postdb[htmlname]','$postdb[forbidcomment]','$postdb[diy001]')

");

再把

$db->query("UPDATE `{$pre}article$erp` SET title='$postdb[title]',smalltitle='$postdb[smalltitle]',fid='$fid',fname='$fidDB[name]',hits='$postdb[hits]',posttime='$postdb[posttime]',list='$postdb

',author='$postdb[author]',copyfrom='$postdb[copyfrom]',copyfromurl='$postdb[copyfromurl]',titlecolor='$postdb[titlecolor]',fonttype='$postdb[fonttype]',picurl='$postdb[picurl]',ispic='$postdb[ispic]',yz='$postdb[yz]',levels='$postdb[levels]',keywords='$postdb[keywords]',jumpurl='$postdb[jumpurl]',iframeurl='$postdb[iframeurl]',style='$postdb[style]',template='$postdb[template]',target='$postdb[target]',money='$postdb[money]',passwd='$postdb[passwd]',editer='$userdb[username]',edittime='$timestamp',begintime='$postdb[begintime]',endtime='$postdb[endtime]',description='$postdb[description]',allowview='$postdb[allowview]',allowdown='$postdb[allowdown]',htmlname='$postdb[htmlname]',forbidcomment='$postdb[forbidcomment]' WHERE aid='$aid' ");

换成:

$db->query("UPDATE `{$pre}article$erp` SET title='$postdb[title]',smalltitle='$postdb[smalltitle]',fid='$fid',fname='$fidDB[name]',hits='$postdb[hits]',posttime='$postdb[posttime]',list='$postdb[list]',author='$postdb[author]',copyfrom='$postdb[copyfrom]',copyfromurl='$postdb[copyfromurl]',titlecolor='$postdb[titlecolor]',fonttype='$postdb[fonttype]',picurl='$postdb[picurl]',ispic='$postdb[ispic]',yz='$postdb[yz]',levels='$postdb[levels]',keywords='$postdb[keywords]',jumpurl='$postdb[jumpurl]',iframeurl='$postdb[iframeurl]',style='$postdb[style]',template='$postdb[template]',target='$postdb[target]',money='$postdb[money]',passwd='$postdb[passwd]',editer='$userdb[username]',edittime='$timestamp',begintime='$postdb[begintime]',endtime='$postdb[endtime]',description='$postdb[description]',allowview='$postdb[allowview]',allowdown='$postdb[allowdown]',htmlname='$postdb[htmlname]',forbidcomment='$postdb[forbidcomment]' ,diy001='$postdb[diy001]'WHERE aid='$aid' ");

最后编辑 template\default\becandy.htm

再要显示的地方放入:

自定义001: $rsdb[diy001]

比如链接:<A HREF='{$rsdb[diy001]}' target="_blank" title="支持正版">支持正版</A>

如果是在前台投稿,还需要修改:/member/template/post.htm文件(修改了此文件,更新后,其他模块也会自动生成,如果不想在后台,添加软件或视频等时,出现如文章模块中的这块,比如软件频道,根\data\admin_tpl\post_101.htm删除掉,会员模块\data\member_tpl\post_101.htm如果有,也删除掉。其他模块也一样。)

在

<input type="checkbox" name="postdb[target]" value="1" $target>

新窗口打开 $baseSpecial</td>

</tr>

下添加:

<tr bgcolor="#FFFFFF" class="basetr">

<td wiidth="15%">自定义001:</td>

<td wiidth="85%">

<input type="text" name="postdb[diy001]" size="60" value="$rsdb[diy001]">

</td>

</tr>

即可。

≡ 提示:输入修改代码都可运行!
4
酒精度
83
顶一下
相关阅读
内容加载中……