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

 All Forums
 Snitz Forums 2000 MOD-Group
 MOD Add-On Forum (W/Code)
 CODE: show title of pre/next topics in topic.asp
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

blackinwhite
Average Member

Turkey
657 Posts

Posted - 05 September 2002 :  11:11:15  Show Profile
it's not a big deal, but a useful addition.

change you sub with this one in topic.asp


Sub Topic_nav()    

	if prevTopic = "" then
		strSQL = "SELECT T_SUBJECT, TOPIC_ID "
		strSql = strSql & "FROM " & strActivePrefix & "TOPICS "
		strSql = strSql & "WHERE T_LAST_POST > '" & Topic_LastPost
		strSql = strSql & "' AND FORUM_ID=" & Forum_ID
		strSql = strSql & " ORDER BY T_LAST_POST;"

		set rsPrevTopic = my_conn.Execute(TopSQL(strSql,1))

		if rsPrevTopic.EOF then
			prevTopic = getCurrentIcon(strIconBlank,"","align=""top"" hspace=""6""")
		else
			prevTopic = "<a href=""topic.asp?" & ArchiveLink & "TOPIC_ID=" & rsPrevTopic("TOPIC_ID") & """>" & rsPrevTopic("T_SUBJECT") & " <strong>«</strong></a>"
		end if

		rsPrevTopic.close
		set rsPrevTopic = nothing
	else
		prevTopic = prevTopic
	end if

	if NextTopic = "" then
		strSQL = "SELECT T_SUBJECT, TOPIC_ID "
		strSql = strSql & "FROM " & strActivePrefix & "TOPICS "
		strSql = strSql & "WHERE T_LAST_POST < '" & Topic_LastPost
		strSql = strSql & "' AND FORUM_ID=" & Forum_ID
		strSql = strSql & " ORDER BY T_LAST_POST DESC;"

		set rsNextTopic = my_conn.Execute(TopSQL(strSql,1))

		if rsNextTopic.EOF then
			nextTopic = getCurrentIcon(strIconBlank,"","align=""top"" hspace=""6""")
		else
			nextTopic = "<a href=""topic.asp?" & ArchiveLink & "TOPIC_ID=" & rsNextTopic("TOPIC_ID") & """> <strong>»</strong> " & rsNextTopic("T_SUBJECT") & "</a>"
		end if

		rsNextTopic.close
		set rsNextTopic = nothing
	else
		nextTopic = nextTopic
	end if

	Response.Write ("                " & prevTopic & "<b><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strHeadFontColor & """> Topic </font></b>" & nextTopic)

end sub



that's it.

See the Richard's warning below (about using chkString(rsNextTopic("T_SUBJECT"),"display").

Edited by - blackinwhite on 05 September 2002 16:02:58

Etymon
Advanced Member

United States
2385 Posts

Posted - 05 September 2002 :  13:36:22  Show Profile  Visit Etymon's Homepage

It's a novel idea. Thanks!

Etymon
Go to Top of Page

kwhipp
Junior Member

USA
407 Posts

Posted - 05 September 2002 :  15:02:06  Show Profile  Visit kwhipp's Homepage  Send kwhipp an AOL message  Send kwhipp an ICQ Message  Send kwhipp a Yahoo! Message
I really like this! I just wanted to share the mods that I did.
  • Hover your cursor over the next/previous icons to display the next/previous topic title



Sub Topic_nav()    

	if prevTopic = "" then
		strSQL = "SELECT T_SUBJECT, TOPIC_ID "
		strSql = strSql & "FROM " & strActivePrefix & "TOPICS "
		strSql = strSql & "WHERE T_LAST_POST > '" & Topic_LastPost
		strSql = strSql & "' AND FORUM_ID=" & Forum_ID
		strSql = strSql & " ORDER BY T_LAST_POST;"

		set rsPrevTopic = my_conn.Execute(TopSQL(strSql,1))

		if rsPrevTopic.EOF then
			prevTopic = getCurrentIcon(strIconBlank,"","align=""top"" hspace=""6""")
		else
			prevTopic = "<a href=""topic.asp?" & ArchiveLink & "TOPIC_ID=" & rsPrevTopic("TOPIC_ID") & """>" & getCurrentIcon(strIconGoLeft,"" & rsPrevTopic("T_SUBJECT") & "","align=""top"" hspace=""6""") & "</a>"
		end if

		rsPrevTopic.close
		set rsPrevTopic = nothing
	else
		prevTopic = prevTopic
	end if

	if NextTopic = "" then
		strSQL = "SELECT T_SUBJECT, TOPIC_ID "
		strSql = strSql & "FROM " & strActivePrefix & "TOPICS "
		strSql = strSql & "WHERE T_LAST_POST < '" & Topic_LastPost
		strSql = strSql & "' AND FORUM_ID=" & Forum_ID
		strSql = strSql & " ORDER BY T_LAST_POST DESC;"

		set rsNextTopic = my_conn.Execute(TopSQL(strSql,1))

		if rsNextTopic.EOF then
			nextTopic = getCurrentIcon(strIconBlank,"","align=""top"" hspace=""6""")
		else
			nextTopic = "<a href=""topic.asp?" & ArchiveLink & "TOPIC_ID=" & rsNextTopic("TOPIC_ID") & """>" & getCurrentIcon(strIconGoRight,"" & rsNextTopic("T_SUBJECT") & "","align=""top"" hspace=""6""") & "</a>"
		end if

		rsNextTopic.close
		set rsNextTopic = nothing
	else
		nextTopic = nextTopic
	end if

	Response.Write ("                " & prevTopic & "<b><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strHeadFontColor & """> Topic </font></b>" & nextTopic)

end sub



I hope you like it.

- Kevin

Edited by - kwhipp on 05 September 2002 15:27:35
Go to Top of Page

Coder_1999
Starting Member

USA
16 Posts

Posted - 05 September 2002 :  15:27:46  Show Profile  Visit Coder_1999's Homepage  Send Coder_1999 a Yahoo! Message
An excellent addition! Thanks.

Coder
"It it weren't for on-line gaming, I could till be using a 286!"
Go to Top of Page

RichardKinser
Snitz Forums Admin

USA
16655 Posts

Posted - 05 September 2002 :  15:36:20  Show Profile
quote:
Originally posted by kwhipp

I really like this! I just wanted to share the mods that I did.
  • Hover your cursor over the next/previous icons to display the next/previous topic title

I added something similar to the base code this morning while working on the bug in this function.

You should really use chkString around the subject though: ( I also added the Next Topic: / Previous Topic: before the actual topic title)

"Previous Topic: " & chkString(rsPrevTopic("T_SUBJECT"),"display")


and:

"Next Topic: " & chkString(rsNextTopic("T_SUBJECT"),"display")
Go to Top of Page

kwhipp
Junior Member

USA
407 Posts

Posted - 05 September 2002 :  16:27:55  Show Profile  Visit kwhipp's Homepage  Send kwhipp an AOL message  Send kwhipp an ICQ Message  Send kwhipp a Yahoo! Message
Richard -

You just made me do a "double-take". I hovered over the Next Topic icon and saw what you added. I had to take a second look at the original topic.asp file to verify that I hadn't modified the script back to it's orignal code.

- Kevin

Edited by - kwhipp on 05 September 2002 16:28:46
Go to Top of Page

kwhipp
Junior Member

USA
407 Posts

Posted - 05 September 2002 :  19:16:47  Show Profile  Visit kwhipp's Homepage  Send kwhipp an AOL message  Send kwhipp an ICQ Message  Send kwhipp a Yahoo! Message
Richard -

Check here (http://forum.snitz.com/forum/topic.asp?whichpage=-1&TOPIC_ID=34337&REPLY_ID=171145) for the "fix" to this code.

- Kevin
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.21 seconds. Powered By: Snitz Forums 2000 Version 3.4.07