News:

Wondering if this will always be free?  See why free is better.

Main Menu

Missing Avatar

Started by PokémonS, October 01, 2013, 11:09:44 AM

Previous topic - Next topic

PokémonS

SMF 2.0.4

Hi,
There are so many users using avatar from our gallery.

Screenshot: http://puu.sh/4EVDD.jpg

When I delete all of those avatars, which is still used by users, it will become 404 error in the image.
How to fix this problem? I believe 404 error in the image will increase loading page.

If it's fixed, then missing avatar will become default avatar, 'cuz I am using Default Avatar mod.

Thx.
きみと手をつなごう つらいときはもっと
ゼロからはじめよう ほら ほら 手をつなごう
みんな手をつなごう つらいときはもっと
力を合わせよう ほら ほら 手をつなごう

PokémonS

Found an old thread: http://www.simplemachines.org/community/index.php?topic=489062.0
Is this problem related to that thread?

I still dunno how to fix this.
きみと手をつなごう つらいときはもっと
ゼロからはじめよう ほら ほら 手をつなごう
みんな手をつなごう つらいときはもっと
力を合わせよう ほら ほら 手をつなごう

Kindred

there is nothing specifically to "fix" because it is working as intended. If you remove the target image, of course you get a 404.

That being said, If you have an issue with how a mod works, take it up in the mod thread (having a default avatar is not a default feature)
However there is a good chance the info in the other thread may work for you.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

PokémonS

Thanks for your answer,

But in Admin -> Forum -> Attachments & Avatar -> File Maintenance, there is an Attachment Integrity Check.
This function will check the avatar which is still in use by user.
This function will fix 404 error in the image.

I have tried it, functionally like I said above.
But sadly, it only fix avatar that uploaded by the user, not the present gallery.
きみと手をつなごう つらいときはもっと
ゼロからはじめよう ほら ほら 手をつなごう
みんな手をつなごう つらいときはもっと
力を合わせよう ほら ほら 手をつなごう

Kindred

why are you deleting avatars from the local system then?

The system assumes that you (as admin) can fix locally missing files.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

margarett

IIRC, the default avatar MOD specifies a... default avatar :P IF the user has selected none. In this case, the users HAVE selected an avatar but you removed the file. That's not what the MOD is expected to do...

I guess that the code where the avatars are loaded could eventually check if the file exists, but I don't actually see a reason why it should...
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

Arantor

QuoteI guess that the code where the avatars are loaded could eventually check if the file exists, but I don't actually see a reason why it should...

It really shouldn't.

Kindred

exactly...

Which leads me to re-ask my question....

Quote from: Kindred on October 03, 2013, 12:01:36 PM
why are you deleting avatars from the local system then?

The system assumes that you (as admin) can fix locally missing files.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

PokémonS

Quote from: Kindred on October 03, 2013, 12:01:36 PM
why are you deleting avatars from the local system then?
That's a bit talking about our forum, we're in process to "evolution". Visitors will increase during release of Pokemon X & Y. So our forum should be nice at any points. The old avatars is old, we're change it to new and attractive avatars.

Quote from: Kindred on October 03, 2013, 12:01:36 PM
The system assumes that you (as admin) can fix locally missing files.
Yes, I am an admin, what system? ._.
きみと手をつなごう つらいときはもっと
ゼロからはじめよう ほら ほら 手をつなごう
みんな手をつなごう つらいときはもっと
力を合わせよう ほら ほら 手をつなごう

Kindred

SMF.

and you can therefore fix any mising files by uploading the missing files by name -- or purging the database members table of people using the removed avatar.

Basically, once again, you are trying to use the system in a way that is farily specific to you and unlike anything that anoyone else would actually do.
(I don't think I have EVER deleted avatars form the local avatar list, running a forum for over 10 years)
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

margarett

As a quick solution, I guess you can put a SQL query in phpmyadmin to clear users avatar selection if it came from the default gallery.
(I actually understand what why you're doing that. You just did it the wrong way :P )
But just now I can't find it for you, sorry. I can try later...
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

PokémonS

Thanks margarett! I'll wait for the SQL query. :)
きみと手をつなごう つらいときはもっと
ゼロからはじめよう ほら ほら 手をつなごう
みんな手をつなごう つらいときはもっと
力を合わせよう ほら ほら 手をつなごう

margarett

Actually I think it's easier than that.
I haven't look into the code to confirm but, as far as my small test board with 5 test users tells me is:
- If the "members" table has the column "avatar" filled with something, be it a single file name or a folder/file string, it will try to open that file from "avatars" folder.
- If that column is empty, then it tries to load the avatar from "attachments" folder, using an obfuscated file name.

So, you just need to go to phpmyadmin, your SMF database and:

UPDATE smf_members
SET avatar = ''

And all users who had an avatar from the default gallery, have no avatar now.
IF THIS CONFLICTS with the mentioned MOD, I have no idea...
Why won't you backup, try and tell us? ;)
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

PokémonS

#13
Thanks margarett,

But I don't think the query will empty an avatar column which filled with filename in gallery.
The query looks like empty all of avatar column, am I right?

Edit:

I want like this:
- In SQL, avatar column which filled 001.png, 002.png... 493-fire.png, 493-water.png... 648.png, and 649.png is set to empty.

But I don't know how to make the query.
きみと手をつなごう つらいときはもっと
ゼロからはじめよう ほら ほら 手をつなごう
みんな手をつなごう つらいときはもっと
力を合わせよう ほら ほら 手をつなごう

margarett

Now you got me lost :P
What did you delete, exactly? Wasn't it all the contents of "avatars" folder?
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

PokémonS

Quote from: margarett on October 03, 2013, 02:13:59 PM
What did you delete, exactly? Wasn't it all the contents of "avatars" folder?

Yes, all content of "avatars" folder, which named 001.png to 649.png, some of avatars named like 493-fire.png.
きみと手をつなごう つらいときはもっと
ゼロからはじめよう ほら ほら 手をつなごう
みんな手をつなごう つらいときはもっと
力を合わせよう ほら ほら 手をつなごう

margarett

Then look again at what I said ;)
If my test board isn't lying to me, that column "avatar" should be empty if the avatars aren't there ;)

I just didn't test with remote avatars... Missed that, have to test.
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

PokémonS

I have try your query, and wow, it worked like what you said. :D
Even some users still use avatar from new gallery, at least there are no more 404 error in the image. :D

Thanks! :D
きみと手をつなごう つらいときはもっと
ゼロからはじめよう ほら ほら 手をつなごう
みんな手をつなごう つらいときはもっと
力を合わせよう ほら ほら 手をつなごう

Advertisement: