open view.php and find this:
<!-- F: List Actions Bottom -->
and paste this after:
<?php
//similar posts hack by guerilla
$percent=5; //similarity percentage, increase for sensitive matching. for example 10 is 10% match, 50 is 50% match, 100 is one o one
$topics_only=0; //set 1 if you wanna show only topics, set 0 to show relative messages directly
$limit = 5; //set number of relative messages
if ($topics_only = 1)
{
$parent =" AND parent=0 ";
}
$query=("SELECT id, subject, name, time as zaman, catid, userid, MATCH(t1.message) AGAINST('$this_message->subject') as oran1, MATCH(t2.subject) AGAINST('$this_message->subject') as oran2 FROM
#__fb_messages_text as t1 INNER JOIN #__fb_messages as t2 ON t2.id = t1.mesid
WHERE (MATCH(t1.message) AGAINST('$this_message->subject') > $percent OR MATCH(t2.subject) AGAINST('$this_message->subject') > $percent) AND t2.id <>" . $this_message->id . $parent . " ORDER BY oran2 DESC, oran1 DESC LIMIT $limit;");
$sim_message=$kunena_db->setQuery($query);
$sim_message = $kunena_db->loadObjectList();
echo mysql_error();
if (count($sim_message)> 0)
{
echo '<table class = "fb_blocktable' . $objCatInfo->class_sfx . '" id="fb_views" border = "0" cellspacing = "0" cellpadding = "5" width="100%"><thead><tr><th colspan="4"><div class = "fb_title_cover fbm">';
echo '<span class = "fb_title fbl"><b>Relative Posts</b></span></div></th></tr></thead>';
echo '<tr class = "fb_sth"><td class = "view-th ' . $boardclass . 'sectiontableheader"><b>Subject</b></td><td><b>Author</b></td><td align="right"><b>Date</b></td><td align="right"><b>Similarity</b></td></tr>';
foreach ($sim_message as $sonuc) {
if ($sonuc->oran1 > $sonuc->oran2)
{
$oran = $sonuc->oran1;
}
else {
$oran=$sonuc->oran2;
}
echo "<tr><td><a href=\"index.php?option=com_kunena&Itemid=" . KUNENA_COMPONENT_ITEMID . "&func=view&catid=" . $sonuc->catid . "&id=" . $sonuc->id. "\">" . $sonuc->subject . "</a></td>";
echo "<td>" . CKunenaLink::GetProfileLink($fbConfig, $sonuc->userid, $sonuc->name) . "</td>";
echo "<td align=\"right\">" . date(_DATETIME, $sonuc->zaman) . "</td>";
echo "<td align=\"right\">%" . (int)$oran . "</td></tr>";
}
echo "</table>";
}
//similar posts hack by gerilla
?>
finally open your phpmysqladmin and run this scripts:
ALTER TABLE jos_fb_messages ADD FULLTEXT(subject)
ALTER TABLE jos_fb_messages_text ADD FULLTEXT(message)
thats all.
acknowledgements:
-to increase sensitivity of matching increase $percent=5; (for example $percent=10 ) value can between 0 to 100.
-$topics_only=0; //set this 1 if you wanna show only topics, set 0 to show all relatve posts directly (default is 0)
-$limit sets maximum number of relative posts showing, default is 5. you can set this what you want. 3, 8, 10 or 20 etc...
NOTE: DO NOT COPY CODES DIRECTLY FROM POST. PRESS QUOTE AND THEN COPY THE CODES FROM TEXT AREA.