Always having your board name in the title of your forum

Started by Burpee, April 25, 2005, 12:57:46 PM

Previous topic - Next topic

Matthew K.

Great modification!

However, for me at least when i'm on the index.php it says "My Forum Name - My Forum Name Index" so for the index it repeats "My Forum Name" instead of just showing "My Forum Name - Index"

Any easy ways you see around this?

Thanks!

Arantor

On the very front page or somewhere else?

And is that for SMF 1.1 or 2.0?

flickernever

  $tboard = empty($context['linktree'][2]['name'])?'':' - '.$context['linktree'][2]['name'];
   $ttopic = empty($context['linktree'][3]['name'])?'':' - '.$context['linktree'][3]['name'];
   if (! ereg($context['forum_name'], $context['page_title']))   
        $context['page_title'] = $context['linktree'][0]['name'].$tboard.$ttopic;


This is code works but doesn't print the topic title in child boards. Any idea how I can do it?

ShowMeYourStyle

#63
Hi guys,

I got a problem with my custom mod (made by a friend of mine)
the link is: смотреть фильмы онлайн

As you see, it uses my forum title, is there a way to fix it, say the title would be "Matches"

Could someone help me out?

Thanks,
Rashid

krick

Just an update to my earlier post.  It appears that ereg() is being deprecated in PHP, so I updated the code to use strpos() instead, which happens to be faster anyway.


$tboard = empty($context['linktree'][2]['name'])?'':' - '.$context['linktree'][2]['name'];
$ttopic = empty($context['linktree'][3]['name'])?'':' - '.$context['linktree'][3]['name'];
if (strpos($context['page_title'], $context['forum_name']) === false)
$context['page_title'] = $context['linktree'][0]['name'].$tboard.$ttopic;



Coon

Quote from: grandslam on February 18, 2006, 05:27:23 PM
i made it to prevent on the index to have the forum name twice:

if (substr($context['page_title'],0,strlen($context['forum_name'])) == $context['forum_name'])
echo '<title>', $context['page_title'], '</title>';
else
echo '<title>',$context['forum_name'], ' - ', $context['page_title'], '</title>';



I'm getting this error when I use this code:

Template Parse Error!
It seems something has gone sour on the forum with the template system. This problem should only be temporary, so please come back later and try again. If you continue to see this message, please contact the administrator.

I got version 1.1.11.  I've also seen another error that suggested code with ' needed be be closed off with \ or ;.  Is there a missing piece of code?

Thanks!

Oldiesmann

There is nothing wrong with the code above. Where did you put it in your template file?
Michael Eshom
Christian Metal Fans

Coon

Same spot as instructed.  Weird... I wonder if it has to do with my PHP version?

ammaar102

I'm a newbie and do not know much about these things. I didn't really get these bit confused....     :o  :-[

Dblog

how to add board/child board name in between topic title - and - forum title in 'page title'

Advertisement: