Jump to content

Community

Adriano Faria

Languages Flags on Board Top

Recommended Posts

Recently I migrated on new hosting where the Suite with installed plugin v1.0.1 gave HTTP 500 error.

When I tried to reinstall the plugin installation failed every time with the error: 'Sorry, you do not have permission for that! 1S111/1'. A permissions for newly created files and folders were 644 & 777 respectively, they were correct. Previous version 1.0.0 installed just fine.

I made some research with Get Ready For IPS script and found the cause. It was in suhosting PHP extension values below then recommended ones. Here they are:

suhosin.post.max_vars >= 4096
suhosin.request.max_vars >= 4096
suhosin.get.max_value_length >= 2000
suhosin.post.max_value_length >= 10000
suhosin.request.max_value_length >= 10000
suhosin.request.max_varname_length >= 350

After adjusting mentioned settings plugin was successfully installed and run :thumbsup:

Edited by Safety1st

Share this post


Link to post
Share on other sites

Probably because the template this plugin extends isn't used on this page, so...

EDIT: you can see that doesn't appear the user info (for logged in users) or the Sign In or Sign Up links (for guests). That's exactlythe area extended by this plugin.

Share this post


Link to post
Share on other sites

Hi, 

this plugin has worked well for me, until I decided to move forum to https

Everything moved well, except there are four items that IPS support identified as related to this plugin that has hard link to http still.

 

Mixed Content: The page was loaded over HTTPS, but requested an insecure image 'http://sitename/uploads/set_resources_1/84c1e40ea0e759e3f1505eb1788ddf3c_flags16.png'. This content should also be served over HTTPS.

Mixed Content: The page at 'sitename' was loaded over HTTPS, but requested an insecure image 'http://sitename/uploads/set_resources_1/d0e70b4cbb9ab8afb1bc1065a3f8487a_subitem_stem.png'.

also

/uploads/set_resources_1/d0e70b4cbb9ab8afb1bc1065a3f8487a_subitem_stem@2x.png

/uploads/set_resources_1/84c1e40ea0e759e3f1505eb1788ddf3c_flags32.png'

Share this post


Link to post
Share on other sites

It happens that the plugin hasn't any HTTP hardcoded in the template. It uses the IPS functions and CSS to display flags.

Template:

				<ul class='ipsList_inline'>
					{{foreach $languages as $id => $lang }}
						<li>
							{{$url = \IPS\Http\Url::internal( 'app=core&module=system&controller=language&id='.$id, 'front' )->csrf();}}
							<a data-ipsTooltip data-ipsTooltip-label=" {$lang->title}" href='{$url}'><i class='{$lang->get__icon()}'></i></a>
						</li>
					{{endforeach}}
				</ul>

Function:

	/**
	 * Get Icon
	 *
	 * @return	string
	 * @note	Works on Unix systems. Partial support for Windows systems.
	 */
	public function get__icon()
	{
		return "ipsFlag ipsFlag-{$this->getCountry()}";
	}

CSS (which is default from IPS):

/* Normal */

.ipsFlag {
	width: 16px;
	height: 16px;
	background: url("{resource="flags16.png" app="core" location="global"}") no-repeat;
	display: inline-block;
	vertical-align:text-top;
	line-height:16px;
}

.ipsFlag.ipsFlag-ad{background-position:0 -352px;}
.ipsFlag.ipsFlag-ae{background-position:0 -368px;}
.ipsFlag.ipsFlag-af{background-position:0 -384px;}
...
...
...

That's all. No HTTP or HTTP anywhere.

Share this post


Link to post
Share on other sites
On 2/1/2016 at 9:32 PM, Adriano Faria said:

Screenshot.PNG.bb19af3a655c4d0a0c6faeb60

This plugin will display the languages flags on board top so the user can swap between languages in a faster way.

 

How i download it?

Share this post


Link to post
Share on other sites
On 2/6/2016 at 11:10 PM, Adriano Faria said:
On 2/6/2016 at 11:09 PM, R-023 said:

Maybe it is nice to add a option to make the dropdown languages, as dropdown country flags ?

I'll take a look for a next version.

Any update on this @Adriano Faria it would be a great addition - thanks!

Share this post


Link to post
Share on other sites

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...