MyBB Community Forums

Full Version: Duplied Title names
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello, i was checking today at Google analytics and i saw that i have 1.500 duplied metatitles

Quote:beatDJ.net - DJMAX
Ir a URL/foros/Forum-DJMAX
Ir a URL/foros/Forum-DJMAX?page=2
Ir a URL/foros/Forum-DJMAX?page=3

so i wanted to make that instead of forum and forum name
it shows the same but + the page number

like
Quote:beatDJ.net - DJMAX - page 2

i checked in forum display template

Quote:<html>
<head>
<title>{$mybb->settings['bbname']} - {$foruminfo['name']} </title>

Is there a command for page number like
{$pagenumber}

Thanks in advance
Well, you could try $page, but... it's not necessarily set, and could be 0 or 1 or an XSS injection for all you know. A code modification would be better, it's what I do in my forums. I've been meaning to incorporate this in the Google SEO plugin somehow but haven't gotten around to it yet. It doesn't really fit in any of the existing categories of the plugin...

Basically what you need is:

if(intval($page) > 1)
{
    $page = intval($page);
    $pagenumber = " - Page {$page}";
}

before the forumdisplay / showthread template is evaluated (before the eval("\$showthread = line).

then you can set <title>whatever{$pagenumber}</title> in the showthread template and it will append - Page X for page 2 onwards
thanks it worked perfectly.
i wonder how can i apply this for viewforum pages too, apart from showthread
exactly the same way

before eval("\$forums = \"".$templates->get("forumdisplay")."\";");
Big Grin yeah it was kinda hard to find the eval code
but i've done it Big Grin
Thank you so much frostschutz!