Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 03-28-2011, 11:07 AM
Chadi's Avatar
Chadi Chadi is offline
 
Join Date: May 2004
Location: USA
Posts: 2,043
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Mass Delete User Albums

<blockquote> How do I mass delete all user albums in 3.8? </blockquote>
Reply With Quote
  #2  
Old 04-09-2011, 11:00 AM
Chadi's Avatar
Chadi Chadi is offline
 
Join Date: May 2004
Location: USA
Posts: 2,043
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Can someone please help?
Reply With Quote
  #3  
Old 04-10-2011, 09:19 PM
CRDeveloper's Avatar
CRDeveloper CRDeveloper is offline
 
Join Date: Aug 2009
Location: Costa Rica
Posts: 95
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I need to do it on vb 4 too!
Reply With Quote
  #4  
Old 04-18-2011, 05:37 PM
Chadi's Avatar
Chadi Chadi is offline
 
Join Date: May 2004
Location: USA
Posts: 2,043
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Anyone? Thanks
Reply With Quote
  #5  
Old 04-18-2011, 08:01 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Warning: try this at your own risk - back up your database first. There is no "are you sure you want to do this message". You have been warned.

I only did one test to see if this worked at all (on vb 3.8.3 - I have no idea if this will work for vb4), but here it is: make a plugin using hook location admin_maintenance and this code:

Code:
if ($_REQUEST['do'] == 'deleteallalbums')
{
    require_once(DIR . '/includes/functions_album.php');
    print_dots_start("Deleting all albums ");
    do 
    {
        $albuminfo = $vbulletin->db->query_first("
		SELECT album.*, user.username
		FROM " . TABLE_PREFIX . "album AS album
		LEFT JOIN " . TABLE_PREFIX . "user AS user ON (album.userid = user.userid)"
	    );
        if (!$albuminfo)
        {
  	    break;
        }
        $albumdata =& datamanager_init('Album', $vbulletin, ERRTYPE_STANDARD);
        $albumdata->set_existing($albuminfo);
        $albumdata->delete();
    } while (1);
         print_dots_stop();
	print_cp_message("Done.",
		defined('CP_REDIRECT') ? CP_REDIRECT : NULL,
		1,
		defined('CP_BACKURL') ? CP_BACKURL : NULL,
		defined('CP_CONTINUE') ? true : false
	);
}

Then when you're sure you're ready to try it, type in the url [your forum]/admincp/misc.php?do=deleteallalbums .

You probably now want to delete or at least disable that plugin.

ETA: for anyone who feels like confirming it's legit - I used the code from the file album.php, the "do == killalbum" section that gets called when a user deletes an album. The first query I got from fetch_albuminfo() in includes/functions_album.php (but I removed the WHERE for the userid).
Reply With Quote
  #6  
Old 04-18-2011, 08:59 PM
Chadi's Avatar
Chadi Chadi is offline
 
Join Date: May 2004
Location: USA
Posts: 2,043
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks for your help. Can any coder here confirm this plugin looks legit?
Reply With Quote
  #7  
Old 10-12-2013, 01:51 PM
paulgee paulgee is offline
 
Join Date: Nov 2006
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

there is an easier way?

if you don't want albums at all just switch them off i.e.
in vboptions > user profile options > enabled profile features

then back up your database............

to remove all existing albums use phpmyadmin, locate usually VB# albums and select it then click empty on you phpadmin panel.

you can do this with album images as well.

doing this saved me tons of space in my database and stopped spammers using the albums area as a spamming tool.

Regards
Paul
Reply With Quote
  #8  
Old 08-29-2015, 03:45 PM
yotsume's Avatar
yotsume yotsume is offline
 
Join Date: Dec 2006
Posts: 844
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

In VB 37x I need a way to delete orphaned albums of users that were deleted who had created albums. When these users were deleted their albums remain and can NOT be accessed but their thumbnails show up.

I would rather keep albums of current members...

UPDATE: Silly me! The solution is way too simple. Just use phpmyadmin and delete the tables in vb_album related to the orphaned User IDs. PROBLEM SOLVED!
Reply With Quote
Reply


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 03:05 AM.


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.04062 seconds
  • Memory Usage 2,226KB
  • 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_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (8)post_thanks_box
  • (8)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (8)post_thanks_postbit_info
  • (8)postbit
  • (8)postbit_onlinestatus
  • (8)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
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete