Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)

Reply
 
Thread Tools Display Modes
  #1  
Old 03-04-2005, 05:34 PM
T3MEDIA T3MEDIA is offline
 
Join Date: Dec 2004
Posts: 944
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Universal Cron Job Clean up (collective work from vb.org programmers)

Hi I would love to make a super Cron Job. This one I would like to start cleans up removed users.

Here is the catch.

If the user is deleted it will check and remove them from:
vbarcade
Vbarticals
vbjurnals
photopost

etc etc etc until that person has nothing left on the site.
inculding attachments (inculding the attachment in PM hack)

This would be awsome for all users AND can work together with alot of hacks!

We could make it like a Linux kind of thing in the sense we all add to it untill almost any hack on here can be used with it if needed.

Can we start this together guys?

(Pulls up britches) WELP! >ahhh< I made the idea... >Sniffff< any one else in des hear parts can add to it?

I do not have a problem testing and handling the submitions and updates. Also I can handle the version dates and submition of authors.
Reply With Quote
  #2  
Old 03-05-2005, 08:47 PM
T3MEDIA T3MEDIA is offline
 
Join Date: Dec 2004
Posts: 944
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

no one?
Reply With Quote
  #3  
Old 03-05-2005, 09:33 PM
lasto lasto is offline
 
Join Date: Jan 2002
Posts: 1,514
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

not sure how to do the hack but what would happen if people never had the following hacks installed

vbarcade
Vbarticals
vbjurnals
photopost

because out of them i only have photopost but its still a good idea u came up as it would make the board and database a lot cleaner.
Reply With Quote
  #4  
Old 03-06-2005, 10:53 AM
T3MEDIA T3MEDIA is offline
 
Join Date: Dec 2004
Posts: 944
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

nothing. the cron job will do this...
gather a list of users right...

look in all areas (for the most common hacks)
so arcade table, photopost ect...
if there is a user hanging around that is NOT in the userlist it is safe to say that user is deleted thus remove leftovers.

If you do not have lets say the Arcade tables.... then nothing will show.
Same way if you DO have the arcade but alot of users never used it.
nothing will happen.

It only removed orphan files, tables of deleted users.

Now all we need is some nice people to start and adding to this super cron job.
Reply With Quote
  #5  
Old 03-09-2005, 12:13 AM
T3MEDIA T3MEDIA is offline
 
Join Date: Dec 2004
Posts: 944
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

come on guys?
Reply With Quote
  #6  
Old 03-19-2005, 03:15 PM
T3MEDIA T3MEDIA is offline
 
Join Date: Dec 2004
Posts: 944
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

wow. I will give it a bit more time if not I will drop the idea.
Reply With Quote
  #7  
Old 03-19-2005, 04:21 PM
tnguy3n's Avatar
tnguy3n tnguy3n is offline
 
Join Date: May 2003
Location: U of I, Iowa
Posts: 846
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

it's fairly easy to write the script; however, for some ppl who don't have either vbarcade, Vbarticals, vbjurnals or photopost (i don't have vbarticle nor vbjournal nor photopost), it gives an error in mysql DELETE statement.
Reply With Quote
  #8  
Old 03-20-2005, 12:24 PM
T3MEDIA T3MEDIA is offline
 
Join Date: Dec 2004
Posts: 944
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I thought I would get the "it's easy"s.
Ok dont worry about the errors how can you help? I would love to hear how you can implement your ideas to this project.
Reply With Quote
  #9  
Old 03-20-2005, 01:27 PM
tnguy3n's Avatar
tnguy3n tnguy3n is offline
 
Join Date: May 2003
Location: U of I, Iowa
Posts: 846
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

However, you can work around to avoid these mysql errors, i think.

this vbcronjob would delete and clean up all article, posts, subscriptions, and stuffs related to the users who have 0 posts. It's configurable btw.

PHP Code:
<?php

error_reporting
(E_ALL & ~E_NOTICE);

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

// ############## cronjob settings ##############
$vbarticle 'yes'// delete users articles
$vbjournal 'yes'// delete users journal
$photopost 'yes';
$lastactivity '30'// days since the user last visited forums
$totalpost '0'// delete users that has XX or less than XX post

// ############## start main script ##############
// no longer editting necessary below this

$getusers $DB_site->query("
    SELECT * FROM " 
TABLE_PREFIX "user
    WHERE posts <= '" 
$totalpost "'
    AND lastactivity <= '" 
intval(TIMENOW - ($lastactivity 86400)) . "'
"
);

while (
$users $DB_site->fetch_array($getusers))
{
    
$userid $users['userid'];

    
// clean all subscription, log, text, info of the user
    
$DB_site->query("DELETE FROM " TABLE_PREFIX "user WHERE userid=$userid"); flush();
    
$DB_site->query("DELETE FROM " TABLE_PREFIX "userfield WHERE userid=$userid"); flush();
    
$DB_site->query("DELETE FROM " TABLE_PREFIX "usertextfield WHERE userid=$userid"); flush();
    
$DB_site->query("DELETE FROM " TABLE_PREFIX "subscribeforum WHERE userid=$userid"); flush();
    
$DB_site->query("DELETE FROM " TABLE_PREFIX "subscribethread WHERE userid=$userid"); flush();
    
$DB_site->query("DELETE FROM " TABLE_PREFIX "event WHERE userid=$userid"); flush();
    
$DB_site->query("DELETE FROM " TABLE_PREFIX "customavatar WHERE userid=$userid");
    
$DB_site->query("DELETE FROM " TABLE_PREFIX "access WHERE userid=$userid"); flush();
    
$DB_site->query("DELETE FROM " TABLE_PREFIX "pm WHERE userid=$userid"); 
    
$DB_site->query("DELETE FROM " TABLE_PREFIX "pmreceipt WHERE userid=$userid"); flush();
    
$DB_site->query("DELETE FROM " TABLE_PREFIX "session WHERE userid=$userid"); flush();
    if(
$vbarticle == 'yes'){$DB_site->query("DELETE FROM " TABLE_PREFIX "vbarticle WHERE userid=$userid");}
    if(
$vbjournal == 'yes'){$DB_site->query("DELETE FROM " TABLE_PREFIX "journal WHERE userid=$userid");}
    if(
$photopost == 'yes'){$DB_site->query("DELETE FROM " TABLE_PREFIX "photopost WHERE userid=$userid");}

}

// log actions
log_cron_action('Universal Cronjob Cleanup.'$nextitem);

?>
you can add email feature to email users before delete them as you like. You can read more of this thread, https://vborg.vbsupport.ru/showthrea...threadid=75740 for ref.
Reply With Quote
  #10  
Old 03-24-2005, 05:54 PM
T3MEDIA T3MEDIA is offline
 
Join Date: Dec 2004
Posts: 944
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

woah nice action! can we release this? (we... lol you did the work.)
I have no quarms testing for you.
what errors you get so far?
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 06:32 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04382 seconds
  • Memory Usage 2,271KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete