Simple Machines Community Forum

Customizing SMF => Graphics and Templates => Topic started by: [chrisB] on December 12, 2022, 02:09:21 PM

Title: Last post date/time question
Post by: [chrisB] on December 12, 2022, 02:09:21 PM
Can the 'Last Post: Date and time' be a link to the actual post also?
Title: Re: Last post date/time question
Post by: Kindred on December 12, 2022, 03:34:49 PM
In what location?
Title: Re: Last post date/time question
Post by: [chrisB] on December 12, 2022, 03:49:58 PM
The main index page. 👍🏻
Title: Re: Last post date/time question
Post by: Kindred on December 12, 2022, 04:13:12 PM
I assume you mean the board-list then?

in Boardindex.template.php, you'd have to add the link to the loops that pulls the content (sorry, on a mobile device, so Idon't have the exact code in front of me)
Title: Re: Last post date/time question
Post by: [chrisB] on December 15, 2022, 10:31:02 AM
Quote from: Kindred on December 12, 2022, 04:13:12 PMI assume you mean the board-list then?

in Boardindex.template.php, you'd have to add the link to the loops that pulls the content (sorry, on a mobile device, so Idon't have the exact code in front of me)
Would you please be able to tell me how to make the edits for this?

Also, if you don't mind. Can the vertical scroll bar in browsers be forced to always show? It happens here a lot, as it does on my forum where it sometimes doesn't show. Usually after a 10 seconds or so, it will popup but it makes my site seem like its bouncing.

I appreciate your help.
Title: Re: Last post date/time question
Post by: Kindred on December 15, 2022, 10:41:36 AM
Oh...  in looking at the template files, this becomes alot more difficult than I thought.

lastpost generates here
<div class="lastpost">
', function_exists('template_bi_' . $board['type'] . '_lastpost') ? call_user_func('template_bi_' . $board['type'] . '_lastpost', $board) : template_bi_board_lastpost($board), '
</div>';
by calling
function template_bi_board_lastpost($board)
{
if (!empty($board['last_post']['id']))
echo '
<p>', $board['last_post']['last_post_message'], '</p>';
}

However -- that reads directly from the array which is assembled elsewhere, and includes the link as PART of the array value.

Thing is....   that array value already DOES link to the new posts in the topic.
like so ---> forumurl/index.php?topic=1234.msg5678#new