vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   auto-kick from group after X day without activity ? (https://vborg.vbsupport.ru/showthread.php?t=82103)

Essamz 05-27-2005 12:31 AM

auto-kick from group after X day without activity ?
 
hi ,,
is there a hack that remove the user from certain usergroup ? :ermm:

i have VIP usergroup ,, and i cant keep my eye on them every day and see if they are active or not ..
so it would be great idea to make this hack ,, :)

Andreas 05-27-2005 01:27 AM

primary or secondary?

Essamz 05-27-2005 01:44 AM

<u>primary </u>

remove them from usergroupid = 677

to Registered "usergroupid = 2"

Andreas 05-27-2005 01:51 AM

That is easy
PHP Code:

<?php
error_reporting
(E_ALL & ~E_NOTICE);

if (!
is_object($DB_site))
{
    exit;
}

$DB_site->query("UPDATE " TABLE_PREFIX "user SET usergroupid = 2 WHERE usergroupid = 677 AND lastactivity < " . (TIMENOW-X*86400));

log_cron_action('Inactive VIP Users reset to Registered'$nextitem);
?>

Replace X with the number of days, save this a a php-file in includes/cron, create a cron-job for it (to be run once/day for example) and you're done.

Essamz 05-27-2005 02:01 AM

thank you very much :)

Paul M 05-27-2005 02:11 AM

Quote:

Originally Posted by Essamz
primary

remove them from usergroupid = 677

to Registered "usergroupid = 2"

Usergroup 677 !!! Jesus .....

Andreas 05-27-2005 07:55 AM

Well, if you are experimenting a lot ... creating and deleting usergroups :D

The Ottoman 07-07-2006 12:17 PM

Quote:

Originally Posted by Andreas
That is easy
PHP Code:

<?php
error_reporting
(E_ALL & ~E_NOTICE);

if (!
is_object($DB_site))
{
    exit;
}

$DB_site->query("UPDATE " TABLE_PREFIX "user SET usergroupid = 2 WHERE usergroupid = 677 AND lastactivity < " . (TIMENOW-X*86400));

log_cron_action('Inactive VIP Users reset to Registered'$nextitem);
?>

Replace X with the number of days, save this a a php-file in includes/cron, create a cron-job for it (to be run once/day for example) and you're done.


If I wanted to run this against multiple usergroups (say group 123, 5 and 6), would I be correct in adjusting the syntax of the code to something along the lines of :

user SET usergroupid = 2 WHERE usergroupid = 677 OR 123 OR 5 OR 6 AND lastactivity....

rogersnm 07-07-2006 02:58 PM

Yes that would work fine :)

The Ottoman 07-11-2006 12:38 AM

So I've saved this code:
PHP Code:

<?php 
error_reporting
(E_ALL & ~E_NOTICE); 

if (!
is_object($DB_site)) 

    exit; 


$DB_site->query("UPDATE " TABLE_PREFIX "user SET usergroupid = 2 WHERE usergroupid = 15 AND lastpost < " 

(
TIMENOW-45*86400)); 

log_cron_action('Inactive VIP Users reset to Registered'$nextitem); 
?>

to a file called autokick.php, created a cron job, set it to log, and ran it manually, I just get a screen with the cron job name, and it just hangs.


I'm a tard, what am I doing wrong?


All times are GMT. The time now is 08:08 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.01565 seconds
  • Memory Usage 1,744KB
  • 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
  • (3)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete