vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=251)
-   -   Delete all attachments for user (https://vborg.vbsupport.ru/showthread.php?t=296552)

Kevlar 03-27-2013 02:39 AM

Delete all attachments for user
 
Is there anyway to delete all the attachments for a user in vB4? I banned a user with over 800 attachments which serve no value to my forum. Is there an easy way to delete them without going through 80 pages of attachments in the admincp?

ForceHSS 03-27-2013 03:33 AM

Login to his account or from admin panel is the only way

Zachery 03-27-2013 03:36 AM

How are your attachments stored?

Kevlar 03-27-2013 01:15 PM

Quote:

Originally Posted by Zachery (Post 2412495)
How are your attachments stored?

In the file system ... currently we have about 40GB of attachments.

Brandon Sheley 03-27-2013 04:34 PM

You could do it with a sql query if you wanted, sorry I don't have the query for you though.

Kevlar 03-28-2013 12:59 PM

How would a SQL query delete the attachments in the file system?

Zachery 03-28-2013 04:43 PM

If you know the user, and the userid

go to /path/to/attachments/u/s/e/r/I/d/

This folder has their attachment files.

Kevlar 03-28-2013 11:19 PM

Ok... so I can delete the user's folder with their attachments in it. Cool, but what about the database?

delete from attachment where userid = (userid)?

Zachery 03-29-2013 06:07 PM

No, don't delete the users folder, the subfolder in there are for others. Just delete the attachment files.


Deleting them from the database gets more complicated. It'd probably be easier to manually reset the user's passwird and just go into his usercp and delete all of his attachments.

Kevlar 03-30-2013 03:25 PM

There has to be a better way... at 20 attachments per page (and this guy has 800 attachments), this is going to take forever. Plus not to mention this is just one user. There are probably hundreds that have to be done.

snakes1100 03-30-2013 03:41 PM

Does the user show up in your "Five Users Whose Attachments Take Up the Most Space" via the attachment stats?

If so, you can click view attachments of that user there, then do a select all, on each page, as it shows only 10 per page.

That will remove the files & the info from the post, not the fastest nor the easiest in your case of 800.

Change line 671 of admincp/attachment.php to 50 or 100 or higher etc...
Code:

$vbulletin->GPC['search']['results'] = 10;
You could also modify the link below if they arent.
http://www.yoururlhere.com/forums/ad...=USERNAME HERE

Kevlar 04-07-2013 06:15 PM

I will give this a shot and see what happens. I am hoping that will help solve the problem. The attachment stats though causes my server to timeout, so I will try by that new URL you provided.


All times are GMT. The time now is 05:49 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.01094 seconds
  • Memory Usage 1,728KB
  • 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
  • (1)bbcode_code_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (12)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete