Is there anyone familiar with Discuz X3.1 in the forum? How to display the content of the topic completely

Source: Internet
Author: User
Is there anyone familiar with Discuz X3.1 in the forum? How to display the content of the topic completely.


Topic easy to read out Forum_thread table on the line, but easy to table forum_post content is not easy to read it.

After all, it contains [attach]4[/attach][img=500,666]http://pic.qiushibaike.com/system/pictures/5726/57264521/medium/app57264521.jpg[/img]

And so on, assorted data.

The official does not exchange the code, only communicates how installs. I fainted. Can only think of csdn to see if anyone can handle this.


Reply to discussion (solution)

Is there anyone familiar with Discuz X3.1 in the forum? How to display the content of the topic completely.


Topic easy to read out Forum_thread table on the line, but easy to table forum_post content is not easy to read it.

After all, it contains [attach]4[/attach][img=500,666]http://pic.qiushibaike.com/system/pictures/5726/57264521/medium/app57264521.jpg[/img]

And so on, assorted data.

The official does not exchange the code, only communicates how installs. I fainted. Can only think of csdn to see if anyone can handle this.


The code itself contains a conversion function like this.

@chinmo Moderators

The point is that after I found the Discuzcode (), Parseattach () parsing function, it seemed useless. I'm still looking for the reason.

@chinmo Moderators

The point is that after I found the Discuzcode (), Parseattach () parsing function, it seemed useless. I'm still looking for the reason.


Dizzy death, you go directly to his post content page to find out what function he used? What's the struggle?

@chinmo

Big Moderator Ah, the content of the post should be source\module\forum\forum_viewthread.php this file

But I looked for it, and it felt like only the two functions were relevant. But it has not yet played a role.

For two days, he died.

@chinmo

Big Moderator Ah, the content of the post should be source\module\forum\forum_viewthread.php this file

But I looked for it, and it felt like only the two functions were relevant. But it has not yet played a role.

For two days, he died.


What do you look for in the template, dz he basically is to use $post this array to save the data, you in his controller file output this array to know which field is saving the content of the article, and then you in his controller to find his use of this field of the processing function can not be

That's the least we can do with the procedure.

@chinmo

Big Moderator Ah, I certainly will not go to the template layer to find, really not as simple as you think, I use the Discuz X3.1utf8 version.

The content of the post should be source\module\forum\forum_viewthread.php this file

About 903 rows or so:
Parseattach ($_g[' forum_attachpids '), $_g[' Forum_attachtags '], $postlist, $skipaids);

Used to parse the attachment.

It's probably in line 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 '];

That is used to parse the content

But I don't know why it's not successful.

Discuzcode is the function used.
If you don't succeed,
The simplest way to do this is to segment the output in this function and see if he's there to replace the unsuccessful

So you can find out exactly what's wrong with you.

All the way php cattle, I put the code on:
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 ORDE R 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);

?>

There is no problem in finding it.

form [IMG=500,666]HTTP://PIC.QIUSHIBAIKE.COM/SYSTEM/PICTURES/5726/57264521/MEDIUM/APP57264521.JPG[/IMG]
This is the UBB code
You can find some of the UBB decoding programs related to the cut-in
He looks like a BBCode class.

I also like LZ, found a similar function can not be resolved. There seems to be no time for the big God to explain this.

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.