Version: , by (Guest)
Developer Last Online: Jan 1970
Version: Unknown
Rating:
Released: 06-26-2001
Last Update: Never
Installs: 0
No support by the author.
File to edit: thread.php (in /admin/)
I think this can also be done with the thread.php in /mod/
Find:
Code:
doformheader("thread","prunedate");
ABOVE it add:
Code:
// prune on locked topic by kennydies
doformheader("thread","prunelockdate");
maketableheader("Prune by locked topics");
makeinputcode("Delete locked threads with last post older than x days:<BR>(intensive if deleting a lot of threads)","daysdelete","0");
makeforumchoosercode("Forum","forumid",-1,"All forums");
makeyesnocode("Include sub forums","subforums");
doformfooter("Prune");
// prune on locked topic by kennydies
find:
Code:
if ($action=="prunedate") {
REPLACE it with:
Code:
if (($action=="prunedate") || ($action=="prunelockdate")) {
find:
Code:
doformheader("thread","prunedate");
maketableheader("Prune All Threads Automatically");
makehiddencode("forumid", "$forumid");
makehiddencode("daysdelete", "$daysdelete");
makehiddencode("subforums", "$subforums");
makehiddencode("confirm", "1");
doformfooter("Click Here to Prune All Threads Automatically","",2);
doformheader("thread","prunedatesel");
maketableheader("Prune Threads Selectively");
makehiddencode("forumid", "$forumid");
makehiddencode("daysdelete", "$daysdelete");
makehiddencode("subforums", "$subforums");
doformfooter("Click Here to Prune Threads Selectively","",2);
REPLACE it with:
Code:
if ($action=="prunedate") {
doformheader("thread","prunedate");
maketableheader("Prune All Threads Automatically");
makehiddencode("forumid", "$forumid");
makehiddencode("daysdelete", "$daysdelete");
makehiddencode("subforums", "$subforums");
makehiddencode("confirm", "1");
doformfooter("Click Here to Prune All Threads Automatically","",2);
doformheader("thread","prunedatesel");
maketableheader("Prune Threads Selectively");
makehiddencode("forumid", "$forumid");
makehiddencode("daysdelete", "$daysdelete");
makehiddencode("subforums", "$subforums");
doformfooter("Click Here to Prune Threads Selectively","",2);
} elseif ($action=="prunelockdate") {
doformheader("thread","prunelockdate");
maketableheader("Prune All Locked Threads Automatically");
makehiddencode("forumid", "$forumid");
makehiddencode("daysdelete", "$daysdelete");
makehiddencode("subforums", "$subforums");
makehiddencode("confirm", "1");
doformfooter("Click Here to Prune All Locked Threads Automatically","",2);
doformheader("thread","prunelockdatesel");
maketableheader("Prune Locked Threads Selectively");
makehiddencode("forumid", "$forumid");
makehiddencode("daysdelete", "$daysdelete");
makehiddencode("subforums", "$subforums");
doformfooter("Click Here to Prune Locked Threads Selectively","",2);
}
Find:
Code:
$threads=$DB_site->query("SELECT threadid FROM thread LEFT JOIN forum USING (forumid) WHERE $forumcheck thread.lastpost<=$datecut");
REPLACE it with:
Code:
if ($action=="prunedate") {
$threads=$DB_site->query("SELECT threadid FROM thread LEFT JOIN forum USING (forumid) WHERE $forumcheck thread.lastpost<=$datecut");
} elseif ($action=="prunelockdate") {
$threads=$DB_site->query("SELECT threadid FROM thread LEFT JOIN forum USING (forumid) WHERE open=0 AND $forumcheck thread.lastpost<=$datecut");
}
Find:
Code:
if ($action=="prunedatesel") {
REPLACE it with:
Code:
if (($action=="prunedatesel") || ($action=="prunelockdatesel")) {
Find:
Code:
$threads=$DB_site->query("SELECT threadid,thread.title FROM thread LEFT JOIN forum USING (forumid) WHERE $forumcheck thread.lastpost<=$datecut ORDER BY thread.lastpost DESC");
REPLACE it with:
Code:
if ($action=="prunedatesel") {
$threads=$DB_site->query("SELECT threadid,thread.title FROM thread LEFT JOIN forum USING (forumid) WHERE $forumcheck thread.lastpost<=$datecut ORDER BY thread.lastpost DESC");
} elseif ($action=="prunelockdatesel") {
$threads=$DB_site->query("SELECT threadid,thread.title FROM thread LEFT JOIN forum USING (forumid) WHERE open=0 AND $forumcheck thread.lastpost<=$datecut ORDER BY thread.lastpost DESC");
}
Show Your Support
This modification may not be copied, reproduced or published elsewhere without author's permission.
Originally posted by stroppytart so what does it do?
In your admin control panel there is an option called "prune".
It's a script to delete all your old posts etc. I just added an extra option so you can only delete all your locked topics.