Sticky Topic Seperator? - Postet den (4467 Views)
Senior Member
MaD2ko0l
Innlegg: 1053
1053
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
   
 Sidestørrelse 
Postet den
Senior Member
muzishun
Innlegg: 1079
1079
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.<
Bill Parrott
Senior Web Programmer, University of Kansas
Co-Owner and Code Monkey, Eternal Second Designs (www.eternalsecond.com)
Personal Website (www.chimericdream.com)
Postet den
Senior Member
MaD2ko0l
Innlegg: 1053
1053
thank you so much...it worked perfect its just what i have been looking for<
© 1999-2010 MaD2ko0l
Postet den
Retired Support Moderator
MarcelG
Innlegg: 2625
2625
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<
Postet den
Senior Member
MaD2ko0l
Innlegg: 1053
1053
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
Postet den
Retired Support Moderator
MarcelG
Innlegg: 2625
2625
Thanks! This is looking pretty slick indeed! I think this is something for oxle too! thanks Muzishun!<
Postet den
Support Moderator
Podge
Innlegg: 3776
3776
Very nice indeed.<
Postet den
Medlem er låst
alanh
Innlegg: 92
92
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.<
Postet den
Retired Support Moderator
MarcelG
Innlegg: 2625
2625
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.<
Postet den
Senior Member
MaD2ko0l
Innlegg: 1053
1053
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??<
© 1999-2010 MaD2ko0l
Postet den
Junior Member
CalloftheHauntedMaster
Innlegg: 289
289
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!
Du må legge inn en melding