Author Topic: [[droplet]] browser update checker  (Read 2813 times)

Offline Re-Mi

  • Posts: 97
[[droplet]] browser update checker
« on: August 10, 2011, 05:39:33 PM »
Hello,

For a site i'm making i wanted a browser update checker, some users still are using an outdated browser that will screw up the template.

So i used this droplet to warn people that they are using an older browser, and it will advice people to update to a more secure (and better template supported) version.

It's making use of an external javascript hosted on the site who provides the latest version, and they update it for the latest browsers

droplet code:
Code: [Select]
return'<script type="text/javascript">
var $buoop = {
    vs: {i:6,f:2,o:9.63,s:2,n:10},  // browser versions to notify
    reminder: 24,                   // atfer how many hours should the message reappear  0 = show all the time
    onshow: function(infos){},      // callback function after the bar has appeared
    l: false,                       // set a language for the message, e.g. "en"  overrides the default detection
    test: false,                    // true = always show the bar (for testing)
    text: "'.$text.'",                       // custom notification html text , leave blank for default
    newwindow: true                // open link in new window/tab
}
$buoop.ol = window.onload;
window.onload=function(){
 if ($buoop.ol) $buoop.ol();
 var e = document.createElement("script");
 e.setAttribute("type", "text/javascript");
 e.setAttribute("src", "http://browser-update.org/update.js");
 document.body.appendChild(e);
}  
</script>';

i used the following name, you can save it as you like. Place the tag anywhere in you index.php to warn the visitor on every page, or in a wysiwyg page to warn them only with that page.
Code: [Select]
[[browsercheck]]
I may look into some changes to give the droplets some parameters, but for now this does work just fine for me. More info on the browser-update.org site

edit 1: added a parameter for the text, use
Code: [Select]
[[browsercheck?text=your text here]] to add you own text, if you leave this blank it will use the default

Hope this comes in handy for some of you.

Kind regards,

Michel
« Last Edit: August 10, 2011, 05:47:40 PM by Re-Mi »

Offline Ruud

  • Posts: 3660
  • Gender: Male
  • Do not use PM for help! Please use the forum!
    • Dev4Me - Professional WebsiteBaker Development
Re: [[snippet]] browser update checker
« Reply #1 on: August 13, 2011, 12:11:47 AM »
Nice idea, and it is working too..

The only thing that crossed my mind is that it could be done even more simple.
So I created a snippet that will do the same thing, but without any extra effort.
Just install the snippet through the admin pages and it should automatically function on every page.

The only thing it needs is that your template should have the frontend.js/css functionality enabled. (as it should be for other modules too)

You can modify the settings by editting the frontend.js and frontend.css in the snippets directory as explained on the browsers-update.org website.

[gelöscht durch Administrator]

Offline dbs

  • Betatester
  • **
  • Posts: 8638
  • Gender: Male
  • tioz4ever
    • WebsiteBaker - jQuery-Plugins - Module - Droplets - Tests
Re: [[droplet]] browser update checker
« Reply #2 on: August 13, 2011, 05:48:29 PM »
Hi, have tested the snipped with IETester and it works fine.  
Warning : i:8  :wink: