Hi Jim,
I hope you have been well
There are two ways to go about it, the first way is just using template conditionals and only using the page title for certain major areas, such as showthread.php and forumdisplay.php. The drawback would be that some pages, such as reporting bad posts, retrieving lost passwords, editing polls, etc are overlooked, as conditionaling them would make the statement very lengthy (since there are over 40 different page titles). The second one would be a 1:1 match of the actual page title, at the cost of a little processing power. It's a plugin that parses the the html output during print_output() for the actual content of the <title> tag.
The first way:
If your code is in the template 'header', then replace:
HTML Code:
<h1>$vboptions[bbtitle]</h1>
With:
HTML Code:
<h1>
<if condition="THIS_SCRIPT == 'showthread'">
$threadinfo[title]<if condition="$pagenumber>1"> - <phrase 1="$pagenumber">$vbphrase[page_x]</phrase></if> - $vboptions[bbtitle]
<else />
<if condition="THIS_SCRIPT == 'forumdisplay'">
$foruminfo[title_clean]<if condition="$pagenumber>1"> - <phrase 1="$pagenumber">$vbphrase[page_x]</phrase></if> - $vboptions[bbtitle]
<else />
<phrase 1="$vboptions[bbtitle]">$vbphrase[x_powered_by_vbulletin]</phrase>
</if>
</if>
</h1>
As you can see, the conditionals are only going to grow as you add more pages. There are some pages where you can't even do this, since the header template is parsed before the actual page title is set. (As for example the User Control Panel)
If your code is in the template 'navbar', then replace:
HTML Code:
<h1>$vboptions[bbtitle]</h1>
With:
HTML Code:
<h1>
<if condition="THIS_SCRIPT == 'showthread'">
$threadinfo[title]<if condition="$pagenumber>1"> - <phrase 1="$pagenumber">$vbphrase[page_x]</phrase></if> - $vboptions[bbtitle]
<else />
<if condition="THIS_SCRIPT == 'forumdisplay'">
$foruminfo[title_clean]<if condition="$pagenumber>1"> - <phrase 1="$pagenumber">$vbphrase[page_x]</phrase></if> - $vboptions[bbtitle]
<else />
<if condition="$pagetitle">
$vboptions[bbtitle] - $pagetitle
<else />
<phrase 1="$vboptions[bbtitle]">$vbphrase[x_powered_by_vbulletin]</phrase>
</if>
</if>
</if>
</h1>
That will also work for the User Control Panel. However, adding conditionals for every template would be far too long to be sensible.
The second way:
Add the following plugin:
Product: vBulletin
Hook Location: global_complete
Title: Displaying the page title inside templates
Execution Order: 5
Plugin PHP Code:
PHP Code:
preg_match("#<title>([^<]*)</title>#i", $output, $matches);
$output = str_replace('<!--HTML_PAGE_TITLE-->', $matches[1], $output);
Plugin is Active: Yes
And then inside your template, replace:
HTML Code:
<h1>$vboptions[bbtitle]</h1>
With:
HTML Code:
<h1><!--HTML_PAGE_TITLE--></h1>
That will work for all pages, and even all custom mods (as long as they using the standard print_output() vbulletin function).
Hope that helps