Subject says it, show page that your on in the title bar when loaded... a few simple changes marked below.
Inc functions.asp - top of file after comments
Function GetNewTitle(strTempScriptName) Dim StrTempScript Dim strNewTitle arrTempScript = Split(strTempScriptName, "/") strTempScript = arrTempScript(Ubound(arrTempScript)) strTempScript = lcase(strTempScript) Select Case strTempScript Case "topic.asp"
strTempTopic = request.querystring("TOPIC_ID")
if not(strTempTopic = "") then if request.querystring("archive") = "true" then strsql = "SELECT T_SUBJECT, FORUM_ID FROM " & strActivePrefix & "TOPICS WHERE TOPIC_ID=" & strTempTopic set ttopics = my_conn.execute(strsql) strTempTopicTitle = ttopics("T_SUBJECT") strTempForum = ttopics("FORUM_ID") set ttopics = nothing strsql = "SELECT F_SUBJECT FROM " & strActivePrefix & "FORUM WHERE FORUM_ID=" & strTempForum set tforums = my_conn.execute(strsql) strTempForumTitle = tforums("F_SUBJECT") set tforums = nothing strNewTitle = strTempTopicTitle & " - " & strTempForumTitle & " - " & strForumTitle else strsql = "SELECT T_SUBJECT, FORUM_ID FROM " & strTablePrefix & "TOPICS WHERE TOPIC_ID=" & strTempTopic set ttopics = my_conn.execute(strsql) strTempTopicTitle = ttopics("T_SUBJECT") strTempForum = ttopics("FORUM_ID") set ttopics = nothing strsql = "SELECT F_SUBJECT FROM " & strTablePrefix & "FORUM WHERE FORUM_ID=" & strTempForum set tforums = my_conn.execute(strsql) strTempForumTitle = tforums("F_SUBJECT") set tforums = nothing strNewTitle = strTempTopicTitle & " - " & strTempForumTitle & " - " & strForumTitle end if else strNewTitle = strForumTitle end if
Case "forum.asp" strTempForum = request.querystring("FORUM_ID")
if not(strTempForum = "") then strsql = "SELECT F_SUBJECT FROM " & strTablePrefix & "FORUM WHERE FORUM_ID=" & strTempForum set tforums = my_conn.execute(strsql) strTempForumTitle = tforums("F_SUBJECT") set tforums = nothing strNewTitle = strTempForumTitle & " - " & strForumTitle else strNewTitle = strForumTitle end if 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 "policy.asp" strNewTitle = "User Agreement - " & strForumTitle Case "register.asp" strNewTitle = "Register - " & strForumTitle Case "active_users.asp" strNewTitle = "Active users - " & strForumTitle Case else strNewTitle = strForumTitle End Select GetNewTitle = strNewTitle End Function
Really cool! I was planning on asking for something like this but I won't have to anymore.
One thing though: the forum or topic title shows up before the standard title. I think it makes more sense to have the standard title appear first and then the additional title. I changed it and made it fit in with the rest of my site's titles so you won't have to explain how that's done
Just replace forumtitle & topictitle with the correct variable name. The only drawback of this approach is that the title is the default in inc_top.asp for a split second while reaching that line in code. A great advantage is that we save another roundtrip to the server in a much needed enviroment.
However, I used Active Users Mod for getting the Title. I moved the include statement for inc_activeusers.asp in inc_top.asp above the title tag and inserted the statements in red in inc_activeusers.asp as below
Okay, so you basically say that if the page is members.asp it has to add - Members to the title, right? Can this be used in combination with Stim's codes?
Exactly!There is no need of calling the function since Online script already determines the Page which is being hit. This is how i did for forum.asp and topic.asp
Case "forum.asp" If Request.QueryString("FORUM_ID") <> "" Then set rst = my_conn.execute("SELECT FORUM_ID, F_SUBJECT FROM " & strTablePrefix & "FORUM WHERE FORUM_ID = " & Request.QueryString("FORUM_ID")) Forum_Subject = rst("F_SUBJECT") rst.close set rst = nothing end if strOnlineLocation = strOnlineLocation & Forum_Subject strForumTitle = strForumTitle & " - " & Forum_Subject Case "topic.asp" if Request.QueryString("ARCHIVE") = "true" Then strOnlineLocation = strOnlineLocation & "Viewing Archived Message" else if Request.Querystring("TOPIC_ID") <> "" Then set rst = my_conn.execute("SELECT TOPIC_ID, T_SUBJECT FROM " & strTablePrefix & "TOPICS WHERE TOPIC_ID = " & Request.Querystring("TOPIC_ID")) Topic_Subject = rst("T_SUBJECT") rst.close set rst = nothing strOnlineLocation = strOnlineLocation & Topic_Subject strForumTitle = strForumTitle & " - " & Topic_Subject end if end if
GauravBhabu There is only one miracle...That is LIFE! | It is difficult to IMPROVE on Perfection, There is no harm in Keep Trying.