Thanks for making this module. I made some changes however to have it display in a more standard way (bullets), as well as revised the SQL so as to display the total replies as well.
Displaying the total replies basically changes the logic of the query since you have to display only a post once, even if there are multiple replies. the title displayed is that of the original.
I'm attaching my enhancement. Overwrite mod_smf_recent_posts.php under /modules with this one.
I hope you all like the mod.
Thanks.
(To admin: if revision to the file is not allowed, please remove attachment.)
« Last Edit: April 07, 2005, 02:50:14 AM by Reggie »
I just looked at your modifications. I didn't realize that what you did is actually a recent topics module. I renamed the files and posted it as a new module.
Reggie, I like your ‘SMF Recent Post’ module one request though, right now the topic and post are linked to the post, can you change so that when clicked on topic the topic is displayed and when clicked on post the post is displayed.
Yesterdey I got this error that locked my site: Fatal error: Call to undefined function: db_query() in /home/httpd/vhosts/saudeemrede.net/httpdocs/modules/mod_smfRecentPosts.php on line 44.
Reggie, I like your ‘SMF Recent Post’ module one request though, right now the topic and post are linked to the post, can you change so that when clicked on topic the topic is displayed and when clicked on post the post is displayed.
Member sinnys asked me privately a mod to show the Real Name of the user instead of the username. Here's the mod:
Find:
Code:
$request = db_query(" SELECT m.posterTime, m2.subject, t.ID_TOPIC, t.ID_MEMBER_UPDATED, t.ID_LAST_MSG, m.ID_BOARD, b.name AS bName, t.numReplies, m.posterName, " . ($user_info['is_guest'] ? '1 AS isRead, 0 AS logTime' : ' IFNULL(lt.logTime, IFNULL(lmr.logTime, 0)) >= GREATEST(m.posterTime, m.modifiedTime) AS isRead, IFNULL(lt.logTime, IFNULL(lmr.logTime, 0)) AS logTime') . " FROM smf_topics AS t, smf_messages AS m, smf_messages AS m2, smf_boards AS b" . (!$user_info['is_guest'] ? " LEFT JOIN {$db_prefix}log_topics AS lt ON (lt.ID_TOPIC = t.ID_FIRST_MSG AND lt.ID_MEMBER = $ID_MEMBER) LEFT JOIN {$db_prefix}log_mark_read AS lmr ON (lmr.ID_BOARD = t.ID_BOARD AND lmr.ID_MEMBER = $ID_MEMBER)" : '') . " WHERE t.ID_BOARD = m.ID_BOARD AND t.ID_BOARD = b.ID_BOARD" . (empty($exclude_boards) ? '' : " AND t.ID_BOARD NOT IN (" . implode(', ', $exclude_boards) . ")") . " AND t.ID_LAST_MSG = m.ID_MSG AND t.ID_FIRST_MSG = m2.ID_MSG ORDER BY m.posterTime DESC LIMIT $limit", __FILE__, __LINE__);
replace with:
Code:
$request = db_query(" SELECT m.posterTime, m2.subject, t.ID_TOPIC, t.ID_MEMBER_UPDATED, t.ID_LAST_MSG, m.ID_BOARD, b.name AS bName, t.numReplies, u.realName, m.posterName, " . ($user_info['is_guest'] ? '1 AS isRead, 0 AS logTime' : ' IFNULL(lt.logTime, IFNULL(lmr.logTime, 0)) >= GREATEST(m.posterTime, m.modifiedTime) AS isRead, IFNULL(lt.logTime, IFNULL(lmr.logTime, 0)) AS logTime') . " FROM smf_topics AS t, smf_messages AS m, smf_messages AS m2, smf_members AS u, smf_boards AS b" . (!$user_info['is_guest'] ? " LEFT JOIN {$db_prefix}log_topics AS lt ON (lt.ID_TOPIC = t.ID_FIRST_MSG AND lt.ID_MEMBER = $ID_MEMBER) LEFT JOIN {$db_prefix}log_mark_read AS lmr ON (lmr.ID_BOARD = t.ID_BOARD AND lmr.ID_MEMBER = $ID_MEMBER)" : '') . " WHERE t.ID_BOARD = m.ID_BOARD AND t.ID_BOARD = b.ID_BOARD" . (empty($exclude_boards) ? '' : " AND t.ID_BOARD NOT IN (" . implode(', ', $exclude_boards) . ")") . " AND t.ID_LAST_MSG = m.ID_MSG AND t.ID_FIRST_MSG = m2.ID_MSG AND m.posterName = u.memberName ORDER BY m.posterTime DESC LIMIT $limit", __FILE__, __LINE__);
I installed SMF Recent Posts, but it does not show recent posts for the guest. Is necessary to make login to see. The module is in public mode. What the problem?
Yesterdey I got this error that locked my site: Fatal error: Call to undefined function: db_query() in /home/httpd/vhosts/saudeemrede.net/httpdocs/modules/mod_smfRecentPosts.php on line 44.
Any hints?
ahh, i also had this problem. can anyone guide me?
This is a great module Reggie and cowboy, thanks! I am having one issue though... threads are being shown from the forums in which users/guests don't have permission, i.e. administrative forums. Have you thought about incorporating this functionality into the module?
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