论坛里有人熟悉discuz X3.1吗?怎样将主题内容完整的显示出来 @chinmo 版主关键是我找到discuzcode()、parseattach()解析函数后,似乎没用。目前还在找原因。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 @chinmo大版主呀,帖子内容应该是source\module\forum\forum_viewthread.php这个文件可我找来找去,感觉就只有这两个函数相关。但还没有起到作用。找了两天,晕死 你再他模板找干嘛,DZ的他基本都是用$post这个数组保存数据的,你在他的控制器文件里输出这个数组就知道是哪个字段保存着文章内容了,然后你在在他的控制器里查找他对这个字段所用的处理函数不就可以了做程序这点最起码的查找能力应该有的吧 @chinmo大版主呀,我肯定不会去模板层找了,真的没有你想象的那么简单,我用的是discuz X3.1utf8版本。帖子内容应该是source\module\forum\forum_viewthread.php这个文件大概903行左右: parseattach($_G['forum_attachpids'], $_G['forum_attachtags'], $postlist, $skipaids);用来解析附件的。大概是在1228行: $post['message'] = discuzcode($post['message'], $post['smileyoff'], $post['bbcodeoff'], $post['htmlon'] & 1, $_G['forum']['allowsmilies'], $forum_allowbbcode, ($_G['forum']['allowimgcode'] && $_G['setting']['showimages'] ? 1 : 0), $_G['forum']['allowhtml'], ($_G['forum']['jammer'] && $post['authorid'] != $_G['uid'] ? 1 : 0), 0, $post['authorid'], $_G['cache']['usergroups'][$post['groupid']]['allowmediacode'] && $_G['forum']['allowmediacode'], $post['pid'], $_G['setting']['lazyload'], $post['dbdateline'], $post['first']);用来解析内容的但不晓得为什么就是不成功。 discuzcode 就是了用的这个函数不成功的话最简单的排查就是在这个函数里断句输出,看看他在那里替换不成功 各路PHP牛人,我把代码奉上:<?phpdefine('APPTYPEID', 2);define('CURSCRIPT', 'forum');require './source/class/class_core.php';require './source/function/function_forum.php';$cachelist = array();C::app()->cachelist = $cachelist;C::app()->init();//$navtitle = str_replace('{bbname}', $_G['setting']['bbname'], $_G['setting']['seotitle']['forum']);//$_G['setting']['threadhidethreshold'] = 1;//$query = C::t('forum_thread')->fetch_all_for_guide1($view, $limittid, $tids, $_G['setting']['heatthread']['guidelimit'], $dateline); //$query = C::t('forum_thread')->fetch_all_search('', 'forum_thread', 0,'', '', '');;//print_r($query);require_once libfile('function/discuzcode');require_once libfile('function/attachment');require_once libfile('function/forum'); $sql = "SELECT a.*, b.message,b.htmlon,b.bbcodeoff,b.smileyoff,b.parseurloff,b.pid,b.first FROM ".DB::table('forum_thread')." a left join ".DB::table('forum_post')." b on a.authorid=b.authorid and a.tid=b.tid and b.first=1 WHERE 1=1 AND a.heats>=1" ; $sql = "SELECT a.*, b.message,b.htmlon,b.bbcodeoff,b.smileyoff,b.parseurloff,b.pid,b.first FROM ".DB::table('forum_thread')." a left join ".DB::table('forum_post')." b on a.authorid=b.authorid and a.tid=b.tid and b.first=1 WHERE a.tid>0 AND a.heats>=0 ORDER BY a.lastpost DESC LIMIT 600"; $query = DB::fetch_all($sql); $postlist = array(); foreach($query as $post){ $post['message'] = discuzcode($post['message'], $post['smileyoff'], $post['bbcodeoff'], $post['htmlon'] & 1, $_G['forum']['allowsmilies'], $forum_allowbbcode, ($_G['forum']['allowimgcode'] && $_G['setting']['showimages'] ? 1 : 0), $_G['forum']['allowhtml'], ($_G['forum']['jammer'] && $post['authorid'] != $_G['uid'] ? 1 : 0), 0, $post['authorid'], $_G['cache']['usergroups'][$post['groupid']]['allowmediacode'] && $_G['forum']['allowmediacode'], $post['pid'], $_G['setting']['lazyload'], $post['dbdateline'], $post['first']); $_G['forum_attachpids'][] = $post['pid']; if(preg_match_all("/\[attach\](\d+)\[\/attach\]/i", $post['message'], $matchaids)) { $_G['forum_attachtags'][$post['pid']] = $matchaids[1]; } $postlist[$post['pid']] = $post; } parseattach($_G['forum_attachpids'], $_G['forum_attachtags'], $postlist); print_r($postlist); ?>死活找不到那里有问题。 $forum_allowbbcode = $_G['forum']['allowbbcode'] ? -$post['groupid'] : 0;少了一个变量。会discuz X3.1的大虾们,都过来看看呀,搞不定的,也帮我顶两下吧。 形如这样的是 ubb 代码你可以找到 ubb 解码程序相关的部分切入他好像是 bbcode 类 @xuzuning我已经试过N次了,要是找到的话,早就找到了。我是实在找不到,才来CSDN找更厉害的高手。毕竟这里是技术高手的集聚地。 现在最佳的PHP开发工具组合是那几个啊? 关于PHP 安全后台技术管理 $this->db->insert_id 屏蔽国内IP,访问需要进行身份验证 眼下一个稍微有点棘手的问题,请教大家 北京地区诚聘PHP经验4年+的中高级程序员,薪资1w左右 mysql的字符串格式化+累加 火车票的骗局 ajax问题。在线结贴。 curl模拟登陆正方教务管理系统 如何用自定义函数文件对另一个php里的函数重写 如何用php实现RGB转换HSV
parseattach($_G['forum_attachpids'], $_G['forum_attachtags'], $postlist, $skipaids);用来解析附件的。大概是在1228行:
$post['message'] = discuzcode($post['message'], $post['smileyoff'], $post['bbcodeoff'], $post['htmlon'] & 1, $_G['forum']['allowsmilies'], $forum_allowbbcode, ($_G['forum']['allowimgcode'] && $_G['setting']['showimages'] ? 1 : 0), $_G['forum']['allowhtml'], ($_G['forum']['jammer'] && $post['authorid'] != $_G['uid'] ? 1 : 0), 0, $post['authorid'], $_G['cache']['usergroups'][$post['groupid']]['allowmediacode'] && $_G['forum']['allowmediacode'], $post['pid'], $_G['setting']['lazyload'], $post['dbdateline'], $post['first']);用来解析内容的但不晓得为什么就是不成功。
不成功的话
最简单的排查就是在这个函数里断句输出,看看他在那里替换不成功
<?php
define('APPTYPEID', 2);
define('CURSCRIPT', 'forum');require './source/class/class_core.php';
require './source/function/function_forum.php';$cachelist = array();
C::app()->cachelist = $cachelist;
C::app()->init();//$navtitle = str_replace('{bbname}', $_G['setting']['bbname'], $_G['setting']['seotitle']['forum']);
//$_G['setting']['threadhidethreshold'] = 1;
//$query = C::t('forum_thread')->fetch_all_for_guide1($view, $limittid, $tids, $_G['setting']['heatthread']['guidelimit'], $dateline); //$query = C::t('forum_thread')->fetch_all_search('', 'forum_thread', 0,'', '', '');;
//print_r($query);require_once libfile('function/discuzcode');
require_once libfile('function/attachment');
require_once libfile('function/forum');
$sql = "SELECT a.*, b.message,b.htmlon,b.bbcodeoff,b.smileyoff,b.parseurloff,b.pid,b.first FROM ".DB::table('forum_thread')." a left join ".DB::table('forum_post')." b on a.authorid=b.authorid and a.tid=b.tid and b.first=1 WHERE 1=1 AND a.heats>=1" ;
$sql = "SELECT a.*, b.message,b.htmlon,b.bbcodeoff,b.smileyoff,b.parseurloff,b.pid,b.first FROM ".DB::table('forum_thread')." a left join ".DB::table('forum_post')." b on a.authorid=b.authorid and a.tid=b.tid and b.first=1 WHERE a.tid>0 AND a.heats>=0 ORDER BY a.lastpost DESC LIMIT 600";
$query = DB::fetch_all($sql);
$postlist = array();
foreach($query as $post){
$post['message'] = discuzcode($post['message'], $post['smileyoff'], $post['bbcodeoff'], $post['htmlon'] & 1, $_G['forum']['allowsmilies'], $forum_allowbbcode, ($_G['forum']['allowimgcode'] && $_G['setting']['showimages'] ? 1 : 0), $_G['forum']['allowhtml'], ($_G['forum']['jammer'] && $post['authorid'] != $_G['uid'] ? 1 : 0), 0, $post['authorid'], $_G['cache']['usergroups'][$post['groupid']]['allowmediacode'] && $_G['forum']['allowmediacode'], $post['pid'], $_G['setting']['lazyload'], $post['dbdateline'], $post['first']);
$_G['forum_attachpids'][] = $post['pid'];
if(preg_match_all("/\[attach\](\d+)\[\/attach\]/i", $post['message'], $matchaids)) {
$_G['forum_attachtags'][$post['pid']] = $matchaids[1];
}
$postlist[$post['pid']] = $post;
}
parseattach($_G['forum_attachpids'], $_G['forum_attachtags'], $postlist);
print_r($postlist);
?>死活找不到那里有问题。
会discuz X3.1的大虾们,都过来看看呀,搞不定的,也帮我顶两下吧。
这样的是 ubb 代码
你可以找到 ubb 解码程序相关的部分切入
他好像是 bbcode 类
我已经试过N次了,要是找到的话,早就找到了。我是实在找不到,才来CSDN找更厉害的高手。毕竟这里是技术高手的集聚地。