PDA

View Full Version : Avatar images broken


mrcrx
04-21-2012, 04:03 PM
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?

kh99
04-21-2012, 05:42 PM
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).

mrcrx
04-21-2012, 05:56 PM
Know anyone that can write a script like that?

kh99
04-21-2012, 08:12 PM
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.

mrcrx
04-21-2012, 11:14 PM
Thank you! I will try this tomorrow morning when I have less traffic.

kh99
04-21-2012, 11:22 PM
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?).

Lynne
04-22-2012, 01:20 AM
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.

mrcrx
04-22-2012, 08:31 AM
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.

kh99
04-22-2012, 09:00 AM
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.

mrcrx
04-22-2012, 09:14 AM
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 1335090127 at 1335090127 ---------------

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

2 examples

https://vborg.vbsupport.ru/external/2012/04/19.png
https://vborg.vbsupport.ru/external/2012/04/20.png

kh99
04-22-2012, 09:23 AM
Oh, right - 'Rebuild Custom Avatar Thumbnails' would only affect custom avatars, and we're looking for default avatars.

If your Recent Posts are cached it could take some time before it rebuilds. I think there's also a 'clear system cache' option somewhere that may do it. ETA It's a the top of the "Maintenance" menu in the adminCP.

mrcrx
04-22-2012, 09:28 AM
Thank you for all this help. Can this script be modified to fix my signature and profile broken links as well?

kh99
04-22-2012, 09:32 AM
Thank you for all this help. Can this script be modified to fix my signature and profile broken links as well?

Are they avatar related? I don't know how to answer because I don't know why they're broken. Signatures may be in the post cache, so you could truncate the postparsed table (or use rebuild post cache in the maintenance menu) and see if that helps. I don't know what the profile problem is.

mrcrx
04-22-2012, 09:35 AM
Are they avatar related? I don't know how to answer because I don't know why they're broken. Signatures may be in the post cache, so you could truncate the postparsed table (or use rebuild post cache in the maintenance menu) and see if that helps. I don't know what the profile problem is.

All related to the same issue. I was hacked last month and my entire images folder was lost. So anything that was stored there, avatars,profile pictures and attachments were lost and now show as broken. My skill level with this type of thing is low. I apologize in advance.

kh99
04-22-2012, 09:41 AM
Oh, I see...well, I think it probably can be modified to fix the profile pictures. I'm not sure about attachments. I suppose we could use the same method to remove broken attachments from the database, but I'm not sure what that will do to posts that include one - they still may end up as broken images.

mrcrx
04-22-2012, 09:46 AM
Ok no big deal. You have really helped me out. The site looks a lot better without all those broken thumbnails. Thank you again.

kh99
04-22-2012, 10:39 AM
OK, but profile pics turned out to be almost the same as avatars, so I'm attaching a modified script for that. I could look at attachments if I get a chance, but I think it's going to be more involved.

mrcrx
04-22-2012, 11:09 AM
Great. Thank you for yet another script. I will upload and run it right now.

Nirjonadda
06-02-2015, 08:36 AM
@kh99 , Please can you let me know, does fixavatars.php and fixprofilepics.php are still working for vB 4.2.3 ?

kh99
06-02-2015, 11:56 AM
Sorry, I don't know, and I don't really have time to set up a test. But I can't think of any reason why it wouldn't work. I don't think there's been any major database changes since then. It would be ideal if you could could close your forum and make a database backup first, then try it, so you can just restore if it doesn't work. Or better yet, try it on a test forum first.

Nirjonadda
06-02-2015, 12:06 PM
OK, I will check with test site and let you know. Do you have any chance to make a script for Rebuild Custom profile pictures Thumbnails?

thetechgenius
06-04-2015, 08:23 PM
I am pretty sure there is a Query you can run in PhpMyAdmin that will do exactly what your asking. But I don't know the exact query string, maybe someone else can help you with that. Sorry.