PDA

View Full Version : Mini Mods - ZH - Restrict A Browser


Ziki
19 Dec 2007, 20:57
This modification was brought to you by
KXDesign
http://www.kxdesign.com/


~Modification name
Restrict A Browser

~Modification description
This plugin restricts a certain browser from accessing your site.When that browser tries to access your site an alert will say that the browser is not supported and will close the window.

~Modification options

On/Off
Choose Browser type


~Modification info
File uploads: 0
Template edits: 0
Templates: 1
File edits: 0
Plugins: 1
SQL Queries: 0
Phrases: 5
Settings: 2

Install time: 3 sec
Install level: Easy]

~Modification installation

Step 1: Import Product



~Modification screenshots
None


~Modification copyright
This may not be distributed,released or claimed as your work without author's permission.

Ziki
19 Dec 2007, 20:58
~Reserved~

SEOvB
19 Dec 2007, 21:08
Instead of closing down the broswer, is it possible it redirects it to a page where you can download the browser at?

Ba$im
20 Dec 2007, 10:58
thanx.

cosy
20 Dec 2007, 17:11
can we get a option for custom message and a redirect url ?

TCooper
20 Dec 2007, 19:27
can we get a option for custom message and a redirect url ?
it should be pretty easy to redirect to a particular page if needed. You would have to edit his javascript to redirect to url instead of using

window.close()

I would try javascripts window location like

window.location = "http://www.siteyouwanthere.com"

unless he decides to make it a feature in his hack.
I personally havent tried using this yet or even his hack at that. I will as soon as I get around to upgrading my board but trying to hold of til gold... not wanting to deal with beta version at the moment.

360junkie
20 Dec 2007, 21:20
umm all they have to to to get by this is click

ok

no

then there on the site

Snake
21 Dec 2007, 16:28
Excellent!

ninjamaster
21 Dec 2007, 23:17
thank this will come in handy :)

Kzyl-orda
25 Jun 2008, 13:29
Nice, and i installed it, but i can choose just 1 browser, i want to kick both IE and Safari. Can you change it to multiple choise?
I was just able to make safari and IE blocked in the same script, so i'm ok, this is just a suggestion to improve your addon :)

This is how i modified the code to ban both the browser:
from:
<if condition="$vboptions[zh_restrict_type]==1">
<if condition="is_browser(ie)">
<script type="text/javascript">
alert("Internet Explorer is not welcome here, than your browser type has been blocked from our site. Please a supported one. We suggest you Firefox or Opera")
window.location = "http://www.url.com"
</script>
</if> </if>
To:
<if condition="$vboptions[zh_restrict_type]==1">
<if condition="is_browser(ie)">
<script type="text/javascript">
alert("Your browser type has been blocked from our site.Please a supported one.")
window.location = "http://www.url.com"
</script>
</if>
<if condition="is_browser(safari)">
<script type="text/javascript">
alert("Your browser type has been blocked from our site.Please a supported one.")
window.location = "http://www.url.com"
</script>
</if>
</if>
And
From:
<option value=\"1\" " . iif($setting['value']==1,'selected="selected"') . ">Internet Explorer</option>
To:
<option value=\"1\" " . iif($setting['value']==1,'selected="selected"') . ">Internet Explorer and Safari</option>

Hope it helps :)

djrapid.com
06 Oct 2008, 02:24
Hi, this is a great mod, but i had to change a few things to suit my website needs.
This is what i changed within the xml file (highlighted in red):

<if condition="$vboptions[zh_restrict_type]==1">
<if condition="is_browser(ie)">
<script type="text/javascript">
alert("This website require's Mozilla Firefox! Reason: Internet Explorer does not show the true layout of this website so we ask you to download Mozilla Firefox from here: http://www.mozilla.com/en-US/firefox. Thanks for you patience, now please press 'OK' to contiune to www.yoursite here.com")
window.location = "http://www.yoursite here.com"()
</script>
</if> </if>

What do you think?