Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 General Discussions

Reply
 
Thread Tools Display Modes
  #1  
Old 04-21-2012, 04:03 PM
mrcrx mrcrx is offline
 
Join Date: Jun 2004
Posts: 113
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Avatar images broken

I opened a ticket with vbulletin.com but they told me to come here.

Last month the folder that stored the avatar images was lost. I understand the images are gone but is there anyway I can globally reset all the broken image avatars back to the default image? I have 86,000 members. Asking everyone to do it will take a very long time and there is no way I can go into each and every profile to repair this. Anyone have any suggestions?
Reply With Quote
  #2  
Old 04-21-2012, 05:42 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I think you would need to write a script to remove the records from the customavatar table where the file doesn't exist any more.

(Sorry, I originally posted that you should truncate the table, but then I remembered that you said you lost the files a month ago, so if you were to truncate the table you'd lose any avatars that were uploaded since then).
Reply With Quote
  #3  
Old 04-21-2012, 05:56 PM
mrcrx mrcrx is offline
 
Join Date: Jun 2004
Posts: 113
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Know anyone that can write a script like that?
Reply With Quote
  #4  
Old 04-21-2012, 08:12 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

OK, first, use at your own risk! (ETA ...and if you decide you don't want to risk it, I understand). You should backup your database first, or at least the customavatar table.

Upload the attached file to your forum directory, then point your browser at it (i.e. www.mydomain.com/forum/fixavatars.php). You must be logged in as an admin. I'm not sure how long it will take, but it won't look like it's doing anything until it's done (it'll look like it's taking a long time to load the page), so be patient.

If it works, when you run it a second time it should immediately tell you that it removed 0 rows.
Attached Files
File Type: php fixavatars.php (1.3 KB, 45 views)
Reply With Quote
  #5  
Old 04-21-2012, 11:14 PM
mrcrx mrcrx is offline
 
Join Date: Jun 2004
Posts: 113
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thank you! I will try this tomorrow morning when I have less traffic.
Reply With Quote
  #6  
Old 04-21-2012, 11:22 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You know, I read your post again and you say you want to set them "back to the default image". I'm not sure if this will do that - the users may end up with no avatar (that's what happened when I tested it, but that's what my test site has by default). What do you get as the default image (and did you have to configure that somehow?).
Reply With Quote
  #7  
Old 04-22-2012, 01:20 AM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

There is no default avatar for users. Default is to have no avatar at all. So, Kevin's script may set the site back to default (no avatar), not back to some default avatar.
Reply With Quote
  #8  
Old 04-22-2012, 08:31 AM
mrcrx mrcrx is offline
 
Join Date: Jun 2004
Posts: 113
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ok, I tried running the script.

The first time I ran it the results came back in 30 secs.

It said Removed 15252 rows from customavatar

The second time I ran it it came back with

Removed 0 rows from customavatar

I think it worked. Thank you!

Can this be changed to fix my broken profile and signature pictures as well?

What I ment by default avatar was the image that shows up if you have no avatar at all. In my case it is a Silhouette of a person.
Reply With Quote
  #9  
Old 04-22-2012, 09:00 AM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Try going to Maintenance in the admincp, and under General Update Tools (or Update Cunters if you have an older version) run Rebuild Custom Avatar Thumbnails.
Reply With Quote
  #10  
Old 04-22-2012, 09:14 AM
mrcrx mrcrx is offline
 
Join Date: Jun 2004
Posts: 113
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ok, I did that. Not sure what that did. However I am seeing broken images for the thumbnail of the avatar in my recent post section. Is this another spot that needs to be repaired?

--------------- Added [DATE]1335090127[/DATE] at [TIME]1335090127[/TIME] ---------------

Something odd is going on. Depending on the page I am viewing will now depend on if the link is broken.

2 examples


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 04:52 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.05509 seconds
  • Memory Usage 2,261KB
  • Queries Executed 12 (?)
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)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)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
  • (1)postbit_attachment
  • (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
  • postbit_attachment
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete