MyBB Community Forums

Full Version: How to check if the users current avatar is located at a specific URL?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Is there a way of checking if a Users current avatar is located at a specific URL?
Yeah, it's possible and quite simple really.. Their's two ways to do this, which I'll explain below.

First Method:
Users & Groups -> Users -> Find Users -> Type in the username and go to their profile. Then after you're on their profile, go over to the avatar tab and look for "or Specify Avatar URL"

Second Method:
Right click on their avatar, and click "Copy Image Address" and then paste it somewhere.
(2014-12-17, 04:14 AM)PrivateDonut Wrote: [ -> ]Yeah, it's possible and quite simple really.. Their's two ways to do this, which I'll explain below.

First Method:
Users & Groups -> Users -> Find Users -> Type in the username and go to their profile. Then after you're on their profile, go over to the avatar tab and look for "or Specify Avatar URL"

Second Method:
Right click on their avatar, and click "Copy Image Address" and then paste it somewhere.

I didn't explain myself properly.

I was meaning how to check using an IF statement using PHP.

So, if a Users current avatar URL == "http://www.example.com", then, do "X".

I just don't know the required PHP syntax to achieve this.
(2014-12-17, 04:34 AM)Greg Winston Wrote: [ -> ]
(2014-12-17, 04:14 AM)PrivateDonut Wrote: [ -> ]Yeah, it's possible and quite simple really.. Their's two ways to do this, which I'll explain below.

First Method:
Users & Groups -> Users -> Find Users -> Type in the username and go to their profile. Then after you're on their profile, go over to the avatar tab and look for "or Specify Avatar URL"

Second Method:
Right click on their avatar, and click "Copy Image Address" and then paste it somewhere.

I didn't explain myself properly.

I was meaning how to check using an IF statement using PHP.

So, if a Users current avatar URL == "http://www.example.com", then, do "X".

I just don't know the required PHP syntax to achieve this.

Ah I see, I misunderstood the question in general. I'll let someone else answer your question, as I'm not sure how to do it.

Are you looking to just stop users from uploading certain format images? Or just certain sites in general?
You could do this:
global $mybb;
 if(strpos($mybb->user['avatar'], 'http://www.example.com') !== false)
            {
                echo "YiIiHhHaAa"; // O.o
            }
https://gist.github.com/Zalvie/b6dbb656da65b80135ef

"oh hey lets make the devs happy by putting in more hooks"

<.<, ofc.

Also I still don't get why they don't actually parse the url before fetching it thus can fix the little "I'm going to add ?dateline cuz that totally works if there's already a query"
example
SELECT username,avatar FROM `mybb_users` WHERE avatar like '%gravatar%'
(2014-12-17, 11:11 AM)SvePu Wrote: [ -> ]You could do this:

global $mybb;
 if(strpos($mybb->user['avatar'], 'http://www.example.com') !== false)
            {
                echo "YiIiHhHaAa"; // O.o
            }

Thanks, that works well.