Oh no! Where's the JavaScript?
Your Web browser does not have JavaScript enabled or does not support JavaScript. Please enable JavaScript on your Web browser to properly view this Web site, or upgrade to a Web browser that does support JavaScript.
Not a member yet? Click here to register.
Forgot Password?

Similar Threads Panel by Matonor

Asked Modified Viewed 22,783 times
A
Ankur
A
Ankur 10
Hi! Its me, Ankur Thakur! smile
  • Veteran Member, joined since
  • Contributed 1,277 posts on the community forums.
  • Started 60 threads in the forums
  • Started this discussions
asked
Veteran Member

Here is the Code for the Panel which shows Similar Threads.
The Code is taken from Matonor's Forum Extensions Panel.
It works for me at 7.02.03.



if ((FUSION_SELF == 'viewthread.php') && (isset($_GET['thread_id'])))
{
      $thread_id = isnum($_GET['thread_id']) ? $_GET['thread_id'] : 0;
      
      if($thread_id){
         list($thread_subject) = dbarraynum(dbquery("SELECT thread_subject from ".DB_THREADS." WHERE thread_id=".$thread_id.""));
         
         $rel_thread_res = dbquery("
         SELECT tt.thread_id, tt.thread_subject, tf.forum_id, tf.forum_name, tf.forum_access, tt.thread_postcount, tt.thread_lastpost
         FROM ".DB_THREADS." tt
         INNER JOIN ".DB_FORUMS." tf ON tt.forum_id=tf.forum_id
         WHERE MATCH (thread_subject) AGAINST ('".$thread_subject."' IN BOOLEAN MODE) AND thread_id != ".$thread_id." AND ".groupaccess('tf.forum_access')." ORDER BY tt.thread_lastpost DESC LIMIT 5");
         
         if(dbrows($rel_thread_res)){
            opentable("Similar Threads");
            echo "<table cellpadding='0' cellspacing='1' width='100%' class='tbl-border'>\n
               <tr>
                  <th class='forum-caption'>".$locale['global_044']."</th>
                  <th class='forum-caption'>".$locale['global_048']."</th>
                  <th class='forum-caption'>".$locale['global_046']."</th>
                  <th class='forum-caption'>".$locale['global_047']."</th>
               </tr>\n";
            $i = 0;
            while($thread = dbarray($rel_thread_res)){
               $i++; $row = $i%2 ? " tbl1" : " tbl2";
               echo "
               <tr>
                  <td class='tbl".$row."'><a href='".FUSION_SELF."?thread_id=".$thread['thread_id']."'>".$thread['thread_subject']."</a></td>
                  <td class='tbl".$row."'>".$thread['forum_name']."</td>
                  <td class='tbl".$row."'>".$thread['thread_postcount']."</td>
                  <td class='tbl".$row."'>".showdate("forumdate", $thread['thread_lastpost'])."</td>
               </tr>";
            }
            
            echo "</table>";
            closetable();
         }
      }

}
Edited by Falk on 02-11-2019 12:22,
0 replies

34 posts

S
Sanhuevon
S
  • Junior Member, joined since
  • Contributed 35 posts on the community forums.
  • Started 8 threads in the forums
answered
Junior Member

Can this code be updated for the latest version? I get an Internal Error. Won't even load page.
0 replies

Labels

None yet

Statistics

  • Views 0 views
  • Posts 34 posts
  • Votes 0 votes
  • Topic users 13 members

13 participants

W
W
Michael Wheeler
  • Member, joined since
  • Contributed 87 posts on the community forums.
  • Started 21 threads in the forums
C
C
Craig 14
  • Fusioneer, joined since
  • Contributed 4,462 posts on the community forums.
  • Started 212 threads in the forums
W
W
Wanabo 10
www.probemyip.com/probe-my-ip-80x15.png
pHp-Fusion.Asia & pHp-Fusion.Fr & pHp-Fusion.Cn are available for a localized support community. Send PB for info.
  • Senior Member, joined since
  • Contributed 598 posts on the community forums.
  • Started 94 threads in the forums
N
N
NetriX 10
Need help? Having trouble?
» View our Documentation for guides, functions and more - including the Getting Started section!
» Attach Log Files and Screenshots when reporting issues
» My support days are usually Mon-Thurs. Send me a PM if urgent.
  • Senior Member, joined since
  • Contributed 566 posts on the community forums.
  • Started 93 threads in the forums
H
H
  • Senior Member, joined since
  • Contributed 262 posts on the community forums.
  • Started 28 threads in the forums
D
D
  • Member, joined since
  • Contributed 161 posts on the community forums.
  • Started 18 threads in the forums
J
J
jikaka 10
www.rusfusion.ru - russian nss
  • Veteran Member, joined since
  • Contributed 946 posts on the community forums.
  • Started 82 threads in the forums
P
P
PHPar 10
  • Member, joined since
  • Contributed 118 posts on the community forums.
  • Started 7 threads in the forums
X
X
  • Junior Member, joined since
  • Contributed 35 posts on the community forums.
  • Started 6 threads in the forums
S
S
spunk 10
www.duesseltag.de/../../images/banner/banner209x69.png
  • Member, joined since
  • Contributed 92 posts on the community forums.
  • Started 6 threads in the forums
A
A
Ankur 10
Hi! Its me, Ankur Thakur! smile
  • Veteran Member, joined since
  • Contributed 1,277 posts on the community forums.
  • Started 60 threads in the forums
  • Started this discussions
Z
Z
  • Member, joined since
  • Contributed 90 posts on the community forums.
  • Started 26 threads in the forums
S
S
  • Junior Member, joined since
  • Contributed 35 posts on the community forums.
  • Started 8 threads in the forums

Notifications

Track thread

You are not receiving notifications from this thread.

Related Questions

Not yet