- Posts: 159
- Thank you received: 8
Kunena 7.0.4 Released
The Kunena team has announce the arrival of Kunena 7.0.4 [K 7.0.4] in stable which is now available for download as a native Joomla extension for J! 5.4.x/6.0.x. This version addresses most of the issues that were discovered in K 6.2 / K 6.3 / K 6.4 and issues discovered during the last development stages of K 7.0
This category contains miscellaneous, uncategorised user contributions, (templates, modules, plugins and hacks) relating to older versions of Kunena that are no longer supported.
This category may also contain a few topics relating to K 1.6 that may have been moved here possibly by mistake.
The topics in this category are for historical interest only. Owing to the structural differences between K 1.6 and K 1.7, these ideas in these topics will not work with later versions and, for that reason, the topics are locked.
This category may also contain a few topics relating to K 1.6 that may have been moved here possibly by mistake.
The topics in this category are for historical interest only. Owing to the structural differences between K 1.6 and K 1.7, these ideas in these topics will not work with later versions and, for that reason, the topics are locked.
Question relative posts hack 0.1 beta
16 years 8 months ago - 16 years 8 months ago #27921
by guerilla
relative posts hack 0.1 beta was created by guerilla
open view.php and find this:
and paste this after:
finally open your phpmysqladmin and run this scripts:
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.
Code:
<!-- F: List Actions Bottom -->
and paste this after:
Code:
<?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:
Code:
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.
Last edit: 16 years 8 months ago by guerilla.
Please Log in or Create an account to join the conversation.
16 years 8 months ago #27934
by gonzaunit
Replied by gonzaunit on topic Re:relative posts hack 0.1 beta
good job, but i have a problem.
Parse error: parse error in C:\xampplite\htdocs\caco\components\com_kunena\template\default_ex\view.php on line 1238
Parse error: parse error in C:\xampplite\htdocs\caco\components\com_kunena\template\default_ex\view.php on line 1238
Please Log in or Create an account to join the conversation.
16 years 8 months ago #27964
by guerilla
Replied by guerilla on topic Re:relative posts hack 0.1 beta
did you copy post directly? kunena adds unwanted spaces to code. press quote button and copy the code from textarea.
by the way i forgot to tell, you must add fultext to search fields. open your phpmysqladmin and run this scripts:
ALTER TABLE jos_fb_messages ADD FULLTEXT(subject)
ALTER TABLE jos_fb_messages_text ADD FULLTEXT(message)
by the way i forgot to tell, you must add fultext to search fields. open your phpmysqladmin and run this scripts:
ALTER TABLE jos_fb_messages ADD FULLTEXT(subject)
ALTER TABLE jos_fb_messages_text ADD FULLTEXT(message)
Please Log in or Create an account to join the conversation.
16 years 8 months ago #27968
by gonzaunit
Replied by gonzaunit on topic Re:relative posts hack 0.1 beta
Please Log in or Create an account to join the conversation.
16 years 7 months ago - 16 years 7 months ago #31055
by FENIX
Replied by FENIX on topic Re:relative posts hack 0.1 beta
Sorry, but it doesn't work for me!
Please, help
When I enter any post (not topic) I see this - see the attachment
I have done everything correctly. I have made "tag hack" without any problems, so I know how to do that.
And I swithed on mistakes - nothing. I thought, I would see some syntax error at least. But nothing at all, so I do not really know where to look for that trouble to correct.
Please, help
When I enter any post (not topic) I see this - see the attachment
I have done everything correctly. I have made "tag hack" without any problems, so I know how to do that.
And I swithed on mistakes - nothing. I thought, I would see some syntax error at least. But nothing at all, so I do not really know where to look for that trouble to correct.
Last edit: 16 years 7 months ago by FENIX.
Please Log in or Create an account to join the conversation.
16 years 7 months ago #31069
by guerilla
Replied by guerilla on topic Re:relative posts hack 0.1 beta
did you copy code from post directly? you must first click quote and copy the code from text area.
Please Log in or Create an account to join the conversation.
Time to create page: 0.286 seconds