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).