The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
![]()
<blockquote> How do I mass delete all user albums in 3.8? </blockquote>
|
#2
|
||||
|
||||
![]()
Can someone please help?
|
#3
|
||||
|
||||
![]()
I need to do it on vb 4 too!
|
#4
|
||||
|
||||
![]()
Anyone? Thanks
|
#5
|
|||
|
|||
![]()
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). |
#6
|
||||
|
||||
![]()
Thanks for your help. Can any coder here confirm this plugin looks legit?
|
#7
|
|||
|
|||
![]()
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 |
#8
|
||||
|
||||
![]()
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! |
![]() |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|