Announcement

Collapse
No announcement yet.

Prune on Locked Topics

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Prune on Locked Topics

    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");
    }
    Last edited by G0D; Wed 27 Jun '01, 8:15am.

  • #2
    so what does it do?
    lilymud.com - up and running July 15th, 2001!

    Cotton Candy Blue | vB Original | Glassy | Green Lily | Blue & Gray | Turquoise & Black | Dust

    Comment


    • #3
      Mass Move Locked Topics

      gonna make a massmove locked topics script 2.
      Last edited by G0D; Wed 27 Jun '01, 8:37am.

      Comment


      • #4
        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.

        Comment

        widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
        Working...
        X