如何在Discuz 7.1中给通过WAP发布的帖子加标记
发布时间:2009-12-11 13:01:06 来源: 网友评论 0 条
Discuz!是康盛创想(Comsenz)公司推出的一款论坛BBS产品,本期教程笔者为大家讲解在Discuz! 7.1下如何给通过WAP发布的帖子加标记。
如果回复或者主题是通过wap发布的,则在帖子信息中显示出来 “该信息来自手机”。
效果图:

一、修改数据库结构
在 Discuz 7.1 后台 => 数据库 => 升级,提交如下SQL:
ALTER TABLE `cdb_posts` ADD `onmobile` TINYINT( 1 ) NOT NULL
二、修改WAP程序
打开论坛根目录下 /wap/include/post.inc.php 文件
找到
$db->query("INSERT INTO {$tablepre}posts (fid, tid, first, author, authorid, subject, dateline, message, useip, invisible, usesig, htmlon, bbcodeoff, smileyoff, parseurloff, attachment)
VALUES ('$fid', '$tid', '1', '$discuz_user', '$discuz_uid', '$subject', '$timestamp', '$message', '$onlineip', '$pinvisible', '0', '0', '0', '0', '0', '0')");
修改为:
$db->query("INSERT INTO {$tablepre}posts (fid, tid, first, author, authorid, subject, dateline, message, useip, invisible, usesig, htmlon, bbcodeoff, smileyoff, parseurloff, attachment,onmobile)
VALUES ('$fid', '$tid', '1', '$discuz_user', '$discuz_uid', '$subject', '$timestamp', '$message', '$onlineip', '$pinvisible', '0', '0', '0', '0', '0', '0','1')");
找到
$db->query("INSERT INTO {$tablepre}posts (fid, tid, first, author, authorid, dateline, message, useip, invisible, usesig, htmlon, bbcodeoff, smileyoff, parseurloff, attachment)
VALUES ('$fid', '$tid', '0', '$discuz_user', '$discuz_uid', '$timestamp', '$message', '$onlineip', '$pinvisible', '1', '0', '0', '0', '0', '0')");
修改为:
$db->query("INSERT INTO {$tablepre}posts (fid, tid, first, author, authorid, dateline, message, useip, invisible, usesig, htmlon, bbcodeoff, smileyoff, parseurloff, attachment,onmobile)
VALUES ('$fid', '$tid', '0', '$discuz_user', '$discuz_uid', '$timestamp', '$message', '$onlineip', '$pinvisible', '1', '0', '0', '0', '0', '0','1')");
保存。
三、修改模板
打开论坛目录下 /templates/default/viewthread_node.htm 文件
找到
{lang guest} {$pluginhooks[viewthread_postheader][$postcount]}{lang poston} $post[dateline]
在此段程序之后添加:
该信息来自手机
保存,更新缓存。
- 推荐阅讯
- 火星文DIY 让你轻轻松松成为时尚达人
- 再也不买盗版了:在线办公平台横向评测
- 山寨机一样可以用的手机炒股软件
- Discuz!积分策略向导功能详解
- ShopEx4.8.4网站内容管理
- 堪称完美 最新版百度硬盘搜索体验手记
- QQ空间非黄钻免费皮肤和鼠标代码
- EditPlus表达式删除文档多余空行
- 总结:你不知道的五个QQ空间小技巧
- 教你解决Discuz!论坛时间不统一问题


