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

CMS技巧
Drupal CMS可以实现的16种类型网站
Shopex技巧:去除shopex版权
最好的开源SNS程序Dolphind几大功能介绍
Z-Blog留言评论显示IP地址和性能优化
WordPress文章摘要功能简单代码
WordPress博客技巧:图片用单独域名储存
.htaccess文件优化WordPress页面加载速度
ExpressionEngine CMS系统的网站设计实例
让WordPress的Post和Page支持<!–more–>标签
WordPress制作中小企业网站的思路和注意事项
Discuz!7.1升级Discuz!7.2
DEDECMS伪原创插件使用说明和插件下载
小型网站可以选择的网站内容管理系统(CMS)
PHP168 CMSV6.5架构定型 侧重高性能
Drupal建站:整理世界上著名大学的网站
三种直接备份 WordPress 博客的方法
WordPress博客数据库自动备份插件
WordPress插件和主题的一些特别用处
JTBC网站内容管理系统免费的开源的CMS
Wordpress博客防评论机器人

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


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

在此段程序之后添加:

该信息来自手机

保存,更新缓存。