Advertisement:

Author Topic: Always having your board name in the title of your forum  (Read 103375 times)

Offline Matthew K.

  • SMF Super Hero
  • *******
  • Posts: 12,430
  • Gender: Male
    • matthew.kerle on Facebook
    • @matthew_kerle on Twitter
Re: Always having your board name in the title of your forum
« Reply #60 on: September 12, 2009, 03:10:45 PM »
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!

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 71,673
    • StoryBB/StoryBB on GitHub
Re: Always having your board name in the title of your forum
« Reply #61 on: October 10, 2009, 08:17:21 AM »
On the very front page or somewhere else?

And is that for SMF 1.1 or 2.0?
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.

Offline flickernever

  • Semi-Newbie
  • *
  • Posts: 69
Re: Always having your board name in the title of your forum
« Reply #62 on: December 07, 2009, 04:16:23 PM »
Code: [Select]
  $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?

Offline ShowMeYourStyle

  • Semi-Newbie
  • *
  • Posts: 27
    • Смотреть фильмы онлайн
Re: Always having your board name in the title of your forum
« Reply #63 on: January 03, 2010, 01:20:11 PM »
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
« Last Edit: July 07, 2011, 01:36:56 PM by ShowMeYourStyle »

Offline krick

  • Jr. Member
  • **
  • Posts: 173
    • tank + paladin = tankadin
Re: Always having your board name in the title of your forum
« Reply #64 on: July 01, 2010, 06:01:09 PM »
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.

Code: [Select]
$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;


Offline Coon

  • Jr. Member
  • **
  • Posts: 171
  • Gender: Male
  • Check out my forum if you like soccer!
    • Freestyle Soccer
Re: Always having your board name in the title of your forum
« Reply #65 on: February 08, 2011, 03:15:23 PM »
i made it to prevent on the index to have the forum name twice:
Code: [Select]
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!

Offline Oldiesmann

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 24,868
  • Gender: Male
  • Ask me about the function DB :)
    • oldiesmann on Facebook
    • Oldiesmann on GitHub
    • https://www.linkedin.com/in/michaeleshom on LinkedIn
    • @oldiesmann on Twitter
    • Archie Comics Fan Forum
Re: Always having your board name in the title of your forum
« Reply #66 on: February 08, 2011, 04:16:32 PM »
There is nothing wrong with the code above. Where did you put it in your template file?
Michael Eshom
Cincy Space - now open!

Offline Coon

  • Jr. Member
  • **
  • Posts: 171
  • Gender: Male
  • Check out my forum if you like soccer!
    • Freestyle Soccer
Re: Always having your board name in the title of your forum
« Reply #67 on: February 14, 2011, 02:30:56 PM »
Same spot as instructed.  Weird... I wonder if it has to do with my PHP version?

Offline ammaar102

  • Newbie
  • *
  • Posts: 2
Re: Always having your board name in the title of your forum
« Reply #68 on: February 23, 2011, 12:08:34 AM »
I'm a newbie and do not know much about these things. I didn't really get these bit confused....     :o  :-[

Offline Dblog

  • Jr. Member
  • **
  • Posts: 153
  • Gender: Female
Re: Always having your board name in the title of your forum
« Reply #69 on: October 18, 2011, 10:09:59 AM »
how to add board/child board name in between topic title - and - forum title in 'page title'

Offline broker1

  • Newbie
  • *
  • Posts: 1
Re: Always having your board name in the title of your forum
« Reply #70 on: November 02, 2011, 08:29:35 AM »
this is nice this suitable for all