Simple Machines Community Forum

Customizing SMF => Tips and Tricks => Thema gestartet von: Burpee in April 25, 2005, 12:57:46 NACHMITTAGS

Titel: Always having your board name in the title of your forum
Beitrag von: Burpee in April 25, 2005, 12:57:46 NACHMITTAGS
I'm probably not the only one who has noticed this, but regular installs of SMF seem to often have an unclear title.
The title will be something along the lines of "Start new topic", or just the title of that particular thread.
Personally, I prefer seeing the title of my board in front of the topic title, to avoid confusion between different boards.
So, I'll show you the trick to doing that, right here.


Remember to ALWAYS make backups of the files you are modifying!


Open: index.template.php of the theme you are using.
If it's not there, Copy that file from SMF/Themes/default/languages/ to the languages directory of the theme you are using.

Find:
<title>', $context['page_title'], '</title>';

Replace with:
<title>', $context['forum_name'], ' - ', $context['page_title'], '</title>';


Custom board title
You've just added ', $context['forum_name'], ' - in front of your title, which is the name of your board. If you prefer having some other custom text there, this would be the place to put it.


The problem now is that the index of your forum is going to have something like "My community - My community - Index" as a title. This is easily fixed through the language files.

Copy: Forum/Themes/default/languages/index.*language*.php to the languages directory of the theme you are using, to avoid losing these modifications when updating.

Open: index.*language*.php

Find:
$txt[18] = $context['forum_name'] . ' -

Remove: $context['forum_name'] . ' -

Now, if everything went well, the name of your forum should be visible in the title on every page of your forum, and the title of your boardindex should be a single title :).
Titel: Re: Always having your board name in the title of your forum
Beitrag von: wiebke in April 29, 2005, 05:45:53 VORMITTAG
thanks a lot!
Titel: Re: Always having your board name in the title of your forum
Beitrag von: [Unknown] in April 29, 2005, 11:16:13 VORMITTAG
Why not just add it in the front of the <title> element in the index template?

-[Unknown]
Titel: Re: Always having your board name in the title of your forum
Beitrag von: Burpee in Mai 01, 2005, 03:12:19 NACHMITTAGS
I did :P
Titel: Re: Always having your board name in the title of your forum
Beitrag von: [Unknown] in Mai 01, 2005, 07:09:19 NACHMITTAGS
I read the bottom part and didn't see why you wanted to mess with the language strings... never mind, I suppose.  Not sleeping enough.

-[Unknown]
Titel: Re: Always having your board name in the title of your forum
Beitrag von: dtm.exe in Mai 01, 2005, 10:16:28 NACHMITTAGS
That was exactly what I needed for my forums :).  One Problem: on the index page of my forums, the title is OI Forums - OI Forums.  How can that be fixed, or can it?

-Dan The Man
Titel: Re: Always having your board name in the title of your forum
Beitrag von: Burpee in Mai 02, 2005, 07:43:07 VORMITTAG
lol
Read the second part of the post :D
Titel: Re: Always having your board name in the title of your forum
Beitrag von: dtm.exe in Mai 03, 2005, 01:08:14 VORMITTAG
Zitat von: Burpee in Mai 02, 2005, 07:43:07 VORMITTAG
lol
Read the second part of the post :D

D'oh!  I'm sorry.  I didn't even see that there.  I feel like such a n00b :P.  Thank you.

-Dan The Man
Titel: Re: Always having your board name in the title of your forum
Beitrag von: dtm.exe in Mai 04, 2005, 12:58:02 VORMITTAG
ZitatOpen: index.*language*.php

The SMFOne theme doesn't include that file :-\.  So that file's not there, which file should I edit?

-Dan The Man
Titel: Re: Always having your board name in the title of your forum
Beitrag von: Kirby in Mai 04, 2005, 12:59:29 VORMITTAG
Copy over index.english.php from Themes/default/languages to Themes/<smf one directory>/languages and edit that :)
Titel: Re: Always having your board name in the title of your forum
Beitrag von: dtm.exe in Mai 04, 2005, 01:01:17 VORMITTAG
Zitat von: Kirby in Mai 04, 2005, 12:59:29 VORMITTAG
Copy over index.english.php from Themes/default/languages to Themes/<smf one directory>/languages and edit that :)

Oh is that what it was telling me to do?  This is the second time I've made myself look like a complete n00b in ONE THREAD :P.  Sorry about that.  Thanks.

-Dan The Man
Titel: Re: Always having your board name in the title of your forum
Beitrag von: Burpee in Mai 04, 2005, 07:34:53 VORMITTAG
Don't worry, the second time was my fault for not explaining it properly :)
Titel: Re: Always having your board name in the title of your forum
Beitrag von: anunlike in Juni 26, 2005, 06:29:44 VORMITTAG
I just tried this today. I followed these steps and used
', $context['forum_name'] , ':
but, on my board index page (the homepage), I get
ZitatAUW FORUMS:

I'm hoping for
ZitatAUW FORUMS

Did I not do this correctly or is the ':' supposed to show up?

Thanks much.
Titel: Re: Always having your board name in the title of your forum
Beitrag von: Tristan Perry in Juni 26, 2005, 06:36:47 VORMITTAG
Zitat von: anunlike in Juni 26, 2005, 06:29:44 VORMITTAG
I just tried this today. I followed these steps and used
', $context['forum_name'] , ':
but, on my board index page (the homepage), I get
ZitatAUW FORUMS:

I'm hoping for
ZitatAUW FORUMS

Did I not do this correctly or is the ':' supposed to show up?

Thanks much.
To remove the colan, use the following:

', $context['forum_name'] , '
Titel: Re: Always having your board name in the title of your forum
Beitrag von: anunlike in Juni 26, 2005, 01:12:08 NACHMITTAGS
Thanks. Yes, I understand that, I should've clarified. However, I want the colon to show up whenever I'm on any page other than the board index page. In this instance, I'm using it to replace the ' - (dash) '. But, It still shows up on my board index page. I'm wondering if it's possible using this method (or something similar) to keep it for all the other forums pages but not have it show on the board index page.

I suppose I'm just overlooking something.
Titel: Re: Always having your board name in the title of your forum
Beitrag von: Isaac in Juni 28, 2005, 05:58:05 NACHMITTAGS
Wow, this code totally torched my index.template.php file. :(
Titel: Re: Always having your board name in the title of your forum
Beitrag von: dtm.exe in Juni 28, 2005, 06:07:30 NACHMITTAGS
Zitat von: Isaac in Juni 28, 2005, 05:58:05 NACHMITTAGS
Wow, this code totally torched my index.template.php file. :(

Worked fine for me...

-Dan The Man
Titel: Re: Always having your board name in the title of your forum
Beitrag von: Burpee in Juni 28, 2005, 07:53:47 NACHMITTAGS
Zitat von: Isaac in Juni 28, 2005, 05:58:05 NACHMITTAGS
Wow, this code totally torched my index.template.php file. :(

I really can't imagine how...
Titel: Re: Always having your board name in the title of your forum
Beitrag von: Burpee in Juni 28, 2005, 07:55:35 NACHMITTAGS
Zitat von: anunlike in Juni 26, 2005, 01:12:08 NACHMITTAGS
Thanks. Yes, I understand that, I should've clarified. However, I want the colon to show up whenever I'm on any page other than the board index page. In this instance, I'm using it to replace the ' - (dash) '. But, It still shows up on my board index page. I'm wondering if it's possible using this method (or something similar) to keep it for all the other forums pages but not have it show on the board index page.

I suppose I'm just overlooking something.

Seems to me like you already fixed it on your forum? I do believe it makes more sense to lable the front page with something like "Home" or "Index" as well.
Titel: Re: Always having your board name in the title of your forum
Beitrag von: anunlike in Juni 28, 2005, 08:32:11 NACHMITTAGS
Yes, I just decided to put the "HOME" after the forum title. But, I was trying not to have the "HOME" (or anything else) after it. The problem wasn't getting something after the colon, it was trying to use this method and not having anything after the forum title, which I don't think I can do, as the colon will always be there. But, it's a great way of doing this.
Titel: Re: Always having your board name in the title of your forum
Beitrag von: modtang in September 04, 2005, 08:23:09 NACHMITTAGS
Zitat von: Burpee in April 25, 2005, 12:57:46 NACHMITTAGS
The problem now is that the index of your forum is going to have something like "My community - My community - Index" as a title. This is easily fixed through the language files.
Anyone else using SimplePortal? I'm getting MY COMMUNITY - MY COMMUNITY and I can't seem to fix it. Any suggestions?

Other than that this works great. Thanks a bunch. :)
Titel: Re: Always having your board name in the title of your forum
Beitrag von: grandslam in Februar 18, 2006, 05:27:23 NACHMITTAGS
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>';

Titel: Re: Always having your board name in the title of your forum
Beitrag von: MKava in März 11, 2007, 12:20:09 VORMITTAG
This works excellent. This was one of the few things that I disliked about SMF forums and so glad to have it fixed. Thanks! :D
Titel: Re: Always having your board name in the title of your forum
Beitrag von: heavyccasey in August 03, 2007, 11:34:05 NACHMITTAGS
This is what I use:

if (! ereg($context['forum_name'], $context['page_title']))
$context['page_title'] = $context['forum_name']. ' - ' . $context['page_title'];
Titel: Re: Always having your board name in the title of your forum
Beitrag von: Aileen in November 26, 2007, 05:54:56 VORMITTAG
I tried using a keyword. This one is good for SEO
Titel: Re: Always having your board name in the title of your forum
Beitrag von: Drover in April 15, 2008, 06:18:07 NACHMITTAGS
First part went fine but my theme doesn't seem to have anything at all called "languages" or anything close...ideas?  I'm using the 1.Snake.1 theme.  :(
Titel: Re: Always having your board name in the title of your forum
Beitrag von: miamizx in April 23, 2008, 03:13:31 NACHMITTAGS
Does anyone know how to remove the extra title in the TinyPortal index page? this is the only thing that I can't figure out...
Titel: Re: Always having your board name in the title of your forum
Beitrag von: Mac_Hines in Juni 02, 2008, 11:58:26 VORMITTAG
Is there no control panel function for changing the name of your community after the initial set up?  Please forgive my extreme newbie-ness but I couldn't find this info anywhere (even though it's probably in a very obvious place). 

Apologies if this is posted in the wrong place.
Titel: Re: Always having your board name in the title of your forum
Beitrag von: b33z in Juni 04, 2008, 08:49:09 NACHMITTAGS
nice. thanks for this.
Titel: Re: Always having your board name in the title of your forum
Beitrag von: Bulakbol in Juni 05, 2008, 03:38:00 VORMITTAG
Zitat von: Mac_Hines in Juni 02, 2008, 11:58:26 VORMITTAG
Is there no control panel function for changing the name of your community after the initial set up?  Please forgive my extreme newbie-ness but I couldn't find this info anywhere (even though it's probably in a very obvious place). 

Apologies if this is posted in the wrong place.

Go to Admin -> Server Settings -> Core Configuration. Replace whatever is in "Forum Title" text box.
Titel: Re: Always having your board name in the title of your forum
Beitrag von: Mac_Hines in Juni 06, 2008, 03:12:33 NACHMITTAGS
Zitat von: JohnyB in Juni 05, 2008, 03:38:00 VORMITTAG

Go to Admin -> Server Settings -> Core Configuration. Replace whatever is in "Forum Title" text box.

Thanks JohnyB.  It was right where you said it would be!
Titel: Re: Always having your board name in the title of your forum
Beitrag von: TigerTails in Juni 06, 2008, 05:03:50 NACHMITTAGS
Quick hack-it-up for people who have long forum names that could be shortened, like mine ("Unseen Britain - Urban Exploration Community")

That was far too big to have on the front of every tab, and looked terrible.

So, I set "Urban Exploration Community" as my forum title in server options, and in index.template changed title to:
  <title>Unseen Britain - ', $context['page_title'], '</title>';

On the index it shows the usual "Unseen Britain - Urban Exploration Community", and for all other pages it shows "Unseen Britain - <Page name>". EG: "Unseen Britain - Read first"

Hope some of you can make some use of it :).
Titel: Re: Always having your board name in the title of your forum
Beitrag von: Bulakbol in Juni 06, 2008, 07:30:10 NACHMITTAGS
You're welcome Mac_Hines. Glad I am of help.

Thank you Tiger Tails for your tip. I am sure it will help other members of our community.
Titel: Re: Always having your board name in the title of your forum
Beitrag von: Deal in August 19, 2008, 01:20:02 NACHMITTAGS
I think if I knew the right word for this I would be able to find my answer elsewhere. This is as close to the subject as I found.

I like how the SMF forum displays a small avatar in the browser page name. Mine has the default browser avatar. I would like to add my own small image followed by my sitename (which this post details)
Titel: Re: Always having your board name in the title of your forum
Beitrag von: Bulakbol in August 19, 2008, 09:42:20 NACHMITTAGS
Are you asking for favicon? We have mods.

http://custom.simplemachines.org/mods/index.php?mod=702
and
http://custom.simplemachines.org/mods/index.php?mod=1329

Titel: Re: Always having your board name in the title of your forum
Beitrag von: ccbtimewiz in August 19, 2008, 10:56:14 NACHMITTAGS
Likewise, you can follow the guide I made too.

http://www.simplemachines.org/community/index.php?topic=236748.0
Titel: Re: Always having your board name in the title of your forum
Beitrag von: jepot5 in August 20, 2008, 04:05:59 VORMITTAG
Hi
how do I fix this so whenever i go to someone's profile, I will see this

{Custom text I inputed} - Viewing Profile: {Display name}
Titel: Re: Always having your board name in the title of your forum
Beitrag von: ccbtimewiz in August 20, 2008, 10:21:13 VORMITTAG
Zitat von: jepot5 in August 20, 2008, 04:05:59 VORMITTAG
Hi
how do I fix this so whenever i go to someone's profile, I will see this

{Custom text I inputed} - Viewing Profile: {Display name}

Open profile.php

Find:
// Set the page title if it's not already set...
if (!isset($context['page_title']))
$context['page_title'] = $txt['profile'] . ' - ' . $txt[$_REQUEST['sa']];


Replace with:
// Set the page title if it's not already set...
if (!isset($context['page_title']))
$context['page_title'] = 'Text you want to show '.$txt['profile'] . ' - ' . $txt[$_REQUEST['sa']];
Titel: Re: Always having your board name in the title of your forum
Beitrag von: Deal in August 20, 2008, 12:29:25 NACHMITTAGS
Zitat von: JohnyB in August 19, 2008, 09:42:20 NACHMITTAGS
Are you asking for favicon? We have mods.

http://custom.simplemachines.org/mods/index.php?mod=702
and
http://custom.simplemachines.org/mods/index.php?mod=1329

Thank you - Yes exactly what I was looking for and the KarlBenson mod worked great.

Titel: Re: Always having your board name in the title of your forum
Beitrag von: Deal in August 21, 2008, 07:22:48 NACHMITTAGS
I wonder if someone would be so kind as to assist me with a problem I am having trying to implement either of the solutions for implementing this change by modifying index_template.php  (the babylon theme)

I tried replacing line:

<title>', $context['page_title'], '</title>';

with grandslams mod, and then with Caseys mod and both resulted in a parsing error. I even compared (using notepad++) the resulting source of the file to ensure that that is the only mod to the file. I used the 1.1.5 babylon theme source as the master file.

Where did I go wrong here? Thanks.

Deal

The error I get is:

Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in .../Themes/babylon/index.template.php on line 81

line 81 is either of the revised lines selected and pasted from this post.





Titel: Re: Always having your board name in the title of your forum
Beitrag von: jepot5 in August 22, 2008, 01:00:57 VORMITTAG
Zitat von: modtang in September 04, 2005, 08:23:09 NACHMITTAGS
Zitat von: Burpee in April 25, 2005, 12:57:46 NACHMITTAGS
The problem now is that the index of your forum is going to have something like "My community - My community - Index" as a title. This is easily fixed through the language files.
Anyone else using SimplePortal? I'm getting MY COMMUNITY - MY COMMUNITY and I can't seem to fix it. Any suggestions?

Other than that this works great. Thanks a bunch. :)

in Sources/TPortal.php, find:
$context['page_title'] =

remove
$context['forum_name']

replace with your own
Titel: Re: Always having your board name in the title of your forum
Beitrag von: jepot5 in August 22, 2008, 01:16:39 VORMITTAG
Zitat von: ccbtimewiz in August 20, 2008, 10:21:13 VORMITTAG
Zitat von: jepot5 in August 20, 2008, 04:05:59 VORMITTAG
Hi
how do I fix this so whenever i go to someone's profile, I will see this

{Custom text I inputed} - Viewing Profile: {Display name}

Open profile.php

Find:
// Set the page title if it's not already set...
if (!isset($context['page_title']))
$context['page_title'] = $txt['profile'] . ' - ' . $txt[$_REQUEST['sa']];


Replace with:
// Set the page title if it's not already set...
if (!isset($context['page_title']))
$context['page_title'] = 'Text you want to show '.$txt['profile'] . ' - ' . $txt[$_REQUEST['sa']];


thanks for the help, but not working,

i think the profile pages integrate with tinyportal as when i did the editing for tinyportal (see above post) it also shows the same title when viewing profiles only

and also help me fix
My Community - My Community: Calendar (The first phrase is what I entered and I want to remove "My Community:")
Titel: Re: Always having your board name in the title of your forum
Beitrag von: serge06 in August 27, 2008, 01:07:07 VORMITTAG
Any way to have the title show:
Board Name - Forum Category - Post Title

for even better SEO
Thanks
Titel: Re: Always having your board name in the title of your forum
Beitrag von: krick in August 27, 2008, 02:05:24 VORMITTAG
I'm using this...


$context['page_title'] = $context['linktree'][0]['name']. ' - ' .
                                      $context['linktree'][1]['name']. ' - ' .
                                      $context['linktree'][2]['name']. ' - ' .
                                      $context['linktree'][3]['name'];


To get...

forum title - category - board name - topic

...as my page title.

The only problem is that when I'm at higher levels of the hierarchy, I get extra dashes.  I need to add code to omit the empty elements.
Titel: Re: Always having your board name in the title of your forum
Beitrag von: Paracelsus in August 27, 2008, 04:33:51 VORMITTAG
Since I didn't like to put "Home" or "Index" in the first page, my solution was:

In index.template.php put a "short version" of the board name + page title:
<title>F&oacute;rum SCP - ', $context['page_title'], '</title>';

In index."language".php put the trimmed part to have the "long version" of the board name, since this is shown just in Home or Index page:
$txt[18] = 'A Comunidade do Sporting Clube de Portugal';

So in sum, except for Index page where we have the full forum title, every other page show "Fórum SCP - Page Title".
Titel: Re: Always having your board name in the title of your forum
Beitrag von: Sabby72 in August 30, 2008, 04:37:08 NACHMITTAGS
Could Someone please tell me if I did something wrong. I don't think I did, but the title now shows up as - - Index, whereas it used to show up as - Index. I obviously missed something, as it didn't change to show the forum name.

Here's what I replaced:
Index.template.php on line 79:
<title>', $context['forum_name'], ' - ', $context['page_title'], '</title>';

index.english.php on line 36:
$txt[18] = 'Index';

Thanks. As you can see, I'm somewhat new to php.

Titel: Re: Always having your board name in the title of your forum
Beitrag von: sabby in September 11, 2008, 10:47:48 NACHMITTAGS
I give up. I've tried this at least a dozen times now and it never works.
Titel: Re: Always having your board name in the title of your forum
Beitrag von: Paracelsus in September 12, 2008, 06:55:21 VORMITTAG
Zitat von: Sabby72 in August 30, 2008, 04:37:08 NACHMITTAGS
Could Someone please tell me if I did something wrong. I don't think I did, but the title now shows up as - - Index, whereas it used to show up as - Index. I obviously missed something, as it didn't change to show the forum name.

Here's what I replaced:
Index.template.php on line 79:
<title>', $context['forum_name'], ' - ', $context['page_title'], '</title>';

index.english.php on line 36:
$txt[18] = 'Index';

Thanks. As you can see, I'm somewhat new to php.



It probably means that in Boardindex.php in Sources - I think it's this file that uses $txt[18], you have most likely something weird before $txt[18] that gives - - before the Index word the whole time.
Titel: Re: Always having your board name in the title of your forum
Beitrag von: krick in September 15, 2008, 05:43:15 NACHMITTAGS
Sabby, undo your other changes, and then add this to index.template.php ....
(just the new code part between the begin/end comments)



function template_main_above()
{
global $context, $settings, $options, $scripturl, $txt, $modSettings;

// -- begin build better page title --
$tboard = $context['linktree'][2]['name'];
$tboard = empty($tboard)?'':' - '.$tboard;
$ttopic = $context['linktree'][3]['name'];
$ttopic = empty($ttopic)?'':' - '.$ttopic;
if (! ereg($context['forum_name'], $context['page_title']))
$context['page_title'] = $context['linktree'][0]['name'].$tboard.$ttopic;
// -- end build better page title --
Titel: Re: Always having your board name in the title of your forum
Beitrag von: krick in September 26, 2008, 04:45:17 NACHMITTAGS
For some reason, the code in my last post generates errors in the log.

This version of the code doesn't.  Am I missing something subtle about the PHP syntax?


$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;
Titel: Re: Always having your board name in the title of your forum
Beitrag von: SleePy in Oktober 23, 2008, 06:56:08 NACHMITTAGS
It would be helpful to know the php error.
Titel: Re: Always having your board name in the title of your forum
Beitrag von: minos in Januar 05, 2009, 01:21:37 NACHMITTAGS
hi .. i delete  $txt[18] = $context['forum_name'] . ' - &Iacute;ndice';

from my index english and spanish  index but does not work
Titel: Re: Always having your board name in the title of your forum
Beitrag von: studentforums in August 16, 2009, 07:13:42 VORMITTAG
I want the page number of the topic to display in the title. I understand I have to modify Sources/Display.php among others.

These two lines from Display.php are where I think the problems are

   censorText($topicinfo['subject']);
   $context['page_title'] = $topicinfo['subject'] . " - " . $txt['page'] . $context['page_info']['current_page'];

There is another piece of code in Sources/Messageindex.php which does the smes thing for the boards.

     // 'Print' the header and board info.   
     $context['page_title'] = strip_tags($board_info['name'] . " - " . $txt['page'] . $context['page_info']['current_page']);

Why does the second piece of code display the page number but not the first?
Titel: Re: Always having your board name in the title of your forum
Beitrag von: Arantor in August 16, 2009, 07:37:14 VORMITTAG
Likely you'll see an error in the error log for an undefined index for $context['page_info']['current_page'] in the first case; it's built differently from what I remember of it.
Titel: Re: Always having your board name in the title of your forum
Beitrag von: thischarmingmanc in August 17, 2009, 11:38:50 VORMITTAG
The whole concept is  very bad for SEO the SMF guys knew what they were doing.

to add the same word for verey page on your site, dilutes your unique content, thus making every page on your site less search engine friendly. 

Zitat von: Aileen in November 26, 2007, 05:54:56 VORMITTAG
I tried using a keyword. This one is good for SEO
Titel: Re: Always having your board name in the title of your forum
Beitrag von: Arantor in August 17, 2009, 12:52:57 NACHMITTAGS
Zitat von: thischarmingmanc in August 17, 2009, 11:38:50 VORMITTAG
The whole concept is  very bad for SEO the SMF guys knew what they were doing.

to add the same word for verey page on your site, dilutes your unique content, thus making every page on your site less search engine friendly.

Not if it's the site name or contains a unique keyword that is relevant to the site.
Titel: Re: Always having your board name in the title of your forum
Beitrag von: Shark-Time in August 17, 2009, 02:25:57 NACHMITTAGS
very nice will try it soon..
Titel: Re: Always having your board name in the title of your forum
Beitrag von: studentforums in August 24, 2009, 09:16:53 VORMITTAG
Ok I think the title is to my satisfaction apart from my quibbles in my last post.
Titel: Re: Always having your board name in the title of your forum
Beitrag von: heavyccasey in August 24, 2009, 05:55:41 NACHMITTAGS
Another solution is to use a Favicon.
Titel: Re: Always having your board name in the title of your forum
Beitrag von: Shark-Time in September 12, 2009, 09:33:11 VORMITTAG
nice sharing thanks mate...
Titel: Re: Always having your board name in the title of your forum
Beitrag von: Matthew K. in September 12, 2009, 03:10:45 NACHMITTAGS
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!
Titel: Re: Always having your board name in the title of your forum
Beitrag von: Arantor in Oktober 10, 2009, 08:17:21 VORMITTAG
On the very front page or somewhere else?

And is that for SMF 1.1 or 2.0?
Titel: Re: Always having your board name in the title of your forum
Beitrag von: flickernever in Dezember 07, 2009, 04:16:23 NACHMITTAGS
  $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?
Titel: Re: Always having your board name in the title of your forum
Beitrag von: ShowMeYourStyle in Januar 03, 2010, 01:20:11 NACHMITTAGS
Hi guys,

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

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
Titel: Re: Always having your board name in the title of your forum
Beitrag von: krick in Juli 01, 2010, 06:01:09 NACHMITTAGS
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;


Titel: Re: Always having your board name in the title of your forum
Beitrag von: Coon in Februar 08, 2011, 03:15:23 NACHMITTAGS
Zitat von: grandslam in Februar 18, 2006, 05:27:23 NACHMITTAGS
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!
Titel: Re: Always having your board name in the title of your forum
Beitrag von: Oldiesmann in Februar 08, 2011, 04:16:32 NACHMITTAGS
There is nothing wrong with the code above. Where did you put it in your template file?
Titel: Re: Always having your board name in the title of your forum
Beitrag von: Coon in Februar 14, 2011, 02:30:56 NACHMITTAGS
Same spot as instructed.  Weird... I wonder if it has to do with my PHP version?
Titel: Re: Always having your board name in the title of your forum
Beitrag von: ammaar102 in Februar 23, 2011, 12:08:34 VORMITTAG
I'm a newbie and do not know much about these things. I didn't really get these bit confused....     :o  :-[
Titel: Re: Always having your board name in the title of your forum
Beitrag von: Dblog in Oktober 18, 2011, 10:09:59 VORMITTAG
how to add board/child board name in between topic title - and - forum title in 'page title'