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

CMS技巧
Phpcms2008网站内容管理系统免费开源
UCenter 1.5.0安装介绍
Discuz! 7.0论坛模板制作更加简单化
dede文章列表页调用TAG标签
删除Dedecms中遗留的多余图片
JTBC(.NET)将OS管理操作模式融入CMS
UCenter Home站点添加统计代码
论坛程序Discuz!7.0.0安装教程
利用好Discuz!论坛的分类信息功能
用好SNS建站软件UCenter Home词语屏蔽
2009预测中国网站建站10大欢迎CMS
UCenter Home从QQ地址薄导入好友邮箱功能
高流量WordPress博客优化的经验和看法
22个高质量的免费wordpress博客模板
Wordpress教程:wp_list_pages()函数
康盛创想SupeSite 7.0全面开源发布
Wordpress博客首页中的每篇日志添加图片
介绍worpress博客header.php
WordPress主题的index.php代码
wordpress博客wp_list_categories标签

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


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

在此段程序之后添加:

该信息来自手机

保存,更新缓存。