One of the first modifications I made to TWB's installation of PHP Fusion was to modify the HTML title tag. The default installation displays the name of your site (defined in the admin site settings) on all pages. Before applying the mod this article would have displayed The Webmaster's Bureau in the browser title bar now it reads: Page Title Optimisation - The Webmaster's Bureau.
This article is only intended to share the code that was used to make the modifications, rather than argue the case for search engine optimisation.
NB: This modification has been superceded by the SEO Tags Mod (for users of v6.01.x).
Step 1: Download the code for pagetitle_include.php from the CVS Browser (click the disk).
Step 2: Upload pagetitle_include.php to the includes directory of your installation.
Step 3: Make a backup copy of subheader.php.
Step 4: Open subheader.php and find:
if (iMEMBER) $result = dbquery("UPDATE ".$db_prefix."users SET user_lastvisit='".time()."', user_ip='".USER_IP."' WHERE user_id='".$userdata['user_id']."'");
Immediately after, add:
require_once INCLUDES."pagetitle_include.php";
$page_title = page_title($article_id,$cat_id,$readmore,$forum_id,$thread_id,$db_prefix);
Step 5: Also in subheader.php find:
<title>".$settings['sitename']."</title>
and replace with:
<title>".$page_title.$settings['sitename']."</title>
Step 6: Save subheader.php
Step 7: Check your site to make sure all is working as it should be.
|