Sticky Topic Seperator?

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

Topic


MaD2ko0l
Sticky Topic Seperator?
03 October 2006, 19:24


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<

 

Replies ...


muzishun
04 October 2006, 01:33


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
Code:
	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.<
MaD2ko0l
04 October 2006, 07:11


thank you so much...it worked perfect its just what i have been looking for<
MarcelG
04 October 2006, 07:49


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! bigsmile<
MaD2ko0l
04 October 2006, 09:25


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<
MarcelG
04 October 2006, 09:30


Thanks! This is looking pretty slick indeed! I think this is something for oxle too! thanks Muzishun!<
Podge
04 October 2006, 09:58


Very nice indeed.<
alanh
04 October 2006, 11:31


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.<
MarcelG
04 October 2006, 14:44


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.<
MaD2ko0l
04 October 2006, 15:18


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.
Code:

				"                <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??<
CalloftheHauntedMaster
04 October 2006, 19:01


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?<
MaD2ko0l
04 October 2006, 19:10


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

Code:
				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

Code:
				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
Code:

if iTopicCount = "" then

and add this code above it

Code:

		"              <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
Code:

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

and replace it with this

Code:

				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<
muzishun
04 October 2006, 19:22


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:
Code:
	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.<
MaD2ko0l
04 October 2006, 19:28


works like a charm...thanks muzishun<
CalloftheHauntedMaster
04 October 2006, 19:35


Great. One more thing, how do I get the same font for my text that's used for "Author, Read, Replies, etc"?<
MaD2ko0l
04 October 2006, 19:37


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

Code:
<b><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strHeadFontColor & """>your text here</font></b>
<
CalloftheHauntedMaster
04 October 2006, 19:42



I want the separator to say "Forum Topics". However, it's black on black and can't be seen. I want it to be the same font and color text as the Topic and Read and Replies as the separator at the top of the page. I want it to be larger and gray as well.
You'll have to pardon my coding ignorance in these matters.
Btw, how can I add another separator under the row with Topic and Read and Replies, just like on that gamingcrpyt.com site? I think it looks really cool.<
MaD2ko0l
04 October 2006, 19:47


ok to get the seperators to the place like mine follow these instructions

find this line in forum.asp
Code:

if iTopicCount = "" then

and add this code above it

Code:

		"              <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 (this is the part that muzishun posted in his code)

Code:

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

and replace it with this

Code:

				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

this should make the text all the same as how u want it ass well


hope this helps<
CalloftheHauntedMaster
04 October 2006, 19:57


I get this error:

Microsoft VBScript compilation error '800a0400'

Expected statement

/bbs/forum.asp, line 478

" <tr>" & vbNewLine & _
^
<
MaD2ko0l
04 October 2006, 19:58


above this line
Code:
		"              <tr>" & vbNewLine & _

you will see this code

Code:
Response.Write	"              </tr>" & vbNewLine

you need to change that line to read this

Code:
Response.Write	"              </tr>" & vbNewLine & _

that should do it

here is a copy of my forum.asp for anyone that is intrested to see what i have done on this page so far.
forum.asp
hope this helps<
CalloftheHauntedMaster
04 October 2006, 20:09


Well, here's what I got:

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

It seems off-center though and I added the center tags. Ideas?
Is there also a way to add a line between the Topic, Author, Read and the "Important Topics"? It looks really jumbled...<
CalloftheHauntedMaster
04 October 2006, 20:15


Never mind about that. I forgot that as admin, I have an options menu to the far right. Members don't have it and it looks perfectly centered.
However, I am interested in adding that line between Important Topics and the top bar.<
muzishun
04 October 2006, 20:52


I did it slightly differently than that. I liked the idea of having a separator above both the stickys and the regular topics to help differentiate, but I don't want the "Important Topics" label there if there aren't stickies. Here's how I did it. Make the following block of code:
Code:
		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 & """><b><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strHeadFontColor & """>Forum Topics</font></b></td></tr>" & vbNewLine
blnStickyTopics = False
End If
End If
look like this
Code:
		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 & """><b><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strHeadFontColor & """>Forum Topics</font></b></td></tr>" & vbNewLine
blnStickyTopics = False
End If
End If

If blnStickyTopics = False Then
If Topic_Sticky and strStickyTopic = "1" Then
'We've got sticky topics, so we should draw the line here
Response.Write " <tr><td colspan=""7"" bgcolor=""" & strHeadCellColor & """><b><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strHeadFontColor & """>Important Topics</font></b></td></tr>" & vbNewLine
End If
End If
Like I said, this only adds the "Important Topics" header if there are stickies.<
MaD2ko0l
05 October 2006, 04:49


yeah i tryed doing that and it only chnages the 1 seperator...so if you have stcky topics it will show the "important topics" seperator under the sticky topics

if you look at the image below you will see that i have the "important topics" seperator above the sticky topics and "forum topics" seperator. when i used your code it will only change the "forum topics" seperator to and from "Forum topics" and "important topics"


i hope that made sense<
muzishun
05 October 2006, 09:57


Hmmm.. strange. Well, if you've got it working, that's all that matters. I'm using the same code (basically... I've tweaked it to use CSS classes and whatnot, but the table stuff is the same), and it displays fine on my page. But, if it's not broken, let's not try to fix it.
Glad you got it working.<
alanh
06 October 2006, 10:25


Once again thanks for the MOD, I made the changes and now the locked Single Sticky issue is resolved and also I have the headers Important and Forum Topics.
**** I am easily pleased......<
mama2000
17 October 2006, 21:42


Thanks for this one! I think it looks awesome! I changed the colors around on the title rows, but WOOHOO! I love this! <
philsbbs
16 May 2007, 15:47


love it :)
<
muzishun
16 May 2007, 20:08


Thanks. :)<
MarkJH
01 July 2007, 07:34


Great stuff.
Thanks, Bill. smile<
muzishun
01 July 2007, 11:16


You're welcome. Eventually I plan to pack this up with a couple of the other little MODs I've done and put them over on SnitzBitz. Perhaps this coming weekend I'll do that.<
radiodelicate
10 July 2008, 19:45


this works like a charm, thanks for a great MOD! Also, an easy way of making the line thinner is to remove the & nbsp; from the column.<
© 2000-2021 Snitz™ Communications