I can't use this, it asks every time a new window is open. This should be put in a cookie and should only pop up once like tapatalk.
How to Alert and Redirect users to Mobile App
Collapse
X
-
However, if you don't reload the full forum all the time (by using the back button, for example) the notification doesn't pop up for me and I find it ok.Comment
-
This adds a cookie so it only pops up once per session:
Header:
Code:<body onload="loadornot();">
Code:<script type="text/javascript"> function get_cookie(Name) { var search = Name + "=" var returnvalue = ""; if (document.cookie.length > 0) { offset = document.cookie.indexOf(search) if (offset != -1) { // if cookie exists offset += search.length // set index of beginning of value end = document.cookie.indexOf(";", offset); // set index of end of cookie value if (end == -1) end = document.cookie.length; returnvalue=unescape(document.cookie.substring(offset, end)) } } return returnvalue; } function loadornot() { if (get_cookie('popup')=='') { iPhoneAlert( ) document.cookie="popup=yes" } } function iPhoneAlert( ) { if ( navigator.userAgent.match(/iPhone/i) || navigator.userAgent.match(/iPod/i) ) { var qes = confirm( "This forum has an iPhone app! Click OK to learn more about ________ for iPhone." ); if ( qes ) window.location = "http://________"; } else if ( navigator.userAgent.match(/Android/i) ) { var qes = confirm( "This forum has an Android app! Click OK to learn more about ________ for Android." ); if ( qes ) window.location = "https://_______"; } } </script>
Comment
-
***UPDATED July 7, 2012*** With the future release of iOS 6 this Fall you can add "SmartApp Banners" to your site example running on my sites below.
[ATTACH=CONFIG]60408[/ATTACH][ATTACH=CONFIG]60409[/ATTACH][ATTACH=CONFIG]60410[/ATTACH][ATTACH=CONFIG]60411[/ATTACH][ATTACH=CONFIG]60412[/ATTACH]
To acquire this on your site just add one simple line of code I added it to the very very top of the headerinclude template
<meta name="apple-itunes-app" content="app-id=XXXXXXXX">
Replace the XXXXXXXXX with your apps actual App ID.
- - - Updated - - -
This adds a cookie so it only pops up once per session:
Header:
Code:<body onload="loadornot();">
Code:<script type="text/javascript"> function get_cookie(Name) { var search = Name + "=" var returnvalue = ""; if (document.cookie.length > 0) { offset = document.cookie.indexOf(search) if (offset != -1) { // if cookie exists offset += search.length // set index of beginning of value end = document.cookie.indexOf(";", offset); // set index of end of cookie value if (end == -1) end = document.cookie.length; returnvalue=unescape(document.cookie.substring(offset, end)) } } return returnvalue; } function loadornot() { if (get_cookie('popup')=='') { iPhoneAlert( ) document.cookie="popup=yes" } } function iPhoneAlert( ) { if ( navigator.userAgent.match(/iPhone/i) || navigator.userAgent.match(/iPod/i) ) { var qes = confirm( "This forum has an iPhone app! Click OK to learn more about ________ for iPhone." ); if ( qes ) window.location = "http://________"; } else if ( navigator.userAgent.match(/Android/i) ) { var qes = confirm( "This forum has an Android app! Click OK to learn more about ________ for Android." ); if ( qes ) window.location = "https://_______"; } } </script>
Comment
-
-
👍 1Comment
-
-
This thread is nearly nine years old. A *lot* has changed in that time, so it would be better to start a new thread with full details of the issue.MARK.B
vBulletin Support
------------
My Unofficial vBulletin 6.0.0 Demo: https://www.talknewsuk.com
My Unofficial vBulletin Cloud Demo: https://www.adminammo.comComment
widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
Comment