如何在Discuz 7.1中给通过WAP发布的帖子加标记

来源:站长网 时间:2009-12-09 16:18:00 

本期教程笔者为大家讲解在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 文件找到
                                

<!--{elseif !$post['authorid'] && !$post['username']}-->
                                        {lang guest} {$pluginhooks[viewthread_postheader][$postcount]}<em id="authorposton$post[pid]">{lang poston} $post[dateline]</em>
                                <!--{/if}-->

 在此段程序之后添加:

                                <!--{if $post['onmobile']}-->
                                        该信息来自手机
                                <!--{/if}-->

保存,更新缓存。

标签:discuz,wap,帖子,论坛
0
投稿

猜你喜欢

  • Godaddy:如何获得帮助

    2010-05-03 13:15:00
  • Linux集群技术中的热点---虚拟技术

    2008-12-23 08:45:00
  • 教你怎样快速提高网站流量?

    2008-11-21 12:20:00
  • 个人服务器架设全攻略(13)

    2010-04-06 18:43:00
  • IIS 7 Web服务器管理介绍

    2009-01-06 16:55:00
  • 详解Discuz!7.0数据调用功能

    2009-03-30 12:41:00
  • 老谢:网站推广计划书怎么写

    2009-04-05 11:43:00
  • Google--PageRank(网页级别)技术解密

    2008-06-11 12:24:00
  • Wordpress.com推新功能:打个电话就能写博客

    2010-07-02 16:18:00
  • 妙用SSL给IIS加把锁(一)

    2010-05-20 17:52:00
  • 两种隐性的无效广告展示

    2008-07-27 16:57:00
  • 很好很快乐 花儿世界v1.1新版尝鲜报告

    2009-11-23 15:56:00
  • 个人服务器架设全攻略(81)

    2010-04-06 18:17:00
  • Windows下DNS ID欺骗的原理与实现

    2010-01-28 18:57:00
  • 中国网游缺乏系统性 产品命运充满不确定因素

    2009-11-09 19:23:00
  • 水浒Q传更换代理商 搜狐畅游插手接替金山

    2009-11-19 11:38:00
  • 浅谈如何利用校内网分享功能进行推广

    2009-04-07 09:33:00
  • phpcms嵌套标签-一个被忽略的很强大的东东

    2009-02-18 19:26:00
  • 社区网站源码终结者-Dolphin7.01发布

    2010-05-27 10:41:00
  • 薛蛮子:创业者要花90%的时间挑选合适领域

    2011-03-17 12:44:00
  • asp之家 网站运营 m.aspxhome.com