Displays sticky topics in active topics.
Only basic testing has been done, so if you find a bug let me know and I will do my best to fix it.
All code changes are in "active.asp" - Snitz version 3.4.04
The line numbers are approximate.
1. Find this code line 243
'## Forum_SQL - Get all active topics from last visit
strSql = "SELECT F.FORUM_ID, " & _
"F.F_SUBJECT, " & _
"F.F_SUBSCRIPTION, " & _
"F.F_STATUS, " & _
"C.CAT_ID, " & _
"C.CAT_NAME, " & _
"C.CAT_SUBSCRIPTION, " & _
"C.CAT_STATUS, " & _
"T.T_STATUS, " & _
"T.T_VIEW_COUNT, " & _
"T.TOPIC_ID, " & _
"T.T_SUBJECT, " & _
"T.T_AUTHOR, " & _
"T.T_REPLIES, " & _
"T.T_UREPLIES, " & _
ADD this line right after.
"T.T_STICKY, " & _
2. Find this code line 279
"AND (T.T_LAST_POST > '" & lastDate & "'"
REPLACE that with this.
if strStickyTopic = "1" then
strSql = strSql & "AND ((T.T_LAST_POST > '" & lastDate & "' OR T.T_STICKY = 1)"
else
strSql = strSql & "AND (T.T_LAST_POST > '" & lastDate & "'"
end if
3. Find this code line 285.
if mlev = 3 and ModOfForums <> "" then
strSql = strSql & " OR T.FORUM_ID IN (" & ModOfForums & ") "
end if
ADD this right after.
if strStickyTopic = "1" then
strSql = strSql & " OR T.T_STICKY = 1"
end if
4. Find this code line 303.
strSql = strSql & " ORDER BY C.CAT_ORDER, C.CAT_NAME, F.F_ORDER, F.F_SUBJECT, T.T_LAST_POST DESC "
REPLACE that with this.
strSql = strSql & " ORDER BY C.CAT_ORDER, C.CAT_NAME, F.F_ORDER, F.F_SUBJECT, "
if strStickyTopic = "1" then
strSql = strSql & "T.T_STICKY DESC, "
end if
strSql = strSql & "T.T_LAST_POST DESC "
5. Find this code line 434.
fM_NAME = 15
fT_LAST_POST_AUTHOR = 16
fT_LAST_POST = 17
fT_LAST_POST_REPLY_ID = 18
fLAST_POST_AUTHOR_NAME = 19
fF_PRIVATEFORUMS = 20
fF_PASSWORD_NEW = 21
REPLACE that with this.
fT_STICKY = 15
fM_NAME = 16
fT_LAST_POST_AUTHOR = 17
fT_LAST_POST = 18
fT_LAST_POST_REPLY_ID = 19
fLAST_POST_AUTHOR_NAME = 20
fF_PRIVATEFORUMS = 21
fF_PASSWORD_NEW = 22
6. Find this code line 459.
Topic_UReplies = allActiveTopics(fT_UREPLIES,RowCount)
ADD this right after.
Topic_Sticky = allActiveTopics(fT_STICKY,RowCount)
7. Find this code line 510.
if Cat_Status <> 0 and Forum_Status <> 0 and Topic_Status <> 0 then
' 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
elseif lcase(strHotTopic) = "1" and Topic_Replies >= intHotTopicNum then
Response.Write getCurrentIcon(strIconFolderNewHot,"Hot Topic with New Posts","hspace=""0""") & "</a>" & vbNewline
elseif Topic_Last_Post < lastdate then
Response.Write getCurrentIcon(strIconFolder,"No New Posts","") & "</a>" & vbNewline
else
Response.Write getCurrentIcon(strIconFolderNew,"New Posts","") & "</a>" & vbNewline
end if
else
if Cat_Status = 0 then
strAltText = "Category"
elseif Forum_Status = 0 then
strAltText = "Forum"
else
strAltText = "Topic"
end if
if Topic_Last_Post < lastdate then
Response.Write getCurrentIcon(strIconFolderLocked,strAltText,"locked")
else
Response.Write getCurrentIcon(strIconFolderNewLocked,strAltText,"locked")
end if
Response.Write "</a>" & vbNewline
end if
REPLACE that with this.
if Cat_Status <> 0 and Forum_Status <> 0 and Topic_Status <> 0 then
' DEM --> Added code for topic moderation
if Topic_Sticky and strStickyTopic = "1" then
if Topic_Last_Post > lastdate then
Response.Write getCurrentIcon(strIconFolderNewSticky,"New Sticky Topic","hspace=""0""")
else
Response.Write getCurrentIcon(strIconFolderSticky,"Sticky Topic","hspace=""0""")
end if
else
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
elseif lcase(strHotTopic) = "1" and Topic_Replies >= intHotTopicNum then
Response.Write getCurrentIcon(strIconFolderNewHot,"Hot Topic with New Posts","hspace=""0""") & "</a>" & vbNewline
elseif Topic_Last_Post < lastdate then
Response.Write getCurrentIcon(strIconFolder,"No New Posts","") & "</a>" & vbNewline
else
Response.Write getCurrentIcon(strIconFolderNew,"New Posts","") & "</a>" & vbNewline
end if
end if
else
if Cat_Status = 0 then
strAltText = "Category"
elseif Forum_Status = 0 then
strAltText = "Forum"
else
strAltText = "Topic"
end if
if Topic_Last_Post < lastdate then
if Topic_Sticky and strStickyTopic = "1" then
Response.Write getCurrentIcon(strIconFolderStickyLocked,strAltText,"hspace=""0""")
else
Response.Write getCurrentIcon(strIconFolderLocked,strAltText,"locked")
end if
else
if Topic_Sticky and strStickyTopic = "1" then
Response.Write getCurrentIcon(strIconFolderNewStickyLocked,strAltText,"hspace=""0""")
else
Response.Write getCurrentIcon(strIconFolderNewLocked,strAltText,"locked")
end if
end if
Response.Write "</a>" & vbNewline
end if
That's All :^)