06-26-2001, 10:00 PM
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");
}
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");
}