SELECT mem.realName, m.posterTime, m2.subject, t.ID_TOPIC, t.ID_MEMBER_UPDATED, t.ID_LAST_MSG, m.ID_MSG_MODIFIED, m.ID_BOARD, b.name AS bName, t.numReplies, m.posterName AS memberName, 0 AS new_from FROM (smf_members AS mem, smf_topics AS t, smf_messages AS m, smf_messages AS m2, smf_boards AS b ) WHERE t.ID_BOARD = m.ID_BOARD AND t.ID_BOARD = b.ID_BOARD AND t.ID_LAST_MSG = m.ID_MSG AND t.ID_FIRST_MSG = m2.ID_MSG AND mem.memberName = m.posterName AND FIND_IN_SET(-1, b.memberGroups) ORDER BY m.ID_MSG DESC LIMIT 5
And a logged user SQL is:
Code:
SELECT mem.realName, m.posterTime, m2.subject, t.ID_TOPIC, t.ID_MEMBER_UPDATED, t.ID_LAST_MSG, m.ID_MSG_MODIFIED, m.ID_BOARD, b.name AS bName, t.numReplies, m.posterName AS memberName, IFNULL(lt.ID_MSG, IFNULL(lmr.ID_MSG, -1)) + 1 AS new_from FROM (smf_members AS mem, smf_topics AS t, smf_messages AS m, smf_messages AS m2, smf_boards AS b LEFT JOIN smf_log_topics AS lt ON (lt.ID_TOPIC = t.ID_TOPIC AND lt.ID_MEMBER = 308) LEFT JOIN smf_log_mark_read AS lmr ON (lmr.ID_BOARD = t.ID_BOARD AND lmr.ID_MEMBER = 308)) WHERE t.ID_BOARD = m.ID_BOARD AND t.ID_BOARD = b.ID_BOARD AND t.ID_LAST_MSG = m.ID_MSG AND t.ID_FIRST_MSG = m2.ID_MSG AND mem.memberName = m.posterName AND 1 ORDER BY m.ID_MSG DESC LIMIT 5
you must replace the above references to user id 308 with a valid user id for your site
Execute thes in the SQL tab not the Query tab. Post the results.
SELECT mem.realName, m.posterTime, m2.subject, t.ID_TOPIC, t.ID_MEMBER_UPDATED, t.ID_LAST_MSG, m.ID_MSG_MODIFIED, m.ID_BOARD, b.name AS bName, t.numReplies, m.posterName AS memberName, 0 AS new_from FROM (smf_members AS mem, smf_topics AS t, smf_messages AS m, smf_messages AS m2, smf_boards AS b ) WHERE t.ID_BOARD = m.ID_BOARD AND t.ID_BOARD = b.ID_BOARD AND t.ID_LAST_MSG = m.ID_MSG AND t.ID_FIRST_MSG = m2.ID_MSG AND mem.memberName = m.posterName AND FIND_IN_SET(-1, b.memberGroups) ORDER BY m.ID_MSG DESC LIMIT 5
And a logged user SQL is:
Code:
SELECT mem.realName, m.posterTime, m2.subject, t.ID_TOPIC, t.ID_MEMBER_UPDATED, t.ID_LAST_MSG, m.ID_MSG_MODIFIED, m.ID_BOARD, b.name AS bName, t.numReplies, m.posterName AS memberName, IFNULL(lt.ID_MSG, IFNULL(lmr.ID_MSG, -1)) + 1 AS new_from FROM (smf_members AS mem, smf_topics AS t, smf_messages AS m, smf_messages AS m2, smf_boards AS b LEFT JOIN smf_log_topics AS lt ON (lt.ID_TOPIC = t.ID_TOPIC AND lt.ID_MEMBER = 308) LEFT JOIN smf_log_mark_read AS lmr ON (lmr.ID_BOARD = t.ID_BOARD AND lmr.ID_MEMBER = 308)) WHERE t.ID_BOARD = m.ID_BOARD AND t.ID_BOARD = b.ID_BOARD AND t.ID_LAST_MSG = m.ID_MSG AND t.ID_FIRST_MSG = m2.ID_MSG AND mem.memberName = m.posterName AND 1 ORDER BY m.ID_MSG DESC LIMIT 5
you must replace the above references to user id 308 with a valid user id for your site
Execute thes in the SQL tab not the Query tab. Post the results.
I've done it in phpmyadmin, and the 5 new forum post come up. ok, so what next should I do with these query?
Try this, it has more debugging in it. This will break your site temporarily to gather more information. So make sure you backup the current file first.
1) Create backup of modules/mod_smf_recent_topics.php by copying the file to modules/mod_smf_recent_topics.php.bak 2) Extract the attached file mod_smf_recent_topics.zip 3) Upload the file mod_smf_recent_topics.php to modules/mod_smf_recent_topics.php 3) Reload your site and post the information that is presented in the Recent Topics module.
Try this, it has more debugging in it. This will break your site temporarily to gather more information. So make sure you backup the current file first.
1) Create backup of modules/mod_smf_recent_topics.php by copying the file to modules/mod_smf_recent_topics.php.bak 2) Extract the attached file mod_smf_recent_topics.zip 3) Upload the file mod_smf_recent_topics.php to modules/mod_smf_recent_topics.php 3) Reload your site and post the information that is presented in the Recent Topics module.
This is the result in the recent topics module when reload:
New Forum Post SELECT mem.realName, m.posterTime, m2.subject, t.ID_TOPIC, t.ID_MEMBER_UPDATED, t.ID_LAST_MSG, m.ID_MSG_MODIFIED, m.ID_BOARD, b.name AS bName, t.numReplies, m.posterName AS memberName, IFNULL(lt.ID_MSG, IFNULL(lmr.ID_MSG, -1)) + 1 AS new_from FROM (members AS mem, topics AS t, messages AS m, messages AS m2, boards AS b LEFT JOIN log_topics AS lt ON (lt.ID_TOPIC = t.ID_TOPIC AND lt.ID_MEMBER = 5) LEFT JOIN log_mark_read AS lmr ON (lmr.ID_BOARD = t.ID_BOARD AND lmr.ID_MEMBER = 5)) WHERE t.ID_BOARD = m.ID_BOARD AND t.ID_BOARD = b.ID_BOARD AND t.ID_LAST_MSG = m.ID_MSG AND t.ID_FIRST_MSG = m2.ID_MSG AND mem.memberName = m.posterName AND (FIND_IN_SET(9, b.memberGroups) OR FIND_IN_SET(5, b.memberGroups)) ORDER BY m.ID_MSG DESC LIMIT 5posts is empty
This is the result in the recent topics module when reload:
New Forum Post SELECT mem.realName, m.posterTime, m2.subject, t.ID_TOPIC, t.ID_MEMBER_UPDATED, t.ID_LAST_MSG, m.ID_MSG_MODIFIED, m.ID_BOARD, b.name AS bName, t.numReplies, m.posterName AS memberName, IFNULL(lt.ID_MSG, IFNULL(lmr.ID_MSG, -1)) + 1 AS new_from FROM (members AS mem, topics AS t, messages AS m, messages AS m2, boards AS b LEFT JOIN log_topics AS lt ON (lt.ID_TOPIC = t.ID_TOPIC AND lt.ID_MEMBER = 5) LEFT JOIN log_mark_read AS lmr ON (lmr.ID_BOARD = t.ID_BOARD AND lmr.ID_MEMBER = 5)) WHERE t.ID_BOARD = m.ID_BOARD AND t.ID_BOARD = b.ID_BOARD AND t.ID_LAST_MSG = m.ID_MSG AND t.ID_FIRST_MSG = m2.ID_MSG AND mem.memberName = m.posterName AND (FIND_IN_SET(9, b.memberGroups) OR FIND_IN_SET(5, b.memberGroups)) ORDER BY m.ID_MSG DESC LIMIT 5
posts is empty
The query is not returning any results(see last line) as indicated by posts is empty. Execute the above SQL in phpmyadmin SQL tab and see what you get.
The query is not returning any results(see last line) as indicated by posts is empty. Execute the above SQL in phpmyadmin SQL tab and see what you get.
Get an error this:
MySQL said: Documentation #1146 - Table 'emk.members' doesn't exist
uhhhhhhh, checking your SQL the prefix for the smf tables are not being populated. What is your smf table prefix? Have you saved the bridge configuration field that stores the smf table prefix?
uhhhhhhh, checking your SQL the prefix for the smf tables are not being populated. What is your smf table prefix? Have you saved the bridge configuration field that stores the smf table prefix?
Joomla Hacks is a Joomla Components, Joomla Modules, Joomla Templates, & Joomla Mambots resource portal. None of the text or images in this public website may be copied without the expressed written consent of the authors. Copyright 2005 by JoomlaHacks.com. Powered by Joomla. All rights reserved.
Terms of Use