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/O Code)
 Sticky Topic Seperator?
 New Topic  Reply to Topic
 Printer Friendly
Next Page
Author Previous Topic Topic Next Topic
Page: of 3

MaD2ko0l
Senior Member

United Kingdom
1053 Posts

Posted - 03 October 2006 :  19:24:37  Show Profile  Visit MaD2ko0l's Homepage  Reply with Quote
hiya,
i have been trying to figuare out how i can add a seperator between the sticky topics and the unsticky topics on forum.asp

i was wundering if anyone had done this before and if they can show me the code to do it.

the reason i want this is because it just makes things look a little neater on the forum.asp page.

from what i have managed to understand, while forum.asp is looking throught the topics if it comes across a topic that is a sticky it will add the word sticky in front, but i cannt seem to find anymore code that sorts where the sticky topics go.

does any of this make sense??

thanks

MaD2ko0l<

© 1999-2010 MaD2ko0l

muzishun
Senior Member

United States
1079 Posts

Posted - 04 October 2006 :  01:33:59  Show Profile  Visit muzishun's Homepage  Reply with Quote
This is untested, but it should work in theory. Basically, you add a variable that tells you there are sticky topics. Then, you simply check that variable and see if you have had sticky topics and whether or not the current topic is sticky. Once it gets to the end of the sticky topics, it draws a line.

forum.asp starting line 458 (in un-modded code)
red code is added
	blnStickyTopics = False

	for iTopic = 0 to iTopicCount
		if (rec = strPageSize + 1) then exit for

		Topic_Status = arrTopicData(tT_STATUS, iTopic)
		Topic_CatID = arrTopicData(tCAT_ID, iTopic)
		Topic_ForumID = arrTopicData(tFORUM_ID, iTopic)
		Topic_ID = arrTopicData(tTOPIC_ID, iTopic)
		Topic_ViewCount = arrTopicData(tT_VIEW_COUNT, iTopic)
		Topic_Subject = arrTopicData(tT_SUBJECT, iTopic)
		Topic_Author = arrTopicData(tT_AUTHOR, iTopic)
		Topic_Sticky = arrTopicData(tT_STICKY, iTopic)
		Topic_Replies = arrTopicData(tT_REPLIES, iTopic)
		Topic_UReplies = arrTopicData(tT_UREPLIES, iTopic)
		Topic_LastPost = arrTopicData(tT_LAST_POST, iTopic)
		Topic_LastPostAuthor = arrTopicData(tT_LAST_POST_AUTHOR, iTopic)
		Topic_LastPostReplyID = arrTopicData(tT_LAST_POST_REPLY_ID, iTopic)
		Topic_MName = arrTopicData(tM_NAME, iTopic)
		Topic_LastPostAuthorName = arrTopicData(tLAST_POST_AUTHOR_NAME, iTopic)

		if AdminAllowed = 1 and Topic_UReplies > 0 then
			Topic_Replies = Topic_Replies + Topic_UReplies
		end if

		If blnStickyTopics = True Then
			If Topic_Sticky and strStickyTopic = "1" Then
				'Do Nothing
			Else
				'We've had sticky topics, and now we are into the regular topics
				Response.Write	"              <tr><td colspan=""7"" bgcolor=""" & strHeadCellColor & """>&nbsp;</td></tr>" & vbNewLine
				blnStickyTopics = False
			End If
		End If

		Response.Write	"              <tr>" & vbNewLine & _
				"                <td bgcolor=""" & strForumCellColor & """ align=""center"" valign=""middle""><a href=""topic.asp?" & ArchiveLink & "TOPIC_ID=" & Topic_ID & """>"
		if Cat_Status <> 0 and Forum_Status <> 0 and Topic_Status <> 0 then
			if Topic_Sticky and strStickyTopic = "1" then
				if Topic_LastPost > Session(strCookieURL & "last_here_date") then
					Response.Write	getCurrentIcon(strIconFolderNewSticky,"New Sticky Topic","hspace=""0""")
				else
					Response.Write	getCurrentIcon(strIconFolderSticky,"Sticky Topic","hspace=""0""")
				end if
				blnStickyTopics = True
			else
				' DEM --> Added code for topic moderation
				if Topic_Status = 2 then
					UnApprovedFound = "Y"
					Response.Write 	getCurrentIcon(strIconFolderUnmoderated,"Topic Not Moderated","hspace=""0""") & "</a>" & vbNewline
				elseif Topic_Status = 3 then
					HeldFound = "Y"
					Response.Write 	getCurrentIcon(strIconFolderHold,"Topic on Hold","hspace=""0""") & "</a>" & vbNewline
					' DEM --> end of code Added for topic moderation
				else
					Response.Write	ChkIsNew(Topic_LastPost)
				end if
			end if
		else

Like I said... it's untested, but it should work well enough for what you want, or at least give you a place to start.<

Bill Parrott
Senior Web Programmer, University of Kansas
Co-Owner and Code Monkey, Eternal Second Designs (www.eternalsecond.com)
Personal Website (www.chimericdream.com)

Edited by - muzishun on 04 October 2006 01:34:57
Go to Top of Page

MaD2ko0l
Senior Member

United Kingdom
1053 Posts

Posted - 04 October 2006 :  07:11:45  Show Profile  Visit MaD2ko0l's Homepage  Reply with Quote
thank you so much...it worked perfect its just what i have been looking for<

© 1999-2010 MaD2ko0l
Go to Top of Page

MarcelG
Retired Support Moderator

Netherlands
2625 Posts

Posted - 04 October 2006 :  07:49:18  Show Profile  Visit MarcelG's Homepage  Reply with Quote
MaD2ko0l ; care to share a link with us where we can see Muzishuns mod in action ? I'm quite interested as to how this will look! <

portfolio - linkshrinker - oxle - twitter
Go to Top of Page

MaD2ko0l
Senior Member

United Kingdom
1053 Posts

Posted - 04 October 2006 :  09:25:17  Show Profile  Visit MaD2ko0l's Homepage  Reply with Quote
sure
http://www.gamingcrypt.co.uk/aaa/forum/forum.asp?FORUM_ID=9
this is a new site i am working on for a local hobby shop...should be finished soon.

i have added and moved other parts in the forum.asp page but u can basically see what Muzishuns code comes out like<

© 1999-2010 MaD2ko0l
Go to Top of Page

MarcelG
Retired Support Moderator

Netherlands
2625 Posts

Posted - 04 October 2006 :  09:30:10  Show Profile  Visit MarcelG's Homepage  Reply with Quote
Thanks! This is looking pretty slick indeed! I think this is something for oxle too! thanks Muzishun!<

portfolio - linkshrinker - oxle - twitter
Go to Top of Page

Podge
Support Moderator

Ireland
3776 Posts

Posted - 04 October 2006 :  09:58:00  Show Profile  Send Podge an ICQ Message  Send Podge a Yahoo! Message  Reply with Quote
Very nice indeed.<

Podge.

The Hunger Site - Click to donate free food | My Blog | Snitz 3.4.05 AutoInstall (Beta!)

My Mods: CAPTCHA Mod | GateKeeper Mod
Tutorial: Enable subscriptions on your board

Warning: The post above or below may contain nuts.
Go to Top of Page

alanh
New Member

United Kingdom
92 Posts

Posted - 04 October 2006 :  11:31:26  Show Profile  Reply with Quote
Nice little MOD, thanks very much. One thing I did notice I have a Sticky that is locked and the MOD does not put the line under a locked Sticky, when I unlocked it the line appeared. This is not a problem but thought you may want to know.

Just in case this does not happen with a normal Snitz load I am using Images Translators version of Snitz 3.4.05, so it may just be my version.<
Go to Top of Page

MarcelG
Retired Support Moderator

Netherlands
2625 Posts

Posted - 04 October 2006 :  14:44:50  Show Profile  Visit MarcelG's Homepage  Reply with Quote
Alan, I noticed the same thing, the seperator doesn't shown under a locked sticky topic. I'm breaking my head over the code to see where this goes wrong, and I'll let you know when I find it.<

portfolio - linkshrinker - oxle - twitter
Go to Top of Page

MaD2ko0l
Senior Member

United Kingdom
1053 Posts

Posted - 04 October 2006 :  15:18:34  Show Profile  Visit MaD2ko0l's Homepage  Reply with Quote
ok..i think i have found A quick fix...tell me if i am wrong

Find the code in red and delete it. this should show the sticky locked topic correctly.


				"                <td bgcolor=""" & strForumCellColor & """ align=""center"" valign=""middle""><a href=""topic.asp?" & ArchiveLink & "TOPIC_ID=" & Topic_ID & """>"
		if Cat_Status <> 0 and Forum_Status <> 0 and Topic_Status <> 0 then
			if Topic_Sticky and strStickyTopic = "1" then 
				if Topic_LastPost > Session(strCookieURL & "last_here_date") then


when Topic_Status is set to 0 this means that the topic is locked, so by the looks of it what it was doing is bypassing locked sticky topics.

this still needs a bit of testing but i have noticed that the lockedtopic icon doesnt show up in another forum that i have

does this help anyone??<

© 1999-2010 MaD2ko0l
Go to Top of Page

CalloftheHauntedMaster
Junior Member

289 Posts

Posted - 04 October 2006 :  19:01:58  Show Profile  Reply with Quote
Well, my locked topics look fine:

http://www.schoolofduel.com/bbs/forum.asp?forum_id=33

However, I have two questions...

1) How can I make the separator thinner?
2) How can I add text/image into the separator?

Basically, MaD2ko0l, how did you create that field for Important Topics and Forum Topics?<

This account was hacked into by Image, a very honest guy as you all can see! Stealing people's passwords is his pasttime. Beware of this, before you register at his forums!

Edited by - CalloftheHauntedMaster on 04 October 2006 19:03:58
Go to Top of Page

MaD2ko0l
Senior Member

United Kingdom
1053 Posts

Posted - 04 October 2006 :  19:10:08  Show Profile  Visit MaD2ko0l's Homepage  Reply with Quote
ah...the reason that ur locked topics look fine is because you have other sticky topics.. if you have only 1 locked sticky topic you will see the problem. but if u have mixed sticky topics they look normal.



to answer your other questions:
1) i dont think that u can make it smaller unless you some css can help you out

2) to add text/image into the seperator look for this line in the code that u just added

				Response.Write	"              <tr><td colspan=""7"" bgcolor=""" & strHeadCellColor & """> </td></tr>" & vbNewLine


you add your text/image in place of   <---- that is the equiliverant of a space

for example use this code to add an image

				Response.Write	"              <tr><td colspan=""7"" bgcolor=""" & strHeadCellColor & """><img src=""http://forum.snitz.com/forum/logo_snitz_forums_2000.gif""></td></tr>" & vbNewLine


this will put the snitz logo in the seperator.


find this line in forum.asp

if iTopicCount = "" then


and add this code above it


		"              <tr>" & vbNewLine & _
		"                <td colspan =""6"" align=""center"" bgcolor=""" & strHeadCellColor & """><b><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strHeadFontColor & """>Important Topics</font></b></td>" & vbNewLine & _
		"              </tr>" & vbNewLine


then find this code

				Response.Write	"              <tr><td colspan=""7"" bgcolor=""" & strHeadCellColor & """> </td></tr>" & vbNewLine


and replace it with this


				Response.Write  "              <tr>" & vbNewLine & _
								"                <td colspan =""6"" align=""center"" bgcolor=""" & strHeadCellColor & """><b><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strHeadFontColor & """>Forum Topics</font></b></td>" & vbNewLine & _
								"              </tr>" & vbNewLine


hope this helps<

© 1999-2010 MaD2ko0l

Edited by - MaD2ko0l on 04 October 2006 19:15:37
Go to Top of Page

muzishun
Senior Member

United States
1079 Posts

Posted - 04 October 2006 :  19:22:09  Show Profile  Visit muzishun's Homepage  Reply with Quote
Wow, thanks for the kind words. As for the issue with locked sticky topics, I think it may have something to do with having only a single sticky topic that is locked. If there's only one, and it's locked, the blnStickyTopics variable is never set to True. Try this out instead of the code above.

forum.asp line 458:
	blnStickyTopics = False

	for iTopic = 0 to iTopicCount
		if (rec = strPageSize + 1) then exit for

		Topic_Status = arrTopicData(tT_STATUS, iTopic)
		Topic_CatID = arrTopicData(tCAT_ID, iTopic)
		Topic_ForumID = arrTopicData(tFORUM_ID, iTopic)
		Topic_ID = arrTopicData(tTOPIC_ID, iTopic)
		Topic_ViewCount = arrTopicData(tT_VIEW_COUNT, iTopic)
		Topic_Subject = arrTopicData(tT_SUBJECT, iTopic)
		Topic_Author = arrTopicData(tT_AUTHOR, iTopic)
		Topic_Sticky = arrTopicData(tT_STICKY, iTopic)
		Topic_Replies = arrTopicData(tT_REPLIES, iTopic)
		Topic_UReplies = arrTopicData(tT_UREPLIES, iTopic)
		Topic_LastPost = arrTopicData(tT_LAST_POST, iTopic)
		Topic_LastPostAuthor = arrTopicData(tT_LAST_POST_AUTHOR, iTopic)
		Topic_LastPostReplyID = arrTopicData(tT_LAST_POST_REPLY_ID, iTopic)
		Topic_MName = arrTopicData(tM_NAME, iTopic)
		Topic_LastPostAuthorName = arrTopicData(tLAST_POST_AUTHOR_NAME, iTopic)

		if AdminAllowed = 1 and Topic_UReplies > 0 then
			Topic_Replies = Topic_Replies + Topic_UReplies
		end if

		If blnStickyTopics = True Then
			If Topic_Sticky and strStickyTopic = "1" Then
				'Do Nothing
			Else
				'We've had sticky topics, and now we are into the regular topics
				Response.Write	"              <tr><td colspan=""7"" bgcolor=""" & strHeadCellColor & """ style=""height:1px;line-height:1px;""> </td></tr>" & vbNewLine
				blnStickyTopics = False
			End If
		End If

		Response.Write	"              <tr>" & vbNewLine & _
				"                <td bgcolor=""" & strForumCellColor & """ align=""center"" valign=""middle""><a href=""topic.asp?" & ArchiveLink & "TOPIC_ID=" & Topic_ID & """>"
		if Cat_Status <> 0 and Forum_Status <> 0 and Topic_Status <> 0 then
			if Topic_Sticky and strStickyTopic = "1" then
				if Topic_LastPost > Session(strCookieURL & "last_here_date") then
					Response.Write	getCurrentIcon(strIconFolderNewSticky,"New Sticky Topic","hspace=""0""")
				else
					Response.Write	getCurrentIcon(strIconFolderSticky,"Sticky Topic","hspace=""0""")
				end if
				blnStickyTopics = True
			else
				' DEM --> Added code for topic moderation
				if Topic_Status = 2 then
					UnApprovedFound = "Y"
					Response.Write 	getCurrentIcon(strIconFolderUnmoderated,"Topic Not Moderated","hspace=""0""") & "</a>" & vbNewline
				elseif Topic_Status = 3 then
					HeldFound = "Y"
					Response.Write 	getCurrentIcon(strIconFolderHold,"Topic on Hold","hspace=""0""") & "</a>" & vbNewline
					' DEM --> end of code Added for topic moderation
				else
					Response.Write	ChkIsNew(Topic_LastPost)
				end if
			end if
		else
			if ArchiveView <> "true" then
				if Cat_Status = 0 then
					strAltText = "Category Locked"
				elseif Forum_Status = 0 then
					strAltText = "Forum Locked"
				else
					strAltText = "Topic Locked"
				end if
			end if
			if ArchiveView = "true" then
				Response.Write	getCurrentIcon(strIconFolderArchived,"Archived Topic","hspace=""0""")
			elseif Topic_LastPost > Session(strCookieURL & "last_here_date") then
				if Topic_Sticky and strStickyTopic = "1" then
					Response.Write	getCurrentIcon(strIconFolderNewStickyLocked,strAltText,"hspace=""0""")
					blnStickyTopics = True
				else
					Response.Write	getCurrentIcon(strIconFolderNewLocked,strAltText,"hspace=""0""")
				end if
			else
				if Topic_Sticky and strStickyTopic = "1" then
					Response.Write	getCurrentIcon(strIconFolderStickyLocked,strAltText,"hspace=""0""")
					blnStickyTopics = True
				else
					Response.Write	getCurrentIcon(strIconFolderLocked,strAltText,"hspace=""0""")
				end if
			end if
		end if
		Response.Write	"</a></td>" & vbNewLine & _

This adds the check to the parts a little later on where the topic is locked. To make the line thinner, you can simply change the text in green. If you just want a simple line, or want to use the suggestion above to add text or an image to the line, the green part can be removed completely.<

Bill Parrott
Senior Web Programmer, University of Kansas
Co-Owner and Code Monkey, Eternal Second Designs (www.eternalsecond.com)
Personal Website (www.chimericdream.com)

Edited by - muzishun on 04 October 2006 19:25:55
Go to Top of Page

MaD2ko0l
Senior Member

United Kingdom
1053 Posts

Posted - 04 October 2006 :  19:28:06  Show Profile  Visit MaD2ko0l's Homepage  Reply with Quote
works like a charm...thanks muzishun<

© 1999-2010 MaD2ko0l
Go to Top of Page

CalloftheHauntedMaster
Junior Member

289 Posts

Posted - 04 October 2006 :  19:35:13  Show Profile  Reply with Quote
Great. One more thing, how do I get the same font for my text that's used for "Author, Read, Replies, etc"?<

This account was hacked into by Image, a very honest guy as you all can see! Stealing people's passwords is his pasttime. Beware of this, before you register at his forums!
Go to Top of Page

MaD2ko0l
Senior Member

United Kingdom
1053 Posts

Posted - 04 October 2006 :  19:37:53  Show Profile  Visit MaD2ko0l's Homepage  Reply with Quote
eerrmm im not to sure what u mean but i think this is what you mean

put your own text where the red text is

<b><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strHeadFontColor & """>your text here</font></b>
<

© 1999-2010 MaD2ko0l
Go to Top of Page
Page: of 3 Previous Topic Topic Next Topic  
Next Page
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.42 seconds. Powered By: Snitz Forums 2000 Version 3.4.07