News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

New topic bold text

Started by forumfjott, November 19, 2013, 10:50:49 AM

Previous topic - Next topic

forumfjott

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. 

margarett

What theme are you using? If non-default, does it have a MessageIndex.template.php?
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

forumfjott

I only have default and core (EDIT) and yes, i do have messageindex.template

margarett

OK.

Just to make it clear, you want the topic subject to be bold when the "new" orange button is shown?
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

forumfjott

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

margarett

#5
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>';
}
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

forumfjott

#6
works like a charm!!

Thanks a lot

PS: 15000 views in a few days??? wow

Adraiam

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?



Sorry for my english, and thanks!

margarett

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...
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

Adraiam

Thanks for the welcome, and sorry for continue this topic :(

Without this code doesn't show "N / D" in the forums without messages :


margarett

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 :(
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

Adraiam

I'll wait then. Thank you again, margarett!

Mortissimov

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>';

Adraiam

Hey navMartin,

Your code always shows the topic in bold. I just need bold to new topics, but thank you anyway  ;)

Steve

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. :)
DO NOT pm me for support!

Mortissimov

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 '';
}
}
}

Steve

Who marked the topic solved again, may I ask?
DO NOT pm me for support!

Illori

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.

Steve

Hmm ... that gives me an idea ... :P
DO NOT pm me for support!

Adraiam

NavMartin, your code works perfectly without errors, you're the best  :-*

Thank you all for the help!

Advertisement: