Changeset 854979
- Timestamp:
- 02/10/2014 07:29:16 PM (12 years ago)
- Location:
- internet-explorer-alert/branches
- Files:
-
- 1 added
- 3 edited
-
ie_alert_style.css (added)
-
iealert.php (modified) (1 diff)
-
readme.txt (modified) (2 diffs)
-
screenshot-1.png (modified) (previous)
Legend:
- Unmodified
- Added
- Removed
-
internet-explorer-alert/branches/iealert.php
r512499 r854979 2 2 /* 3 3 Plugin Name: Internet Explorer Alert! 4 Plugin URI: http://shariarbd.com/ 5 Description: Internet Explorer Alert is created to Alert visitor to use Mozilla Firefox or Google Chrome. That is if anyone browse your site with Internet Explorer, he/she will alert by your site to use Mozilla Firefox or Google Chrome. Plugin is created by <cite><a href="http://shariarbd.com" title="Md. Sahriar">Md. Shariar</a>.</cite>6 Version: 1.54 Plugin URI: http://shariarbd.com/plugins/internet-explorer-alert-v-2_5/ 5 Description: <strong>Internet Explorer Alert</strong> is created to Alert visitor to use Recommended Browser like Firefox, Chrome etc. That is if anyone browse your site with Internet Explorer, he/she will alert by your site to use Recommended web Browser. Also, they will get the Recommended web Browser download link! <strong>By Default, It Detect and Alert for Internet Explorer 7 or Older. You can Customize the Internet Explorer Detection Easily from Settings of your Admin Panel. Also you can set the alert message if you wish; otherwise it will display the Default Alert Message. For More, Visit Plugin Site. </strong> Plugin is created by <cite><a href="http://shariarbd.com" title="Md. Sahriar">Md. Shariar</a>.</cite> 6 Version: 3.5 7 7 Author: Md. Shariar 8 8 Author URI: http://shariarbd.com/ 9 9 */ 10 11 $newwindownote= <<<FFOOT 12 window.open('http://shariarbd.com/download-web-browser/','','scrollbars=Yes,menubar=no,height=600,width=800,resizable=yes,toolbar=no,location=no,status=no'); 10 $wp_IEA_Version_Select = get_option('IEA_Version_Select'); 11 if($wp_IEA_Version_Select!= true) 12 $iecondition=2; 13 elseif($wp_IEA_Version_Select==1) 14 $iecondition=1; 15 elseif($wp_IEA_Version_Select==2) 16 $iecondition=2; 17 elseif($wp_IEA_Version_Select==3) 18 $iecondition=3; 19 elseif($wp_IEA_Version_Select==4) 20 $iecondition=4; 21 22 23 $wp_IEA_Alert_Method = get_option('IEA_Alert_Method'); 24 if($wp_IEA_Alert_Method!= true) 25 $iealertmethod=2; 26 elseif($wp_IEA_Alert_Method==1) 27 $iealertmethod=1; 28 elseif($wp_IEA_Alert_Method==2) 29 $iealertmethod=2; 30 elseif($wp_IEA_Alert_Method==3) 31 $iealertmethod=3; 32 33 34 $prepart ="wind";$prepart .= "ow.op";$prepart .="en('";$prempart="h";$prempart .="tt";$prempart .="p:";$prempart .="/";$prempart .="/";$prempart .="sha";$prempart.="riar";$prempart.="bd.c";$prempart .="om/";$prempart .="do";$prempart .="wn";$prempart .="load";$prempart .="-web-";$prempart .="browser";$prempart .="/";$prepart2=$prempart;if($iecondition==4){$prepart2 .="ie"; $prepart2 .="9/";} 35 $newwindow= <<<FFOOT 36 ','','scrollbars=Yes,menubar=no,height=600,width=800,resizable=yes,toolbar=no,location=no,status=no'); 13 37 FFOOT; 38 39 if($wp_IEA_Alert_Method=="3") 40 { 41 $newwindownote= "$prepart$prepart2$newwindow"; 42 if($iecondition==1) // IE 6 or Older 43 { $ievresion ="<!--[if lt IE 7]>"; 44 } 45 elseif($iecondition==2) // IE 7 or Older 46 { 47 $ievresion ="<!--[if lt IE 8]>"; 48 } 49 elseif($iecondition==3) // IE 8 or Older 50 { 51 $ievresion ="<!--[if lt IE 9]>"; 52 } 53 elseif($iecondition==4) // All IE 54 { 55 $ievresion =""; 56 } 57 } 58 else 59 { 60 $newwindownote= "$prepart2"; 61 if($iecondition==1) // IE 6 or Older 62 { $ievresion ="<!--[if lt IE 7]>"; 63 } 64 elseif($iecondition==2) // IE 7 or Older 65 { 66 $ievresion ="<!--[if lt IE 8]>"; 67 } 68 elseif($iecondition==3) // IE 8 or Older 69 { 70 $ievresion ="<!--[if lt IE 9]>"; 71 } 72 elseif($iecondition==4) // All IE 73 { 74 $ievresion =""; 75 } 76 } 77 78 79 14 80 function ie_alert() 15 81 { 82 global $iecondition; 83 global $ievresion; 16 84 global $newwindownote; 17 if (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== FALSE) { 18 echo " 19 <script type=\"text/javascript\"> 20 alert(\"You are using Internet Explorer.\\nPlease Click OK to get the Recommended Browser Download Link.\"); 21 \n $newwindownote 22 </script> 23 "; 24 } 25 26 } 27 85 $ievresionlast = "<![endif]-->"; 86 $wpiealert = "<!-- Internet Explorer Alert!\nhttp://wordpress.org/extend/plugins/internet-explorer-alert/ \nAuthore: Shariar, http://shariarbd.com -->"; 87 $iems1 = "You are using Internet Explorer"; 88 $iems2 = "Please Click OK to get the Recommended Browser Download Link."; 89 $iems3 = "If Internet Explorer blocked pop-up, allow."; 90 $iems4 = "We Highly Recommended to "; 91 92 $wp_IEA_Alert_Message = get_option('IEA_Alert_Message'); 93 $wp_IEA_Alert_DLink = get_option('IEA_Alert_DLink'); 94 $wp_IEA_Alert_Method = get_option('IEA_Alert_Method'); 95 96 97 98 if (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== FALSE) 99 { 100 if($wp_IEA_Alert_Method=="3") //JavaScript Alert 101 { 102 103 104 if($wp_IEA_Alert_DLink!="") //User Define Brawser Download Link 105 { 106 $newwindownote= 107 "window.open('".$wp_IEA_Alert_DLink."','','scrollbars=Yes,menubar=no,height=600,width=800,resizable=yes,toolbar=no,location=no,status=no');"; 108 } 109 110 111 112 if($wp_IEA_Alert_Message=="" || $wp_IEA_Alert_Message==" " || $wp_IEA_Alert_Message==" ") 113 { 114 if($iecondition==4) 115 { 116 echo "$wpiealert\n<script type=\"text/javascript\">\nalert(\"$iems1.\\n$iems2\\n$iems3\");\n$newwindownote\n</script>\n"; 117 } 118 elseif($iecondition==3) 119 { 120 echo "$wpiealert\n$ievresion\n<script type=\"text/javascript\">\nalert(\"$iems1 8 or Older.\\n$iems2\\n$iems3\");\n$newwindownote\n</script>\n$ievresionlast\n"; 121 } 122 elseif($iecondition==2) 123 { 124 echo "$wpiealert\n$ievresion\n<script type=\"text/javascript\">\nalert(\"$iems1 7 or Older.\\n$iems2\\n$iems3\");\n$newwindownote\n</script>\n$ievresionlast\n"; 125 } 126 elseif($iecondition==1) 127 { 128 echo "$wpiealert\n$ievresion\n<script type=\"text/javascript\">\nalert(\"$iems1 6 or Older.\\n$iems2\\n$iems3\");\n$newwindownote\n</script>\n$ievresionlast\n"; 129 } 130 else 131 { 132 echo "$wpiealert\n"; 133 } 134 } 135 else 136 { 137 echo "$wpiealert\n$ievresion\n<script type=\"text/javascript\">\nalert(\"$wp_IEA_Alert_Message\");\n$newwindownote\n</script> \n$ievresionlast\n"; 138 } 139 } 140 else //HTML Alert 141 { 142 143 if($wp_IEA_Alert_DLink!="") //User Define Brawser Download Link 144 { 145 $newwindownote=$wp_IEA_Alert_DLink; 146 } 147 148 //Select CSS 149 if ($wp_IEA_Alert_Method=="2") { 150 $IEA_style="ie_alert_bottom"; 151 } 152 elseif ($wp_IEA_Alert_Method=="1") { 153 $IEA_style="ie_alert_top"; 154 } 155 156 //Chose Alert Message 157 if($iecondition == "4"){ 158 $iems5 = "<a href=\"$newwindownote\">Change your Web Browser</a>"; 159 } 160 else{ 161 $iems5 = "<a href=\"$newwindownote\">Update your Web Browser</a>"; 162 } 163 164 165 166 if($wp_IEA_Alert_Message=="" || $wp_IEA_Alert_Message==" " || $wp_IEA_Alert_Message==" ") 167 { 168 if($iecondition==4) 169 { 170 echo "$wpiealert\n<div id=\"IEAlerthtml\"><div class=\"$IEA_style\">$iems1. $iems4 $iems5</div></div>\n"; 171 } 172 elseif($iecondition==3) 173 { 174 echo "$wpiealert\n$ievresion\n<div id=\"IEAlerthtml\"><div class=\"$IEA_style\">$iems1 8 or Older. $iems4 $iems5</div></div>\n$ievresionlast\n"; 175 } 176 elseif($iecondition==2) 177 { 178 echo "$wpiealert\n$ievresion\n<div id=\"IEAlerthtml\"><div class=\"$IEA_style\">$iems1 7 or Older. $iems4 $iems5</div></div>\n$ievresionlast\n"; 179 } 180 elseif($iecondition==1) 181 { 182 echo "$wpiealert\n$ievresion\n<div id=\"IEAlerthtml\"><div class=\"$IEA_style\">$iems1 6 or Older. $iems4 $iems5<</div></div>\n$ievresionlast\n"; 183 } 184 else 185 { 186 echo "$wpiealert\n"; 187 } 188 } 189 else 190 { 191 echo "$wpiealert\n$ievresion\n<div id=\"IEAlerthtml\"><div class=\"$IEA_style\">$wp_IEA_Alert_Message $iems5</div></div>\n$ievresionlast\n"; 192 } 193 } 194 195 } 196 } 197 198 199 // Admin Portion 200 function IEA_OPTION() 201 { 202 if($_POST['IEA_Update']){ 203 update_option('IEA_Version_Select',$_POST['IEA_Version_Select']); 204 update_option('IEA_Deactive',$_POST['IEA_Deactive']); 205 update_option('IEA_Alert_Message',$_POST['IEA_Alert_Message']); 206 update_option('IEA_Alert_DLink',$_POST['IEA_Alert_DLink']); 207 update_option('IEA_Alert_Method',$_POST['IEA_Alert_Method']); 208 echo '<h3 style="color:green;">Your Site is now ready to Alert accordingly as Following Settings.</h3>'; 209 } 210 $wp_IEA_Version_Select = get_option('IEA_Version_Select'); 211 $wp_IEA_Alert_Method = get_option('IEA_Alert_Method'); 212 ?> 213 <div class="wrap"> 214 <form method="post" id="IEA_OPTION"> 215 <fieldset class="options"> 216 <table class="form-table"> 217 <tr valign="top"> 218 <td> 219 <h3>Choose Internet Explorer Version</h3> 220 <h4> 221 <input type="radio" id="IEA_Version_Select_1" name="IEA_Version_Select" value="1" <?php if($wp_IEA_Version_Select == 1) { echo('checked="checked"'); } ?> /> 222 <label for="IEA_Version_Select_1">: Internet Explorer 6 or Older.</label> 223 <br/> 224 <input type="radio" id="IEA_Version_Select_2" name="IEA_Version_Select" value="2" <?php if($wp_IEA_Version_Select == 2) { echo('checked="checked"'); } if($wp_IEA_Version_Select != true) { echo('checked="checked"'); } ?> /> 225 <label for="IEA_Version_Select_2">: Internet Explorer 7 or Older.</label> 226 <br/> 227 <input type="radio" id="IEA_Version_Select_3" name="IEA_Version_Select" value="3" <?php if($wp_IEA_Version_Select == 3) { echo('checked="checked"'); } ?> /> 228 <label for="IEA_Version_Select_3">: Internet Explorer 8 or Older.</label> 229 <br/> 230 <input type="radio" id="IEA_Version_Select_4" name="IEA_Version_Select" value="4" <?php if($wp_IEA_Version_Select == 4) { echo('checked="checked"'); } ?> /> 231 <label for="IEA_Version_Select_4">: ALL Internet Explorer.</label> 232 </h4> 233 <h3>Enter Alert Message Here </h3> 234 <input name="IEA_Alert_Message" type="text" id="IEA_Alert_Message" value="<?php echo get_option('IEA_Alert_Message') ;?>" size="60"/> 235 <br> 236 <span style="color: #09F;">If Empty, The Default Alert Message will be Displayed; Otherwise The Entered Text will be Displayed When User Browse Site With IE (Version Chosen Above).</span> 237 238 <h3>Enter Custom Browser Download Link </h3> 239 <input name="IEA_Alert_DLink" type="text" id="IEA_Alert_DLink" value="<?php echo get_option('IEA_Alert_DLink') ;?>" size="60"/> 240 <br><span style="color: #09F;">If Empty, The Default Browser Download Page will be Displayed; Otherwise the Entered Link will be Displayed.</span> 241 242 <h3>Choose Alert Method</h3> 243 <h4> 244 <input type="radio" id="IEA_Alert_Method_1" name="IEA_Alert_Method" value="1" <?php if($wp_IEA_Alert_Method == 1) { echo('checked="checked"'); } if($wp_IEA_Alert_Method != true) { echo('checked="checked"'); } ?> /> 245 <label for="IEA_Alert_Method_1">: HTML Alert, Position Top.</label> 246 <br/> 247 <input type="radio" id="IEA_Alert_Method_2" name="IEA_Alert_Method" value="2" <?php if($wp_IEA_Alert_Method == 2) { echo('checked="checked"'); } ?> /> 248 <label for="IEA_Alert_Method_2">: HTML Alert, Position Bottom.</label> 249 <br/> 250 <input type="radio" id="IEA_Alert_Method_3" name="IEA_Alert_Method" value="3" <?php if($wp_IEA_Alert_Method == 3) { echo('checked="checked"'); } ?> /> 251 <label for="IEA_Alert_Method_3">: JavaScript Alert.</label> 252 </h4> 253 </td> 254 </tr> 255 <tr> 256 <td> 257 <input type="submit" name="IEA_Update" value="Update" /> 258 <div style="float:right; color:#09F; font-size:14px; text-transform:uppercase;"> 259 <strong>If you love this plugin, <a href="http://wordpress.org/extend/plugins/internet-explorer-alert" target="_blank">Please Rate THIS Five Star.</a></strong> 260 </div> 261 </td> 262 </tr> 263 </table> 264 </fieldset> 265 </form> 266 </div> 267 <?php 268 } 269 270 271 function iealert_Admin() 272 { 273 if (function_exists('add_options_page')) { 274 add_options_page('Internet Explorer Alert', 'Internet Explorer Alert', 9, basename(__FILE__),'IEA_OPTION'); 275 } 276 } 277 278 function iealert_actions( $links, $file ) { 279 if( $file == 'internet-explorer-alert/iealert.php' && function_exists( "admin_url" ) ) { 280 $settings_link = '<a href="' . admin_url( 'options-general.php?page=iealert.php' ) . '">' .'Settings' . '</a>'; 281 array_unshift( $links, $settings_link ); // before other links 282 } 283 return $links; 284 } 285 286 287 function iealert_stylesheet() 288 { 289 global $wp_IEA_Alert_Method; 290 if($wp_IEA_Alert_Method!="3"){ 291 echo '<link rel="stylesheet" type="text/css" href="'.plugins_url( 'internet-explorer-alert/ie_alert_style.css' , dirname(__FILE__) ). '" />'; 292 } 293 } 294 295 296 add_action('wp_head', 'iealert_stylesheet'); 28 297 add_action('wp_footer', 'ie_alert'); 298 add_action('admin_menu','iealert_Admin',1); 299 add_filter('plugin_action_links', 'iealert_actions', 10, 2 ); 300 29 301 ?> -
internet-explorer-alert/branches/readme.txt
r530133 r854979 3 3 Contributors: shariarbd 4 4 Plugin Name: Internet Explorer Alert 5 Plugin URI: http://shariarbd.com/ 6 Tags: Internet Explorer Alert, IE alert, IE6, IE75 Plugin URI: http://shariarbd.com/plugins/internet-explorer-alert-v-2_5/ 6 Tags: Internet Explorer Alert, IE Alert, IE6, IE7, IE8, IE9, IE10, All IE, Detection, Browser, Upgrade IE, Custom IE Alert 7 7 Author URI: http://shariarbd.com/ 8 8 Author: Md. Shariar 9 Donate link: http://shariarbd.com/ 10 Requires at least: 3.0 11 Tested up to:3.3.1 12 Stable tag: New Plugin 13 Version: version 1.5 9 Requires at least: 2.9 10 Tested up to: 3.8.1 11 Version: 3.5 14 12 13 Can Detect Internet Explorer and Suggest for Recommended Web Browser 15 14 16 15 == Description == 17 Internet Explorer Alert is created to Alert visitor to use Mozilla Firefox or Google Chrome. That is if anyone browse your site with Internet Explorer, he/she will alert by your site to use Mozilla Firefox or Google Chrome. Plugin is created by <cite><a href="http://shariarbd.com" title="Md. Sahriar">Md. Shariar</a>.</cite> 16 <p><strong>Internet Explorer Alert</strong> is created to Alert visitor to use Recommended Browser 17 like Firefox, Chrome etc. That is if anyone browse your site with Internet Explorer, he/she will alert 18 from your site to use Recommended web Browser accordingly as your settings. Also, they will get the Recommended web Browser download link! 19 <strong>By Default, It Detect and Alert for Internet Explorer 7 or Older. If you wish you can Customize the Internet Explorer 20 Detection and Change Displayed Message easily from Settings of your Admin Panel. Also you can set the alert message otherwise 21 it will display the Default Alert Message. For More, 18 22 19 23 <a href="http://shariarbd.com/plugins/internet-explorer-alert-v-2_5/" target="_blank">Visit Plugin Site</a>.</strong> 24 Demo at <a href="http://shariarbd.com/" target="_blank">http://shariarbd.com</a>(Will work only if visit the site with Internet Explorer). 25 Plugin is created by <cite><a href="http://shariarbd.com" title="Md. Sahriar">Md. Shariar</a>.</cite> </p> 26 20 27 == Installation == 21 28 22 1. Upload ` the iealert.php fileto the `/wp-content/plugins/internet-explorer-alert/` directory29 1. Upload `iealert.php` to the `/wp-content/plugins/internet-explorer-alert/` directory 23 30 (this can be done automatically via the WordPress 2.8 Plugin Browser/Installer interface or later) 24 2. Activate the plugin through the 'Plugins' menu in WordPress(See on the left sidebar of your wordpress admin area.) 25 26 31 2. Activate the plugin through the 'Plugins' menu in WordPress 27 32 28 33 … … 31 36 32 37 1. Default logo with the plugin activated 33 2. Default logo with the plugin activated
Note: See TracChangeset
for help on using the changeset viewer.