Avatars

If you want to know something or have a problem, look here first

Moderators: The Krew, The Kurators

User avatar
The Kaptain
Site Admin
Posts: 495
Joined: Sun Feb 23, 2014 12:48 pm

Avatars

Post by The Kaptain »

Since the forum has gone SSL (ie a secure hosting) you will have noticed that some pages show a 'mixed content' error. This is due to remote images being hosted on non SSL sites. I am working on a solution for images posted on the forum, but this will not work with avatars.

Accordingly, the ability to link remote avatars will be removed from the end of this month.

To continue to use avatars you must upload them to the forum. You can either upload from your computer or from a remote URL as you can see from the screenshot below. All avatars that are not uploaded to the forum will be removed at the end of the month.
screenshot_143.jpg
You do not have the required permissions to view the files attached to this post.
The man with the big stick
kaspir
Posts: 5
Joined: Wed Nov 16, 2016 8:26 am
Location: USA

Re: Avatars

Post by kaspir »

I now see and like the motivation mate! :smt023

Many others using phpBB are going to bow to you.

I already do for seeing demand where others can't see! #bowtothekaptain
User avatar
The Kaptain
Site Admin
Posts: 495
Joined: Sun Feb 23, 2014 12:48 pm

Re: Avatars

Post by The Kaptain »

Thanks Greg. I have a 'bodge' in progress which I will make sure works before I progress to a full extension.
The man with the big stick
kaspir
Posts: 5
Joined: Wed Nov 16, 2016 8:26 am
Location: USA

Re: Avatars

Post by kaspir »

I believe it's a shame, that phpBB hasn't implemented an event, function or w/e solution to already to handle http images by now on SSL sites. We can't be the only ones looking to do the same thing, without spending 100's in cash. I tell everyone I'm a novice, but I know where there is will, there is a way!

I'll be rooting for you.
Image
Learning phpBB - my newbie extensions & contributions progress. :)
TheTopFew.com - Discuss, advertise & backlink your sites. SEO helping authors!
User avatar
The Kaptain
Site Admin
Posts: 495
Joined: Sun Feb 23, 2014 12:48 pm

Re: Avatars

Post by The Kaptain »

Just a reminder that if you haven't already done so, there is just a week left to upload your avatar to the forum. After December 1st the ability to link remote avatars will be removed.

Image
The man with the big stick
kaspir
Posts: 5
Joined: Wed Nov 16, 2016 8:26 am
Location: USA

Re: Avatars

Post by kaspir »

Aww... but but.. but!

I just added my matching rotate ava/sig to my profile here :cry:

There's always another way mate, now you got me motivated to find a way to only allow https 'remote' avatars!

(i'll be back!)


//EDIT: 99% of the time, someone thought of it first --> http://stackoverflow.com/questions/3656 ... -in-an-url

This link pertains to phpbb even, how sweet is that! I'll test this.. be back again. GG
Image
Learning phpBB - my newbie extensions & contributions progress. :)
TheTopFew.com - Discuss, advertise & backlink your sites. SEO helping authors!
kaspir
Posts: 5
Joined: Wed Nov 16, 2016 8:26 am
Location: USA

Re: Avatars

Post by kaspir »

Done. If you should decide to use man.

Okay, so here's my end result. It works. However, I didn't use that code from stackoverflow.com, I simply edited one line of code. The TICKER, is if phpBB ever changes this file in future updates, your edit would be overwritten. Good news is, in less than 5min, this will work for you, and only https remote avatars, and throwback an URL error already implemented by phpBB, to the user if it's not!

See line#89 in /phpbb/avatar/driver/remote.php here:

Code: Select all

// Check if this url looks alright
// This isn't perfect, but it's what phpBB 3.0 did, and might as well make sure everything is compatible
if (!preg_match('#^(http|https|ftp)://(?:(.*?\.)*?[a-z0-9\-]+?\.[a-z]{2,4}|(?:\d{1,3}\.){3,5}\d{1,3}):?([0-9]*?).*?\.('. implode('|', 	$this->allowed_extensions) . ')$#i', $url))
		{
			$error[] = 'AVATAR_URL_INVALID';
			return false;
		}

Remove the http & ftp (didn't test ftp yet) like so

Code: Select all

// Check if this url looks alright
// This isn't perfect, but it's what phpBB 3.0 did, and might as well make sure everything is compatible
if (!preg_match('#^(https)://(?:(.*?\.)*?[a-z0-9\-]+?\.[a-z]{2,4}|(?:\d{1,3}\.){3,5}\d{1,3}):?([0-9]*?).*?\.('. implode('|', 	$this->allowed_extensions) . ')$#i', $url))
		{
			$error[] = 'AVATAR_URL_INVALID';
			return false;
		}

Save, upload, purge cache.. go test. Works on my site. Here's s/s of the user return http error:

Image
Image
Learning phpBB - my newbie extensions & contributions progress. :)
TheTopFew.com - Discuss, advertise & backlink your sites. SEO helping authors!
User avatar
The Kaptain
Site Admin
Posts: 495
Joined: Sun Feb 23, 2014 12:48 pm

Re: Avatars

Post by The Kaptain »

Thanks, I'll check that out once the brain is working properly
The man with the big stick
User avatar
The Kaptain
Site Admin
Posts: 495
Joined: Sun Feb 23, 2014 12:48 pm

Re: Avatars

Post by The Kaptain »

UPDATE

Remote Avatars will not now be disallowed. I have added an extension to the forum that now proxys all non ssl images to a remote ssl host. Now the padlock in the address bar will remain green and will no longer show a 'mixed content' error.

You will still be able to upload Avatars to the forum server if you wish.
The man with the big stick
HiFi Kabin : Disclaimer