Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Help Groups for Snitz Forums 2000 Users
 Help: MOD Implementation
 Add Page Number to Title Tag
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

Lon2
Junior Member

USA
151 Posts

Posted - 19 February 2009 :  12:58:51  Show Profile
Goal: Add page number to Title tag if more than one page exists.

File: inc_func_common.asp

- Function: Function GetNewTitle(strTempScriptName)
- - - Case: Case "topic.asp"

Affect: strForumTitle (forum wide)

Original Code:
Select Case strTempScript
		Case "topic.asp"
			strTempTopic = cLng(request.querystring("TOPIC_ID"))
			if strTempTopic <> 0 then
				strsql = "SELECT FORUM_ID, T_SUBJECT FROM " & strActivePrefix & "TOPICS WHERE TOPIC_ID=" & strTempTopic
				set ttopics = my_conn.execute(strsql)
				if ttopics.bof or ttopics.eof then
					GetNewTitle = strForumTitle
					set ttopics = nothing
				else
					if mLev = 4 then
						ForumChkSkipAllowed = 1
					elseif mLev = 3 then
						if chkForumModerator(ttopics("FORUM_ID"), ChkString(strDBNTUserName, "decode")) = "1" then
							ForumChkSkipAllowed = 1
						else
							ForumChkSkipAllowed = 0
						end if
					else
						ForumChkSkipAllowed = 0
					end if 
					intShowTopicTitle = 1
					if strPrivateForums = "1" and ForumChkSkipAllowed = 0 then
						if not(chkForumAccess(ttopics("FORUM_ID"),MemberID,false)) then
				    			intShowTopicTitle = 0
				  		end if
					end if
					if intShowTopicTitle = 1 then strTempTopicTitle = " - " & chkString(ttopics("T_SUBJECT"),"display")
					set ttopics = nothing
					strNewTitle = strForumTitle & strTempTopicTitle
				end if
			else
				GetNewTitle = strForumTitle
			end if
Modified Code:

Help?
<

garyrobar
New Member

Canada
90 Posts

Posted - 23 February 2009 :  20:39:47  Show Profile  Visit garyrobar's Homepage
F$%^& can't believe I missed that obvious one in my SEO list. Will add it later.

Try this one for size. Disclaimer: it's a quick and dirty, but will do the trick. Only tested quickly...implement with care. There are probably more elegant ways to do this.

Additions in red...


Case "topic.asp"

	SEO_pagination = request.querystring("whichpage")
	SEO_pagination = trim(SEO_pagination)
	
	if SEO_pagination = "" or isnull(SEO_pagination) then
		'---no pagination exists
	else
		if cLng(SEO_pagination) > 1 then
			TITLE_pagination = " - Page " & SEO_pagination
			'--any page greater than the 1st
		else
			TITLE_pagination = ""
			'--first page
		end if
	end if	
	
	strTempTopic = cLng(request.querystring("TOPIC_ID"))
	if strTempTopic <> 0 then
		strsql = "SELECT FORUM_ID, T_SUBJECT FROM " & strActivePrefix & "TOPICS WHERE TOPIC_ID=" & strTempTopic
		set ttopics = my_conn.execute(strsql)
		if ttopics.bof or ttopics.eof then
			GetNewTitle = strForumTitle
			set ttopics = nothing
		else
			if mLev = 4 then
				ForumChkSkipAllowed = 1
			elseif mLev = 3 then
				if chkForumModerator(ttopics("FORUM_ID"), ChkString(strDBNTUserName, "decode")) = "1" then
					ForumChkSkipAllowed = 1
				else
					ForumChkSkipAllowed = 0
				end if
			else
				ForumChkSkipAllowed = 0
			end if 
			intShowTopicTitle = 1
			if strPrivateForums = "1" and ForumChkSkipAllowed = 0 then
				if not(chkForumAccess(ttopics("FORUM_ID"),MemberID,false)) then
						intShowTopicTitle = 0
				end if
			end if
			if intShowTopicTitle = 1 then strTempTopicTitle = " - " & chkString(ttopics("T_SUBJECT"),"display")
			set ttopics = nothing
			strNewTitle = strForumTitle & strTempTopicTitle & TITLE_pagination
		end if
	else
		GetNewTitle = strForumTitle
	end if



SEO For Snitz Forum

Edited by - garyrobar on 28 February 2009 11:30:51
Go to Top of Page

Andy Humm
Average Member

United Kingdom
908 Posts

Posted - 09 July 2009 :  18:14:03  Show Profile
As an observation, I have noticed the pagination only shows when the administrator is logged in, i.e. Mlev=4
Could the & TITLE_pagination be added so it shows the Pagination in the Title Tag irrespective of who is logged in or not.

rgds andy
Go to Top of Page

Carefree
Advanced Member

Philippines
4207 Posts

Posted - 10 July 2009 :  10:39:16  Show Profile
quote:
Originally posted by Andy Humm

As an observation, I have noticed the pagination only shows when the administrator is logged in, i.e. Mlev=4
Could the & TITLE_pagination be added so it shows the Pagination in the Title Tag irrespective of who is logged in or not.

rgds andy



Sure. Two small changes required:

	if strTempTopic <> 0 then
		strsql = "SELECT FORUM_ID, T_SUBJECT FROM " & strActivePrefix & "TOPICS WHERE TOPIC_ID=" & strTempTopic
		set ttopics = my_conn.execute(strsql)
		if ttopics.bof or ttopics.eof then
			GetNewTitle = strForumTitle & TITLE_pagination
			set ttopics = nothing
		else
			if mLev = 4 then
				ForumChkSkipAllowed = 1
			elseif mLev = 3 then
				if chkForumModerator(ttopics("FORUM_ID"), ChkString(strDBNTUserName, "decode")) = "1" then
					ForumChkSkipAllowed = 1
				else
					ForumChkSkipAllowed = 0
				end if
			else
				ForumChkSkipAllowed = 0
			end if 
			intShowTopicTitle = 1
			if strPrivateForums = "1" and ForumChkSkipAllowed = 0 then
				if not(chkForumAccess(ttopics("FORUM_ID"),MemberID,false)) then
						intShowTopicTitle = 0
				end if
			end if
			if intShowTopicTitle = 1 then strTempTopicTitle = " - " & chkString(ttopics("T_SUBJECT"),"display")
			set ttopics = nothing
			strNewTitle = strForumTitle & strTempTopicTitle & TITLE_pagination
		end if
	else
		GetNewTitle = strForumTitle & TITLE_pagination
	end if
Go to Top of Page

Andy Humm
Average Member

United Kingdom
908 Posts

Posted - 13 July 2009 :  16:24:23  Show Profile
Quality support as always Thank You CF..
Go to Top of Page

Carefree
Advanced Member

Philippines
4207 Posts

Posted - 14 July 2009 :  01:19:54  Show Profile
You're welcome.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.25 seconds. Powered By: Snitz Forums 2000 Version 3.4.07