Main page shows 25 recent topics, ignores option saying 40

Started by Simon, February 11, 2023, 05:32:05 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Simon

Go to Lemmings Forums main page. Scroll down. You'll see a list of recent topics, each with a link to its latest post. This list is 25 topics long.

The list ignores the list length that we set in the forum admin options:

Admin button (at top of page, only visible for forum admins)
→ Features and Options
→ Configuration
→ Current Theme
→ Number of recent posts to display on board index:

Expected instead: If the setting is 40, the list should contain 40 topics, not 25.

It's a regression, the forum heeded the setting some years ago.

More testing: I can set it to, e.g., 15, and then the list will show only 15 topics, okay. I can set it to 25 and it will show 25 topics. But 30 or 40 will still show only 25.

(We can argue if 40 is too much, we can find some other value that works for you. With 25 new topics, I see borderline over a week of history only, and I really have only ~20 different topics, not 25, in it because I see ~5 recycling posts in a separate line. But that's beside the point of the bug.)

-- Simon

namida

Are you okay with this being moved to the public Site Discussion board?
My projects
2D Lemmings: NeoLemmix (engine) | Lemmings Plus Series (level packs) | Doomsday Lemmings (level pack)
3D Lemmings: Loap (engine) | L3DEdit (level / graphics editor) | L3DUtils (replay / etc utility) | Lemmings Plus 3D (level pack)
Non-Lemmings: Commander Keen: Galaxy Reimagined (a Commander Keen fangame)

Simon


IchoTolot

I am not insane after all!!!!

I was just wondering yesterday why that list suddenly was so short and in panic searched for a profile option to change it back!

I did not find anything there and on google only stuff an admin can do.

So yes if that list was back at 40 again it would be very much appreciated! :)


Simon

And the list shinks day by day. Yesterday I saw 24, today only 22.

All while the setting remains at 40.

-- Simon

kaywhyn

Quote from: Simon on February 12, 2023, 04:10:45 AM
And the list shinks day by day. Yesterday I saw 24, today only 22.

All while the setting remains at 40.

-- Simon

Hmm, it would appear that the amount is not the same for everyone then. I think yesterday I counted 19. Today, only 17 now
https://www.youtube.com/channel/UCPMqwuqZ206rBWJrUC6wkrA - My YouTube channel and you can also find my playlists of Lemmings level packs that I have LPed
kaywhyn's blog: https://www.lemmingsforums.net/index.php?topic=5363.0

WillLem

FWIW, I'd probably set it to about 100 if I could, so more is preferable if possible.

Benefits of this are being able to see what's been updated if you have been away for a while (say, more than a week), but it's also possible to quickly locate threads that have been spoken about within the last few weeks, but perhaps not updated more recently.

Silken Healer

Quote from: Simon on February 12, 2023, 04:10:45 AM
And the list shinks day by day. Yesterday I saw 24, today only 22.

All while the setting remains at 40.

-- Simon

Hm. This is peculiar. Can you still set it to less than the current amount of topics okay? What about more than the current amount of topics but less than 25?

IchoTolot

Maybe it has something to do with the date?

Like the history can still show up to 40 topics, but only takes into consideration the last 2 weeks or so. --> That could explain the fluctuating number!

Maybe this extra option was introduced in a recent "Simple Machines" update and that new standard needs to be turned off now so it always goes up the the maximum of 40. ???

Simon

Quote from: IchoTolot on February 13, 2023, 04:12:08 PM
date?
only takes into consideration the last 2 weeks or so. --> That could explain the fluctuating number!

Good call. I've watched it for 3 days, and it appears to cut off topics older than 10 days. Every day, it ate one day worth of topics off the end.

Quote
introduced in a recent "Simple Machines" update and that new standard needs to be turned off now

At least the options page from opening post has no option for this. SMF support forums seem to have no topic about this for SMF 2.0.x. I'll keep looking.

namida, have we updated between 2.0.x recently?

-- Simon

namida

From what I recall, showing only updated topics (rather than all individual posts) was a modification in the first place. No idea why it's having issues, though - I'd have to look into it. It may just be that we never noticed the cutoff date before. If this is all it is, it's also probably not hard to do something about.

The last SMF version update was in June 2021 (which probably means I need to update it again, actually). There are more-recent changes than this in the repo, but they relate to implementing reCAPTCHA and the dark theme, not to version upgrades.
My projects
2D Lemmings: NeoLemmix (engine) | Lemmings Plus Series (level packs) | Doomsday Lemmings (level pack)
3D Lemmings: Loap (engine) | L3DEdit (level / graphics editor) | L3DUtils (replay / etc utility) | Lemmings Plus 3D (level pack)
Non-Lemmings: Commander Keen: Galaxy Reimagined (a Commander Keen fangame)

Silken Healer

Quote from: IchoTolot on February 13, 2023, 04:12:08 PM
Maybe it has something to do with the date?

Quote from: Simon on February 11, 2023, 05:32:05 AM
(We can argue if 40 is too much, we can find some other value that works for you. With 25 new topics, I see borderline over a week of history only, and I really have only ~20 different topics, not 25, in it because I see ~5 recycling posts in a separate line. But that's beside the point of the bug.)

In the same way we could argue if 40 is too much, we could also argue if it'd be better to have it as a all posts since [time] ago instead of last [amount] posts as the user wanting to see what's happening recently would probably want to see it that way. Maybe we could create a separate thread to discuss changing it?

Simon

And now it shows entries back to 2023-02-06, which is a full 2 weeks back, more than 10 days. Sounds like it's not purely the time of last post. And it's too early for a year-2038 bug. :lix-unsure:

Exactly 24 topics for me, including the deleted posts that only global mods or admins see.

Quote from: Silken Healer on February 17, 2023, 08:18:39 PM
argue if it'd be better to have it as a all posts since [time] ago
user wanting to see what's happening recently
create a separate thread to discuss changing it?

Sure, make a separate thread. Ideally, I wouldn't it like to be 40 topics, either. I'd like it to be many many topics, from at least a month back. I treat subforums more like a way to tag Lemmings Forums topics and I get annoyed when I can't have a topic in two subforums.

-- Simon

Simon

The wonderful source code on the LF server that (I assume) creates the list of recent topics.

namida, should I toy around with it? Do we have a dummy instance for me to test so that I won't break production?

Source of Subs-Recent.php

// Find all the posts.  Newer ones will have higher IDs.  (assuming the last 20 * number are accessable...)
// !!!SLOW This query is now slow, NEEDS to be fixed.  Maybe break into two?


<?php/** * Simple Machines Forum (SMF) * * @package SMF * @author Simple Machines http://www.simplemachines.org * @copyright 2011 Simple Machines * @license http://www.simplemachines.org/about/smf/license.php BSD * * @version 2.0 */if (!defined('SMF'))	die('Hacking attempt...');/*	!!!*/// Get the latest posts of a forum.function getLastPosts($latestPostOptions){	global $scripturl, $txt, $user_info, $modSettings, $smcFunc, $context;	// Find all the posts.  Newer ones will have higher IDs.  (assuming the last 20 * number are accessable...)	// !!!SLOW This query is now slow, NEEDS to be fixed.  Maybe break into two?	$request = $smcFunc['db_query']('', '		SELECT			m.poster_time, ms.subject, m.id_topic, m.id_member, m.id_msg, b.id_board, b.name AS board_name,			IFNULL(mem.real_name, m.poster_name) AS poster_name, 			SUBSTRING(m.body, 1, 384) AS body, m.smileys_enabled		FROM {db_prefix}topics AS t			INNER JOIN {db_prefix}messages AS m ON (m.id_msg = t.id_last_msg)			INNER JOIN {db_prefix}boards AS b ON (b.id_board = t.id_board)			INNER JOIN {db_prefix}messages AS ms ON (ms.id_msg = t.id_first_msg)			LEFT JOIN {db_prefix}members AS mem ON (mem.id_member = m.id_member)' . (!$user_info['is_guest'] ? '			LEFT JOIN {db_prefix}log_topics AS lt ON (lt.id_topic = t.id_topic AND lt.id_member = {int:current_member})			LEFT JOIN {db_prefix}log_mark_read AS lmr ON (lmr.id_board = b.id_board AND lmr.id_member = {int:current_member})' : '') . '		WHERE t.id_last_msg >= {int:min_message_id}			AND ' . $user_info['query_wanna_see_board'] . ($modSettings['postmod_active'] ? '			AND t.approved = {int:is_approved}			AND m.approved = {int:is_approved}' : '') . '		ORDER BY t.id_last_msg DESC		LIMIT ' . $latestPostOptions['number_posts'],		array(			'current_member' => $user_info['id'],			'min_message_id' => $modSettings['maxMsgID'] - 35 * min($latestPostOptions['number_posts'], 5),			'is_approved' => 1,		)	);	$posts = array();	while ($row = $smcFunc['db_fetch_assoc']($request))	{		// Censor the subject and post for the preview ;).		censorText($row['subject']);		censorText($row['body']);		$row['body'] = strip_tags(strtr(parse_bbc($row['body'], $row['smileys_enabled'], $row['id_msg']), array('<br />' => '&#38;#10;')));		if ($smcFunc['strlen']($row['body']) > 128)			$row['body'] = $smcFunc['substr']($row['body'], 0, 128) . '...';		// Build the array.		$posts[] = array(			'board' => array(				'id' => $row['id_board'],				'name' => $row['board_name'],				'href' => $scripturl . '?board=' . $row['id_board'] . '.0',				'link' => '<a href="' . $scripturl . '?board=' . $row['id_board'] . '.0">' . $row['board_name'] . '</a>'			),			'topic' => $row['id_topic'],			'poster' => array(				'id' => $row['id_member'],				'name' => $row['poster_name'],				'href' => empty($row['id_member']) ? '' : $scripturl . '?action=profile;u=' . $row['id_member'],				'link' => empty($row['id_member']) ? $row['poster_name'] : '<a href="' . $scripturl . '?action=profile;u=' . $row['id_member'] . '">' . $row['poster_name'] . '</a>'			),			'subject' => $row['subject'],			'short_subject' => shorten_subject($row['subject'], 24),			'preview' => $row['body'],			'time' => timeformat($row['poster_time']),			'timestamp' => forum_time(true, $row['poster_time']),			'raw_timestamp' => $row['poster_time'],			'href' => $scripturl . '?topic=' . $row['id_topic'] . '.new;topicseen#new',			'link' => '<a href="' . $scripturl . '?topic=' . $row['id_topic'] . '.new;topicseen#new" rel="nofollow">' . $row['subject'] . '</a>'			/*			'href' => $scripturl . '?topic=' . $row['id_topic'] . '.msg' . $row['id_msg'] . ';topicseen#msg' . $row['id_msg'],			'link' => '<a href="' . $scripturl . '?topic=' . $row['id_topic'] . '.msg' . $row['id_msg'] . ';topicseen#msg' . $row['id_msg'] . '" rel="nofollow">' . $row['subject'] . '</a>'			*/		);	}	$smcFunc['db_free_result']($request);	return $posts;}// Callback-function for the cache for getLastPosts().function cache_getLastPosts($latestPostOptions){	return array(		'data' => getLastPosts($latestPostOptions),		'expires' => time() + 60,		'post_retri_eval' => '			foreach ($cache_block[\'data\'] as $k => $post)			{				$cache_block[\'data\'][$k][\'time\'] = timeformat($post[\'raw_timestamp\']);				$cache_block[\'data\'][$k][\'timestamp\'] = forum_time(true, $post[\'raw_timestamp\']);			}',	);}?>

Still makes me wonder why it lowered from 40 to 25, but so slowly only, over time.

-- Simon

namida

I've always run dummy instances in a local VM rather than on the server. (Note though that I'm on Windows; you might not need the VM part.)
My projects
2D Lemmings: NeoLemmix (engine) | Lemmings Plus Series (level packs) | Doomsday Lemmings (level pack)
3D Lemmings: Loap (engine) | L3DEdit (level / graphics editor) | L3DUtils (replay / etc utility) | Lemmings Plus 3D (level pack)
Non-Lemmings: Commander Keen: Galaxy Reimagined (a Commander Keen fangame)