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();
}
}
}
Category Forum
Code Snippet and functions - 8Labels
None yet
Statistics
13 participants
Notifications
You are not receiving notifications from this thread.
Related Questions