vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=33)
-   -   exclude usergroups from automatic user pruning (https://vborg.vbsupport.ru/showthread.php?t=91159)

waza 06-26-2005 10:00 PM

exclude usergroups from automatic user pruning
 
Hey,
this is my first (small) addon i made and probably it could be better, but it works...

What does this do?
This is actually an addon for the atomatic user pruning hack you can find here
with this hack you can exclude several usergroups from been pruned.

How to Install

Open your deleteinactive.php file

FIND
PHP Code:

// This only needs to be modified if you set above to false
$groupid=8

BELOW ADD
PHP Code:

//set this to false if you want to exclude some usergroups from pruning
$pruneall false;

// If you have set false above, you can set here the usergroups you do NOT wish to be modified, seperate each groupid with a space
$exclude "1 8 3"


FIND
PHP Code:

$prunedmembers $DB_site->query("
        SELECT * FROM `" 
TABLE_PREFIX "user`
        WHERE `posts` <= '
$maxposts'
        AND `lastactivity` <= '" 
. (TIMENOW - ($lastactivity 86400)) . "'
        AND `lastpost` <= '" 
. (TIMENOW - ($lastpost 86400)) . "' 
    "
); 

REPLACE WITH
PHP Code:

if($pruneall==true){
    
$prunedmembers $DB_site->query("
        SELECT * FROM `" 
TABLE_PREFIX "user`
        WHERE `posts` <= '
$maxposts'
        AND `lastactivity` <= '" 
. (TIMENOW - ($lastactivity 86400)) . "'
        AND `lastpost` <= '" 
. (TIMENOW - ($lastpost 86400)) . "' 
    "
);
}else{
$donotprune explode(" "$exclude);
    for(
$i=0$i<count($donotprune); $i++){
        
$endquery.="AND `usergroupid` != '".$donotprune[$i]."' ";
    }
    
$prunedmembers $DB_site->query("
        SELECT * FROM `" 
TABLE_PREFIX "user`
        WHERE `posts` <= '
$maxposts'
        AND `lastactivity` <= '" 
. (TIMENOW - ($lastactivity 86400)) . "'
        AND `lastpost` <= '" 
. (TIMENOW - ($lastpost 86400)) . "' $endquery 
    "
);



grz,
seba

Marco van Herwaarden 06-27-2005 08:50 AM

Thanks for sharing your work.

Could you please also provide the instructions in a (zipped) textfile. This makes it easier for future refence (upgrades for example) for those who installed it.

waza 06-27-2005 09:00 AM

K, I added a txt file with the instructions.


All times are GMT. The time now is 07:59 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01344 seconds
  • Memory Usage 1,731KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (4)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (3)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete