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

CMS技巧
Zblog帮助:模板文件与模板标签
Joomla教程:模板覆盖方式修改系统输出
Joomla教程:为Joomla插件创建语言包
Joomla教程:文章页面中显示指定的模块
Joomla教程:控制Section中的分类列表页面的显示方式
Joomla教程:mod-rewrite是否真的被开启
在Joomla自定义HTML模块组合使用Google小工具
Joomla教程:本地搭建的Joomla站点发送邮件
Joomla教程:在Who is online模块中显示用户名
dedecms教程:栏目页面转换为单独页面
CMS可用性测评:帮助找到适合自己的内容管理系统
Joomla中文教程:构建多重站点
Joomla教程:在templateDetails.xml中添加语言文件声明
Joomla教程:为页面和模块添加独立的自定义Class
Joomla教程:为“read more”链接添加对应的文章标题
Joomla教程:查看并修改模板的CSS
Joomla中文教程:创建并使用插件对文章内容进行修改
Joomla教程:网站首页第一次加载时播放一次Flash动画
Joomla教程:禁止未分类文章被站内搜索
Joomla教程:去掉分类文章列表中的文章序号

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


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2010-01-03   浏览: 82 ::
收藏到网摘: 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]

在此段程序之后添加:

该信息来自手机

保存,更新缓存。