Related Topics

Started by niko, September 14, 2005, 11:50:29 AM

Previous topic - Next topic

Mayhem30

The related topics mod shows the oldest posts first - is there anyway to modify this so it shows the newest posts first?


Mayhem30

Not sure if it was the best way to do it, but I managed to solve the problem by adding "ORDER BY lastPosterTime DESC" to the MySQL query.

distante

Quote from: sharks on January 02, 2012, 12:15:43 AM
Quote from: Diego Andrés on January 01, 2012, 03:27:34 PM
Topic dead, the author doesn't help the users
Well, others are trying to help, but it doesn't change the fact that this mod is still abandoned as nobody fixes its bugs or updates it to be 100% compatible with the latest SMF 1.1.x or SMF 2.x (without any bypass methods).

What bugs exactly ?

niko

Finally got updated for SMF 2.0.2. Also support for SMF 1.1 version dropped and no longer available here.
Websites: Madjoki || (2 links retracted by team, links out of date and taken over.)
Mods: SMF Arcade, Related topics, SMF Project Tools, Post History

WIP Mods: Bittorrent Tracker || SMF Wiki

impreza

What changes 1.4.1 to 1.4?
Portal ToTemat.pl - treści w postaci artykułów i filmów tematycznych.

Diego Andrés

I got this problem

QuoteThe used table type doesn't support FULLTEXT indexes
Archivo: /www/mundonet.org/htdocs/foro/Sources/Subs-RelatedFulltext.php
Línea: 29

That's when I try to rebuild index

SMF Tricks - Free & Premium Responsive Themes for SMF.

niko

Quote from: Diego Andrés on March 20, 2012, 12:20:12 AM
I got this problem

QuoteThe used table type doesn't support FULLTEXT indexes
Archivo: /www/mundonet.org/htdocs/foro/Sources/Subs-RelatedFulltext.php
Línea: 29

That's when I try to rebuild index

You most likely use InnoDB for tables and your MySQL version doesn't support FULLTEXT on InnoDB. (The only version that support is 5.6.4)
Websites: Madjoki || (2 links retracted by team, links out of date and taken over.)
Mods: SMF Arcade, Related topics, SMF Project Tools, Post History

WIP Mods: Bittorrent Tracker || SMF Wiki

Drover

It installed fine with no errors but nothing shows up. :(

Game.ruler

It installed perfectly and i've rebuild index and enabled it...but no related topics are shown when i open topics though in real topic has some related topics...
Pls help n thanks in advance

BigMike

#629
Quote from: drfun on September 18, 2011, 04:14:08 PM
Quote from: coolfx350 on February 24, 2011, 09:50:28 PM
Fatal error: Function name must be a string in /home/mocheng/public_html/omnia/related_topics.php on line 69

the answer to this is on page 27 and 28 of this thread

drfun,

I've looked at pages 27 & 28 and I don't see a solution anywhere.

I did my part by doing some php research following by some troubleshooting. So far I believe this error possibly comes from 3 issues:
1) The code is using a predefined system variable name
2) The code is using a $ when it shouldn't be
3) The code is using square brackets [] instead of round brackets ()

I changed $smcFunc to a different name, $smcFuncRT, all throughout the entire file, got the same error as above, Function name must be a string

I changed $smcFunc to smcFunc, got syntax error, unexpected '[' on line 69.

I changed $smcFunc['db_list_tables']() to $smcFunc('db_list_tables')(), got syntax error, unexpected '(' on line 69.

I changed $smcFunc['db_list_tables']() to $smcFunc['db_list_tables'][], got Cannot use [] for reading on line 69.

I dropped the end brackets (), using just $smcFunc['db_list_tables'], got in_array() expects parameter 2 to be array on line 75 & Function name must be a string on line 79.

I am at a lost.

I am using SMF v2.0 and I've manually installed both mod versions 1.4 & 1.4.1. I ran a file compare on these two versions and none of the code has changed, only updated version numbers and the addition of a "New-BSD" license. That is it; v1.4 & v1.4.1 are one & the same as far as manual installs goes.

Can someone please share how to fix this?

The closest person do help was Arantor on page 29, who said the following:
Quote from: Arantor on March 06, 2011, 12:41:36 PM
While I could tell you how to fix it, I can't update the master package which means you will have to download it, unpack it, modify a file, repack it and then upload it to your site... because only the mod's author can distribute the package - no-one else is even allowed to distribute the fixed installer file.

Quote from: drfun on September 18, 2011, 04:14:08 PMi had same problem and that solved mine.

WHY OH WHY do people post things like this? This is a community of helping others -- please just share the info on how to fix it! :) Arantor & drfun, I am sorry to be calling you guys out, but people have been asking for help on this error for more than 1 year. If you gentlemen could please just show us how to fix this that would be great! :D

I appreciate the help!! Also HUGE thanks to the OP for this fantastic mod!! I can't wait to start using it on my site!!

Thanks!!
BigMike

FrizzleFried

Quote from: Drover on April 11, 2012, 02:27:32 PM
It installed fine with no errors but nothing shows up. :(

I am in the same boat... installs fine... updates the database fine... enabled... but... nothing.

BigMike

#631
Ok, I was able to get past line 69 but now it stops on line 80. Here is what I did:

Replace:

global $smcFunc, $db_prefix, $db_type, $db_show_debug;

With:

global $smcFunc, $db_prefix, $db_type, $db_show_debug, $db_name, $db_prefix;


And replace:

$existingTables = $smcFunc['db_list_tables']();

With:

db_extend();
$existingTables = $smcFunc['db_list_tables']($db_name, $db_prefix . '%');


This gets past line 69. But now I get the same error (Fatal error: Function name must be a string) on line 80, which is:


78: // Create table
79: if (!$tableExists && empty($table['smf']))
80: $smcFunc['db_create_table']('{db_prefix}' . $table_name, $table['columns'], $table['indexes']);


I searched and found the create_table function in DbPackages-mysql.php, line 87:

function smf_db_create_table($table_name, $columns, $indexes = array(), $parameters = array(), $if_exists = 'ignore', $error = 'fatal')


So the info being passed in by the Related Topic mod is (prefix+tablename, tablecolumn, tableindex). The SMF function is expecting at least (tablename, column, index, parameters). So it seems we are just missing the parameter, but I haven't researched what that would be yet.

Any help is appreciated, thanks!
Mike

EDIT

Update: Ok, at the top of the DbPackages file, it explains the function and says there are no $parameters yet. So I am just gonna make a dummy variable and pass it through to see if it works.

Update: Dummy variable idea did nothing.

Update: I think $smcFunc['db_create_table'] is expecting a string for the column, but this mod is trying to insert an array $table['columns']. I could be wrong but this is not correct?

Update: I added   db_extend('packages'); and db_extend('extra'); and the install script returned a blank white page. So no errors but also no confirmation. I looked at my database and I have a new table created called `related_topics` but when I go to index.php?action=admin;area=modsettings;sa=related; nothing comes up...

Update: Why don't we just use $smcFunc['db_query'] instead of $smcFunc['db_create_table'] and use standard SQL like a normal person?

BigMike

Ok guys! I got it to work. Sorry I couldn't post earlier, I had to leave for a business meeting.

I encountered the Fatal error: Function name must be a string in ... related_topics.php on line 69 and made changes to related_topics.php as mentioned in my trouble shooting above.

After my last trouble shooting attempt, the file returned a blank page, as I mentioned above,
Quote from: BigMike on April 16, 2012, 03:26:46 PM
Update: I added   db_extend('packages'); and db_extend('extra'); and the install script returned a blank white page. So no errors but also no confirmation. I looked at my database and I have a new table created called `related_topics` but when I go to index.php?action=admin;area=modsettings;sa=related; nothing comes up...

Low and behold this did the trick!!

Step 1) I attached my final related_topics.php file to this post. Back up your database (I continuously backed mine up during all of this and you should to), give it a shot and see if it returns a blank page for you. It should at the least get you past line 69.

Step 2) Navigate to index.php?action=admin;area=relatedtopics;sa=settings; and it should come up! (of course this assumes you've already performed all the required file modifications and all files are in place as per the install.xml file)

Step 3) If you've made it this far it's all downhill from here. Check the box for "Enable Related Topics" and hit save.

Step 4) Click on Methods (index.php?action=admin;area=relatedtopics;sa=methods;) and choose any boards you'd like to ignore, then hit save.

At this time everything is installed, activated and working properly yet no Related Topics will appear on any thread. This is because you have to Rebuild your Search Index. Related Topics provides the direct link at the bottom of Step 4 to rebuild the index. This may take a long time depending on the size of your forum.

After that is done, browse to any topic and KAZAAM you should now see a Related Topics box at the bottom of the page!

Here it is working on my forum, freshly updated to v2.0.2: http://board.marlincrawler.com/index.php?topic=87153.0

Again, find my related_topics.php file attached to this post.

HUGE Thanks for the OP for all his/her effort in making this mod! It's great 8)

BigMike

BigMike

I'd love to learn how to integrate this with Sphinx Search *hint* *hint* ;)

BigMike

Update: The mod seems to be working great and I really like having it.

I have started receiving a critical error of the following:
"Wrong value type sent to the database. Integer expected. (id_msg)"

I searched this site and found this thread where a member by the name of bindasboy solved this by manually creating a missing table: http://www.simplemachines.org/community/index.php?topic=285866.0 I posted to this thread and will share the info if I can get some help and/or figure it out!

Thanks
Bigmike

BigMike

Quote from: FrizzleFried on April 14, 2012, 09:28:19 PM
Quote from: Drover on April 11, 2012, 02:27:32 PM
It installed fine with no errors but nothing shows up. :(

I am in the same boat... installs fine... updates the database fine... enabled... but... nothing.


Have you guys ran the reindexing of your search index? This is required by the mod or else nothing will show up. Please see my above post where I mentioned this as step 4:

Quote from: BigMike on April 16, 2012, 08:14:42 PM
Step 4) Click on Methods (index.php?action=admin;area=relatedtopics;sa=methods;) and choose any boards you'd like to ignore, then hit save.

At this time everything is installed, activated and working properly yet no Related Topics will appear on any thread. This is because you have to Rebuild your Search Index. Related Topics provides the direct link at the bottom of Step 4 to rebuild the index. This may take a long time depending on the size of your forum.

After that is done, browse to any topic and KAZAAM you should now see a Related Topics box at the bottom of the page!

Good luck!!
Mike

BigMike

Quote from: gay on August 10, 2011, 04:20:23 AM
when post new topic is error viewing

Wrong value type sent to the database. Integer expected. (id_msg)

gay, did you ever figure this out? Thanks


OP, here is my `related_topics` table structure. Would you please let me know if I am missing something here? Thanks!

#    Column    Type    Collation       Attributes    Null    Default
1    id_topic    int(10)                      UNSIGNED    No    None
2    subject    tinytext    latin1_swedish_ci          No    None

Game.ruler

@bigmike
I already wrote that i've done rebuild index. But still no related topics are showing in topic view. Pls help. Thanks in advance

sharks

Somebody should just take over this mod and continue its development. So many people are having difficulties with the bugs, etc. BigMike would be a bankable developer to keep this mod valid now and for the foreseeable future.

FrizzleFried

I agree... I'd try this mod again and I'm even willing to do a manual edit or two... but it seems this mod in it's current state requires many (?) edits ... and frankly,  I am not sure exactly which manual edits it needs.


Advertisement: