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)
 MOD: Resetting Forum Dates when all Topics Removed
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

HuwR
Forum Admin

United Kingdom
20592 Posts

Posted - 13 November 2000 :  08:50:40  Show Profile  Visit HuwR's Homepage
From a discussion in another Topic with Kat. I thought others might like this too.

basically it will set the Forum date back to it's creation date if you delete all the Topics.

You will need to add a new field in FORUM_FORUM called
F_CREATED varchar (20) NULL

Next you will need to make three changes, two in post_info.asp and one in pop_delete.asp

<font color=blue><b>pop_delete.asp</b></font id=blue>
<pre id=code><font face=courier size=2 id=code>
search for <b>strSql = "UPDATE " & strTablePrefix & "FORUM "</b>
look for the lines

if strLast_Post <> "" then
strSql = strSql & ", F_LAST_POST = '" & strLast_Post & "' "
if strLast_Post_Author <> "" then
strSql = strSql & ", F_LAST_POST_AUTHOR = " & strLast_Post_Author
end if
end if

before the second end if, insert the following....
<font color=red>else
strSql = strSql & ", F_LAST_POST = F_CREATED"
strSql = strSql & ", F_LAST_POST_AUTHOR = NULL"
</font id=red>
</font id=code></pre id=code>

<font color=blue><b>post_info.asp</b></font id=blue>
Search for <b>strSql = "INSERT INTO " & strTablePrefix & "FORUM "</b> you will find it in two places, the first is for forums, the secound URLs. You can change both it dowesn't matter, but the first is the important one.

Cahnge the INSERT as follows, Red lines denote additions, blue are original.
<pre id=code><font face=courier size=2 id=code>
<font color=blue>
strSql = strSql & ", F_LAST_POST"
</font id=blue><font color=red>
strSql = strSql & ", F_CREATED"
</font id=red><font color=blue>
strSql = strSql & ", F_SUBJECT"
strSql = strSql & ", F_DESCRIPTION"
strSql = strSql & ", F_TYPE"
strSql = strSql & ") VALUES ("
strSql = strSql & Request.Form("CAT_ID")
if strPrivateForums = "1" then
strSql = strSql & ", " & Request.Form("AuthType") & ""
strSql = strSql & ", '" & ChkString(Request.Form("AuthPassword"),"password") & "'"
strSql = strSql & ", '" & ChkString(Request.Form("AuthUsers"),"list") & "'"
end if
strSql = strSql & ", " & "'" & DateToStr(strForumTimeAdjust) & "'"
</font id=blue><font color=red>
strSql = strSql & ", " & "'" & DateToStr(strForumTimeAdjust) & "'"
</font id=red><font color=blue>
strSql = strSql & ", '" & txtSubject & "'"
strSql = strSql & ", '" & txtMessage & "'"
strSql = strSql & ", " & Request.Form("Type")
strSql = strSql & ")"
</font id=blue>
</font id=code></pre id=code>

That's all folks


<font color=blue>'Resistance is futile'</font id=blue>
  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.1 seconds. Powered By: Snitz Forums 2000 Version 3.4.07