Hi
I have several requests of making the topic text you can click to show latest post viewing from forum main page, bold.
They do understand that there is other methods to be directed to the latest post, but while skimming fora, they intend to click this link between the posters name and the time posted.
Nyeste innlegg av E****d T****d <----Name (hidden here)
i Sv: Euroscope - Norway N... <--------This line with bold fonts/text (mind the norwegian language)
på I går kl. 23:32:01 <--------Time for newest post
Hope there is a easy way to accommodate their wishes and you gurus show me where to put the BOLD code/command.
What theme are you using? If non-default, does it have a MessageIndex.template.php?
I only have default and core (EDIT) and yes, i do have messageindex.template
OK.
Just to make it clear, you want the topic subject to be bold when the "new" orange button (http://media.simplemachinesweb.com/smf/default/images/english-utf8/new.gif) is shown?
not quite.
This option to jump to newest post is only from the main page, like this: http://www.simplemachines.org/community/
If you look at the top forum, News and Updates, you can jump to newest post by clicking: Re: SMF 1.1.19 and 2.0.6...
This is the text I want with bold letters/font, like:
Last post by talktoanil
in Re: SMF 1.1.19 and 2.0.6...
on November 16, 2013, 10:27:39 AM
:D
You have strange members :P
BoardIndex.template.php, find:
if (!empty($board['last_post']['id']))
echo '
<p><strong>', $txt['last_post'], '</strong> ', $txt['by'], ' ', $board['last_post']['member']['link'] , '<br />
', $txt['in'], ' ', $board['last_post']['link'], '<br />
', $txt['on'], ' ', $board['last_post']['time'],'
</p>';
Replace with:
if (!empty($board['last_post']['id']))
{
echo '
<p>', $txt['last_post'], ' ', $txt['by'], ' ', $board['last_post']['member']['link'] , '<br />';
if ($board['new'] || $board['children_new'])
echo $txt['in'], ' <strong>', $board['last_post']['link'], '</strong><br />';
else
echo $txt['in'], ' ', $board['last_post']['link'], '<br />';
echo $txt['on'], ' ', $board['last_post']['time'],'
</p>';
}
works like a charm!!
Thanks a lot
PS: 15000 views in a few days??? wow
Quote from: margarett on November 20, 2013, 08:07:31 AM
You have strange members :P
BoardIndex.template.php, find:
if (!empty($board['last_post']['id']))
echo '
<p><strong>', $txt['last_post'], '</strong> ', $txt['by'], ' ', $board['last_post']['member']['link'] , '<br />
', $txt['in'], ' ', $board['last_post']['link'], '<br />
', $txt['on'], ' ', $board['last_post']['time'],'
</p>';
Replace with:
if (!empty($board['last_post']['id']))
echo '
<p>', $txt['last_post'], ' ', $txt['by'], ' ', $board['last_post']['member']['link'] , '<br />';
if ($board['new'] || $board['children_new'])
echo $txt['in'], ' <strong>', $board['last_post']['link'], '</strong><br />';
else
echo $txt['in'], ' ', $board['last_post']['link'], '<br />';
echo $txt['on'], ' ', $board['last_post']['time'],'
</p>';
Sorry to revive this topic, but I have a problem with the code. It works perfectly, but in forums without messages appears "N/D". Can someone help me, please?
(http://i.imgur.com/9hYJ8Ua.png)
Sorry for my english, and thanks!
Hi and welcome to sm.org ;)
You shouldn't continue another person's topic, especially one that is marked as solved as it can be skipped by people providing support ;)
That being said... How does it show without this code? I'm not on the computer now so I can't check, but I would guess that it works the same because the code I added doesn't change the text which is shown, just bold it when there are new posts inside that board...
Thanks for the welcome, and sorry for continue this topic :(
Without this code doesn't show "N / D" in the forums without messages :
(http://i.imgur.com/riIDrQl.png)
It shouldn't... But I think I see why, let me try it at the computer, but only tomorrow ;)
And I'm sorry, you did good in reviving this topic as I'm pretty sure the code is buggy :(
I'll wait then. Thank you again, margarett!
Edit the code like this:
if (!empty($board['last_post']['id']))
echo '
<p>', $txt['last_post'], ' ', $txt['by'], ' ', $board['last_post']['member']['link'] , '<br />
', $txt['in'], ' <strong>', $board['last_post']['link'], '</strong><br />
', $txt['on'], ' ', $board['last_post']['time'],'
</p>';
Hey navMartin,
Your code always shows the topic in bold. I just need bold to new topics, but thank you anyway ;)
I'm going to mark this unsolved then so this thread isn't skipped over until Bruno gets a chance to look at his code. :)
Ok sorry, i was too tired. This code is working perfect for me.
if (!empty($board['last_post']['id'])) {
if ($board['new'] || $board['children_new']) {
echo '
<p>', $txt['last_post'], ' ', $txt['by'], ' ', $board['last_post']['member']['link'] , '<br />
', $txt['in'], ' <strong>', $board['last_post']['link'], '</strong><br />
', $txt['on'], ' ', $board['last_post']['time'],'
</p>';
} else {
if (!empty($board['last_post'])) {
echo '
<p>', $txt['last_post'], ' ', $txt['by'], ' ', $board['last_post']['member']['link'] , '<br />
', $txt['in'], ' ', $board['last_post']['link'], '<br />
', $txt['on'], ' ', $board['last_post']['time'],'
</p>';
} else {
echo '';
}
}
}
Who marked the topic solved again, may I ask?
opps, i did not notice that it was not the op that said it was working.
maybe if the topic was split from what was a bump we could figure out who has what solved.
Hmm ... that gives me an idea ... :P
NavMartin, your code works perfectly without errors, you're the best :-*
Thank you all for the help!
Marking solved again. :P
Quote from: Steve on February 15, 2015, 09:36:50 AM
Marking solved again. :P
but the op has never said this solved their problem from a few years ago.
Yes, he did ;) The topic was marked solved before ;)
For future reference, I fixed the original code ;) There were just missing brackets,