Rusnak PHP Scripts Support Forums

Full Version: Auto-Prune/Suspend v1.2.5 (+ Forum Listing Legend)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3
Note: In this mod some parts of it where taken from the normal pruning script so credits to it's creator Big Grin

Downloa: http://www.plunder.com/Auto-Prune-Suspen...http://www.plunder.com/Auto-Prune-Suspend-v1-2-5-Forum-Listing-Legend-download-9a4d
Support by kab012345

About:
Without this script you have to do manual pruning. Imagine if someone just made their forum and (the chance is low but still) right 2 seconds after the user registers the forum (not activates) you prune all not activated forums. That way the user didn't even have time to activate, but his forum got deleted.

Solution:

In this script you set the inactive day limit to 15 for example so when you run the mod it will ONLY prune the forums that haven't activated themselves for 15 days and the new user that just made his forum will be happy because his forum wont be deleted. So basically it Prunes only the users that have inactivated forums longer than the inactive day limit allows them.

Features:
+Change the inactive day limit to whatever you want
+Make it that the Pruning mod auto-runs every time you log in Admin Panel (so you don't have to worry about doing it)
+Extra: Comes together with the Forum Listing Mod
+You can choose between suspending and pruning

Changelog:
v1.1 - Fixed a glitch with coloring
v1.2 - Fixed another glitch and added a Suspension feature
v1.2.5 - Added the Forum Listing Mod and removed unneeded parts

Installation:

Files that will be edited: mconfig.php, linksbar.php, madmin.php, home.php
BEFORE DOING ANYTHING BACKUP THESE FILES

1. Download the rar, extract and upload all the files to create > adm
Note: I uploaded it to mediafire because i couldnt attach it because of this error: The file upload failed. Please choose a valid file and try again. Error details: The attachment could not be found on the server.
It would be nice if a mod would confirm this has no virus'. When im able to attach i'll do it.

Link: http://www.mediafire.com/download.php?jzrnnjmmwkw

2. Open create > mconfig.php
Find:

Code:
//Ad Removal Price - This only works if you have installed the premium ad removal mod (requires premium membership)
$arprice = 3; //Price of ad removal.  Currently there is no way to measure impressions, this is to remove ads forever

Add after:

Code:
//Auto Prune day count - FOR AUTO-PRUNE MOD
$auto_prune_suspend = 0; //If you want the mod to suspend not delete input 1, otherwise 0
$auto_prune_date = 15; //Amount of days the forum owner has to
activate his/her forum
$auto_prune_login = 0; //If you want the Script to auto-run the script when you log into Admin Panel type 1, if not then 0.

These are the settings! Here's how to edit them:

$auto_prune_suspend - 1 if you want to suspend, 0 if prune
$auto_prune_date - Amount of days the user has to activate the forum. If he doesn't do it after this amount of days, the forum will be pruned.
$auto_prune_login - 1 if you want the mod to run every time you login admin panel (so you don't have to do it manually) or 0 if you will do it manually

Save and re-upload

3. Open create > adm > linksbar.php

Find:

Code:
echo "<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN'

Add before:
Code:
if ($auto_prune_suspend == 1) {
    $ap_link = "Auto-Suspend MOD";
} else {
    $ap_link = "Auto-Prune MOD";
}

Find:

Code:
<p align='left'><a href='prune1.php' target='main'>Prune Forums</a></p>

Add after:

Code:
<p align='left'><a href='autoprune1.php' target='main'>$ap_link</a></p>

Find:

Code:
<p align='left'><b><u><font color = '#52F3FF'>#> Standard Features:</font></u></b></p>

Add after:

Code:
<p align='left'><a href='forumlegend.php' target='main'>Edit Forum Listing Legend</a></p>

Save and re-upload.

4. Open create > adm > madmin.php

Find:
Code:
//Store the password in the session.
$_SESSION['password'] = $password;

Add after:

Code:
if ($auto_prune_suspend == 1 && $auto_prune_login == 1) {
    $_SESSION['sus'] = 2;
    $_SESSION['can'] = 0;
} else if ($auto_prune_suspend == 0 && $auto_prune_login == 1) { //If inactivated forums should be deleted now
    $_SESSION['can'] = 2;
    $_SESSION['sus'] = 0;
} else if ($auto_prune_login == 0) {
    $_SESSION['can'] = 0;
    $_SESSION['sus'] = 0;
}
if ($_SESSION['can'] == 2) {
    $link1 =  'autoprune.php';
} else if ($_SESSION['sus'] == 2) {
    $link1 = 'autosuspend.php';
} else {
    $link1 =  'home.php';
}

Find:

Code:
<FRAME name='main' src='home.php'>

Replace with:

Code:
<FRAME name='main' src='" . $link1 . "'>

Save and re-upload.

5. Open create > adm > home.php

Find:

Code:
include ("../mconfig.php");

Add after:

Code:
include ("color.conf.php");

Find:

Code:
    $i=0;
    while ($i < $num) {

    $fname=mysql_result($result,$i,"fname");
    $email1=mysql_result($result,$i,"email");
    $regdate=mysql_result($result,$i,"regdate");
    $ip=mysql_result($result,$i,"regip");
    $email2="mailto:".$email1;
    $furl = "http://www.".$fname.".".$dname;

    //Loop through forums and output them to a table

    echo"<tr>
          <td><div align='center'><a href='$furl' target='_blank'>$fname</a></div></td>
          <td><div align='center'><a href='$email2'>$email1</a></div></td>
        <td><div align='center'>$regdate</div></td>
          <td><div align='center'><a href='http://whois.domaintools.com/$ip' target='_blank'>$ip</div></td>
    </tr>";

    $i++;
    }

Replace with:

Code:
    for ($i = 0; $i < $num; $i++) {
    $row = mysql_fetch_assoc($result);
    $fname=$row['fname'];
    $email1=$row['email'];
    $regdate=$row['regdate'];
    $ip=$row['regip'];
    //$fname=mysql_result($result,$i,"fname");
    //$email1=mysql_result($result,$i,"email");
    //$regdate=mysql_result($result,$i,"regdate");
    /*if (pruneTrue($regdate, $i, $auto_prune_date) == TRUE) {        
    $color = "<font color='red'>" . $regdate . "</font>";
    } else {        $color = $regdate;
    }*/
    $regdatenew = legendUse($regdate , $fname, $auto_prune_date, $expired[0], $expired[1], $suspended[0], $suspended[1], $normal[0], $normal[1]);
    $email2="mailto:".$email1;
    $furl = "http://www.".$fname.".".$dname;

    //Loop through forums and output them to a table

    echo"<tr>
          <td><div align='center'><a href='$furl' target='_blank'>$fname</a></div></td>
          <td><div align='center'><a href='$email2'>$email1</a></div></td>
        <td><div align='center'>$regdatenew</div></td>
          <td><div align='center'><a href='http://whois.domaintools.com/$ip' target='_blank'>$ip</div></td>
    </tr>";

    }

Find:

Code:
$conn = mysql_connect($dbhost, $dbuser, $dbpass) or die ("Cannot Connect to Database");
mysql_select_db($dbname);

Add after:

Code:
if ($_SESSION['message'] != NULL) {
    $link2 =  $_SESSION['message'];  
} else {
        $link2 = ' ';
}

Find:

Code:
<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'>
<title>Multiforums</title>
</head>

<body>
<div align='center'>";

Replace with:

Code:
<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'>
<title>Multiforums</title>
</head>

<body>
" . $link2 . "<br>
<div align='center'>";

Find:

Code:
    <td width='25'><div align='center'><strong>Reg IP Address</strong></div></td>
    </tr>";

Add after:

Code:
    $_SESSION['message'] = NULL;

Save and re-upload

Enjoy and please rep me for this Big Grin
Note: Before you say that something doesn't work, check if you didn't do something wrong or if there isn't some other mod interfering with this one first.

Over 40 views and only 1 rep? Come on it takes only 1 click Tongue
Nice work.
Thanks, rep if you like Tongue
v1.1 - Everyone please update your home.php part, there was a bug with the coloring!
Great script! Is there a way to suspend a forum instead of just deleting it?
I could implement it in the next version Smile
Very nice. Smile
Thanks, Rep is appreciated Smile

v1.2.5 OUT! It is important to download the new .rar and overwrite the old files with the new ones. Also some file edits are required!

2 new versions today lol, but i added the second only because it would work good with my other mod
Thanks a lot! Adding +Rep, this mod is pretty great Big Grin
Thanks a lot to you too Smile
Can you add an inactive forums pruning option for the next release ? (based on the last date when the main administrator logged in, the date of the last post or the date when the last member registered)

It would be great . +1 rep
Pages: 1 2 3
Reference URL's