PDA

View Full Version : Prune on Locked Topics


G0D
27 Jun 2001, 06:59
File to edit: thread.php (in /admin/)
I think this can also be done with the thread.php in /mod/

Find:
doformheader("thread","prunedate");
ABOVE it add:

// 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:
if ($action=="prunedate") {
REPLACE it with:
if (($action=="prunedate") || ($action=="prunelockdate")) {


find:
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:
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:
$threads=$DB_site->query("SELECT threadid FROM thread LEFT JOIN forum USING (forumid) WHERE $forumcheck thread.lastpost<=$datecut");
REPLACE it with:

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:
if ($action=="prunedatesel") {
REPLACE it with:
if (($action=="prunedatesel") || ($action=="prunelockdatesel")) {


Find:
$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:
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");
}

stroppytart
27 Jun 2001, 15:21
so what does it do?

G0D
27 Jun 2001, 16:14
gonna make a massmove locked topics script 2.

G0D
27 Jun 2001, 16:17
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.