News:

Wondering if this will always be free?  See why free is better.

Main Menu

Increasing "Most Recent Posts" on index.

Started by Geek, July 26, 2005, 07:17:57 PM

Previous topic - Next topic

Geek

Hello,

Forum search brought up this answer:

Quote from: Ben_S on November 04, 2004, 07:21:03 PM
Theres an option in Edit Features and Options to specify the number.

But I cannot find it.

Is this Admin feature not available in 1.0.5, or under a different name?

Thanks!
-= Gregg =-

codenaught

Theme and Layout Settings -> Theme Settings -> Theme Name -> Number of recent posts to display on board index
Dev Consultant
Former SMF Doc Coordinator

Geek

Sorry mate, wasn't what I meant :(

Under the "Forum Stats", there is a link, View the 10 most recent posts on the forum.

I want to change that to 25.

I had done this to my old YaBB Gold in code rather easy, but wouldn't know where to look for it in this forum.

Thanks!
-= Gregg =-

Meriadoc

in SMF 1.0.5 find:
// Find the 10 most recent messages they can *view*.
$request = db_query("
SELECT m.ID_MSG
FROM {$db_prefix}messages AS m, {$db_prefix}boards AS b
WHERE b.ID_BOARD = m.ID_BOARD" . (!empty($modSettings['recycle_enable']) && $modSettings['recycle_board'] > 0 ? "
AND b.ID_BOARD != $modSettings[recycle_board]" : '') . "
AND $user_info[query_see_board]
ORDER BY m.ID_MSG DESC
LIMIT 10", __FILE__, __LINE__);

Replace:
// Find the 10 most recent messages they can *view*.
$request = db_query("
SELECT m.ID_MSG
FROM {$db_prefix}messages AS m, {$db_prefix}boards AS b
WHERE b.ID_BOARD = m.ID_BOARD" . (!empty($modSettings['recycle_enable']) && $modSettings['recycle_board'] > 0 ? "
AND b.ID_BOARD != $modSettings[recycle_board]" : '') . "
AND $user_info[query_see_board]
ORDER BY m.ID_MSG DESC
LIMIT 25", __FILE__, __LINE__);
If I know the way home and am walking along it drunkenly, is it any less the right way because I am staggering from side to side? : Leo Tolstoy
Everything I know I learned from Calvin and Hobbes.
And patience is about the most useful thing you could ever have.  That and backups. : [Unknown]
If I choose to send thee, Tuor son of Huor, then believe not that thy one sword is not worth the sending. : Ulmo, Lord of the Waters - Unfinished Tales, by J.R.R. Tolkien

Geek

Updated and uploaded that, something is still ocking it in at the 10 most recent posts ???
-= Gregg =-

Geek

#5
Got it! :D

Also have to find:

// Get all the most recent posts.
$request = db_query("
SELECT
m.ID_MSG, m.subject, m.smileysEnabled, m.posterTime, m.body, m.ID_TOPIC, t.ID_BOARD, b.ID_CAT,
b.name AS bname, c.name AS cname, t.numReplies, m.ID_MEMBER, m2.ID_MEMBER AS ID_FIRST_MEMBER,
IFNULL(mem2.realName, m2.posterName) AS firstPosterName, t.ID_FIRST_MSG,
IFNULL(mem.realName, m.posterName) AS posterName, t.ID_LAST_MSG
FROM {$db_prefix}messages AS m, {$db_prefix}messages AS m2, {$db_prefix}topics AS t, {$db_prefix}boards AS b, {$db_prefix}categories AS c
LEFT JOIN {$db_prefix}members AS mem ON (mem.ID_MEMBER = m.ID_MEMBER)
LEFT JOIN {$db_prefix}members AS mem2 ON (mem2.ID_MEMBER = m2.ID_MEMBER)
WHERE m2.ID_MSG = t.ID_FIRST_MSG
AND t.ID_TOPIC = m.ID_TOPIC
AND b.ID_BOARD = t.ID_BOARD
AND c.ID_CAT = b.ID_CAT
AND m.ID_MSG IN (" . implode(', ', $messages) . ")
ORDER BY m.ID_MSG DESC
LIMIT 0, 10", __FILE__, __LINE__);


to:

// Get all the most recent posts.
$request = db_query("
SELECT
m.ID_MSG, m.subject, m.smileysEnabled, m.posterTime, m.body, m.ID_TOPIC, t.ID_BOARD, b.ID_CAT,
b.name AS bname, c.name AS cname, t.numReplies, m.ID_MEMBER, m2.ID_MEMBER AS ID_FIRST_MEMBER,
IFNULL(mem2.realName, m2.posterName) AS firstPosterName, t.ID_FIRST_MSG,
IFNULL(mem.realName, m.posterName) AS posterName, t.ID_LAST_MSG
FROM {$db_prefix}messages AS m, {$db_prefix}messages AS m2, {$db_prefix}topics AS t, {$db_prefix}boards AS b, {$db_prefix}categories AS c
LEFT JOIN {$db_prefix}members AS mem ON (mem.ID_MEMBER = m.ID_MEMBER)
LEFT JOIN {$db_prefix}members AS mem2 ON (mem2.ID_MEMBER = m2.ID_MEMBER)
WHERE m2.ID_MSG = t.ID_FIRST_MSG
AND t.ID_TOPIC = m.ID_TOPIC
AND b.ID_BOARD = t.ID_BOARD
AND c.ID_CAT = b.ID_CAT
AND m.ID_MSG IN (" . implode(', ', $messages) . ")
ORDER BY m.ID_MSG DESC
LIMIT 0, 25", __FILE__, __LINE__);



In Themes/languages/index.english.php, also change:
$txt[234] = 'View the 10 most recent posts on the forum.';

to:
$txt[234] = 'View the 25 most recent posts on the forum.';
-= Gregg =-

Meriadoc

ah good, didn't see the bit. It worked with only the first replace for me. of course, my local test copy that I tried it on only has 3 posts and i went down not up to 2 to test it ;)
Glad to see you've worked it out!
If I know the way home and am walking along it drunkenly, is it any less the right way because I am staggering from side to side? : Leo Tolstoy
Everything I know I learned from Calvin and Hobbes.
And patience is about the most useful thing you could ever have.  That and backups. : [Unknown]
If I choose to send thee, Tuor son of Huor, then believe not that thy one sword is not worth the sending. : Ulmo, Lord of the Waters - Unfinished Tales, by J.R.R. Tolkien

Advertisement: