Switch Order of Page Titles

Snitz™ Forums 2000
https://forum.snitz.com/forumTopic/Posts/64912?pagenum=1
05 November 2025, 05:22

Topic


bobby131313
Switch Order of Page Titles
03 June 2007, 14:22


Tested only on version 3.04.05.
Since the page title is still very important in SEO and most search engines only look at the first 60-65 characters I decided to switch the order of my page titles for forums and topics.
Default setup is Forum Name (set in admin panel) then either the Topic Title or the Forum Title depending on the page. So if you have a long forum name and a long Topic Title or Forum Title, part of the Topic Title or Forum Title will be cut off in the page title (as far as SE's go). I would rather have the forum name cut off on the long ones. Your opinion may vary.
So here's how to change it....
Open inc_func_common.asp...
To change Topic Page Titles
Find:

Code:
Code:

					if intShowTopicTitle = 1 then strTempTopicTitle = " - " & chkString(ttopics("T_SUBJECT"),"display")
set ttopics = nothing
strNewTitle = strForumTitle & strTempTopicTitle


Replace it with:

Code:
Code:

					if intShowTopicTitle = 1 then strTempTopicTitle = chkString(ttopics("T_SUBJECT"),"display") & " - "
set ttopics = nothing
strNewTitle = strTempTopicTitle & strForumTitle

To change Forum Page Titles
Find:

Code:
Code:

					strNewTitle = strForumTitle & " - " & strTempForumTitle

Replace it with:

Code:
Code:

					strNewTitle = strTempForumTitle & " - " & strForumTitle

Very simple, always make backups!
<

 

Replies ...


Etymon
04 June 2007, 06:55


Thank you! smile<
bobby131313
04 June 2007, 11:50




You're welcome.wink
My first mod, simple though it may be. clown
<
Etymon
04 June 2007, 13:14


Gotta take the plunge at some point. bigsmile<
Lon2
19 February 2009, 19:09


Thank you for the code, bobby! [^]
Now if I can only figure out how to add page numbers to the Title Tag...<
leatherlips
13 March 2009, 19:35


I just did this to my forum. Very easy and nice feature! Thanks!
leatherlips
13 March 2009, 19:38


I also like how it shows the name of the topic on the tab of the browser as well as the button in the taskbar (windows) if the page is minimized. smile
leatherlips
13 March 2009, 20:07


I took mine a little further and changed the other forum pages too. If interested you can do this:

In inc_func_common.asp (3.4.06) look for:

Code:

      Case "members.asp"
strNewTitle = strForumTitle & " - Members"
Case "active.asp"
strNewTitle = strForumTitle & " - Active Topics"
Case "faq.asp"
strNewTitle = strForumTitle & " - Frequently Asked Questions"
Case "search.asp"
strNewTitle = strForumTitle & " - Search"
Case "pop_profile.asp"
if request.querystring("mode") = "display" then
strNewTitle = strForumTitle & " - View Profile"
elseif request.querystring("mode") = "edit" then
strNewTitle = strForumTitle & " - Edit Profile"
else
strNewTitle = strForumTitle & " - Profile"
end if
Case "register.asp"
strNewTitle = strForumTitle & " - User Agreement and Registration"
And replace it with this:

Code:

      Case "members.asp"
strNewTitle = "Members - " & strForumTitle
Case "active.asp"
strNewTitle = "Active Topics - " & strForumTitle
Case "faq.asp"
strNewTitle = "Frequently Asked Questions - " & strForumTitle
Case "search.asp"
strNewTitle = "Search - " & strForumTitle
Case "pop_profile.asp"
if request.querystring("mode") = "display" then
strNewTitle = "View Profile - " & strForumTitle
elseif request.querystring("mode") = "edit" then
strNewTitle = "Edit Profile - " & strForumTitle
else
strNewTitle = "Profile - " & strForumTitle
end if
Case "register.asp"
strNewTitle = "User Agreement and Registration - " strForumTitle
leatherlips
08 July 2009, 22:11


I'm not sure if it has anything to do with this mod, but I just noticed that if you click to go to the last thread of a reply, it shows the id number twice in the browser title and tab:


What needs to be changed to remove that?
leatherlips
17 July 2009, 14:14


Now I am getting the reply id three times in the browser header and tab!
[/img]
What is causing this?
Carefree
17 July 2009, 15:27


You must have a variable which isn't being reset, but is being regularly appended to.
leatherlips
17 July 2009, 19:46


Originally posted by Carefree
You must have a variable which isn't being reset, but is being regularly appended to.
What do I need to check and where? I'm not sure how to correct it. blush
Carefree
18 July 2009, 01:19


It will most likely be in "topic.asp". Post a link to that file in .txt format for us to review.
leatherlips
18 July 2009, 07:16


Originally posted by Carefree
It will most likely be in "topic.asp". Post a link to that file in .txt format for us to review.
Here it is. Thanks for looking! shy
Carefree
19 July 2009, 07:35


I didn't find it but I see that it's not displaying/duplicating topic IDs any longer. I guess all's well.
leatherlips
19 July 2009, 08:20


For me it is still duplicating the reply id's. I noticed it only does it in IE8.
If you click on the little blue arrow on the default.asp page () that is when it does it. If the arrow goes to the main topic it is fine. If the arrow goes to a reply, that is when I get the multiple id's in the address.
AnonJr
19 July 2009, 09:46


Maybe the problem is with the Jump to last post code?
© 2000-2021 Snitz™ Communications