
小视频,自媒体平台,达种族草一站服务 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 文档寻找
!--{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}--
储存,升级缓存文件。