Page 1 of 1

PhpBB3 SEO Title

Posted: 26 Jul 2011, 23:00
by Stoker
Title: PhpBB3 SEO Title
Version: 1.0.0 RC
PhpBB Version: 3.0.5 & 3.0.6 & 3.0.7
Demo: This board
Author: Greenweaver Revison by Stoker
Description: This mod is based on the Page Title Number MOD by Greenweaver (for pagination of titles) This will prevent search engines to see topics with several pages as dublicate content. It will also make the titles much more userfriendly.
How ever I feel that some improvements easily can be done.

This mod does two things. We are taking out the sitename in the titles and paginating topics and forums with page numbers.
Both are great for SEO.

Before doing this mod our titles will look like this:
Viewing a forum: PhpBB3 BBCodes · View forum - Announcements & News
Viewing a topic: PhpBB3 BBCodes · View forum - SEO Simple

After doing this mod our titles will look like this:
Viewing a forum: Announcements & News (if multiple pages: Page 2)
Viewing a topic: SEO Simple · snippets (if multiple pages: Page 2)

We dont want the "Site name" of the board, or the "View forum -" and "View topic -" to appear in the titles.
They dont have anything to do there.


Open language/en/common.php
Find:

Code: Select all

'INDEX'						=> 'Index page',
Replace with:

Code: Select all

'INDEX'			=> 'Name of your board',
Notes: Replace "Name of your board" with the name of your board. In my case it is PhpBB3 BBCodes.

Find:

Code: Select all

?>
Before add:

Code: Select all

// Page Title Number MOD
$lang = array_merge($lang, array(
	'TITLE_PAGE_NUMBER'	=> 'Page %s',
));
Open viewforum.php
Find:

Code: Select all

page_header($user->lang['VIEW_FORUM'] . ' - ' . $forum_data['forum_name'], true, $forum_id);
Replace with:

Code: Select all

page_header($forum_data['forum_name'] . ($start ? ' - ' . sprintf($user->lang['TITLE_PAGE_NUMBER'], floor($start / $config['topics_per_page']) + 1) : ''), true, $forum_id);
Open viewtopic.php
Find:

Code: Select all

page_header($user->lang['VIEW_TOPIC'] . ' - ' . $topic_data['topic_title'], true, $forum_id);
Replace with:

Code: Select all

page_header($topic_data['topic_title'] . ($start ? ' - ' . sprintf($user->lang['TITLE_PAGE_NUMBER'], floor($start / $config['posts_per_page']) + 1) : ''), true, $forum_id);
Open styles/your_style/template/overall_header.html
Note: This is the same for both prosilver and subsilver2
Find:

Code: Select all

<title>{SITENAME} &bull; <!-- IF S_IN_MCP -->{L_MCP} &bull; <!-- ELSEIF S_IN_UCP -->{L_UCP} &bull; <!-- ENDIF -->{PAGE_TITLE}</title>
Replace with:

Code: Select all

<title><!-- IF S_IN_MCP -->{L_MCP} &bull; {PAGE_TITLE}<!-- ELSEIF S_IN_UCP -->{L_UCP} &bull; {PAGE_TITLE}<!-- ELSEIF SCRIPT_NAME == "viewtopic" -->{PAGE_TITLE} - {FORUM_NAME}<!-- ELSEIF SCRIPT_NAME == "viewforum" -->{FORUM_NAME}<!-- ELSE -->{PAGE_TITLE}<!-- ENDIF --></title>
Purge cache and refresh templates.

PhpBB3 SEO Title

Posted: 27 Dec 2011, 05:51
by Blackwolf
Will doing the overall_header tweaks mess up the tweaks done in the Topic SEO description and keywords mod :-?

PhpBB3 SEO Title

Posted: 27 Dec 2011, 09:17
by Stoker
Yes, the edits will conflict.

PhpBB3 SEO Title

Posted: 27 Dec 2011, 09:27
by Blackwolf
Stoker wrote:Yes, the edits will conflict.
Thanks... :thumb:

The other edits will be okay though?

PhpBB3 SEO Title

Posted: 27 Dec 2011, 10:54
by Stoker
Shoul be, but you have to test it.
I dont use the topoc seo mod.