当前位置: 首页 > 图文教程 > 网页制作 > CMS技巧 > Discuz!7.1通过WAP发布的帖子加标记

CMS技巧
wordpress博客wp_list_bookmarks
SNS网站巧妙利用在线音乐吸纳人气
CMS Made Simple内容管理系统安装配置
SupeSite+X-Space+Discuz!打造资讯聚合站
《精品购物指南》时尚媒体发展SNS互动社区
DEDECMS网站首页随意调用栏目的代码
SNS争车位应用中增加汽车比赛
收集国外40个高质量免费的WordPress主题
50个漂亮的免费的WordPress主题
初学者认识:WordPress模版说明
社交网站通过UCenter Home提高竞争力
UCenter Home好友上限与150法则
SNS网站个性展示技巧:图片幻灯片切换
社区管理员如何用任务系统聚人气
帝国CMS使用技巧教程:认识模板组
常见的十款PHP+MySql类免费CMS系统
站长简单评测6种国内外主流CMS
织梦分页采集如何做?
SupeSite新版评论盖楼打分功能
WordPress模板制作过程中的错误定位方法

CMS技巧 中的 Discuz!7.1通过WAP发布的帖子加标记


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2010-01-03   浏览: 80 ::
收藏到网摘: n/a

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]

在此段程序之后添加:

该信息来自手机

保存,更新缓存。