mirror of
https://github.com/WhatCD/Gazelle.git
synced 2024-12-13 19:06:27 +00:00
Empty commit
This commit is contained in:
parent
08cb7c2eb8
commit
8f340b001b
@ -47,8 +47,13 @@
|
||||
<div class="center pad"><a href="forums.php?action=viewthread&threadid=<?=$FeaturedAlbum['ThreadID']?>"><em>Read the interview with the artist, discuss here</em></a></div>
|
||||
</div>
|
||||
<?
|
||||
}
|
||||
if (check_perms('users_mod')) {
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
|
||||
<?
|
||||
if (check_perms('users_mod')) {
|
||||
?>
|
||||
|
||||
<div class="box">
|
||||
|
@ -54,6 +54,7 @@
|
||||
<br /><br />
|
||||
Lost your password? <a href="login.php?act=recover">Recover it here!</a>
|
||||
<? } ?>
|
||||
<script type="text/javascript" src="static/functions/detect_mobile.js"></script>
|
||||
<script type="text/javascript">
|
||||
cookie.set('cookie_test',1,1);
|
||||
if (cookie.get('cookie_test') != null) {
|
||||
|
80
static/functions/detect_mobile.js
Normal file
80
static/functions/detect_mobile.js
Normal file
@ -0,0 +1,80 @@
|
||||
var ANDROID_COOKIE_NAME = "mobile_checked_android";
|
||||
var OTHER_COOKIE_NAME = "mobile_checked_other";
|
||||
var MOBILE_SITE_URL = "https://m.what.cd/";
|
||||
var ANDROID_APP_URL = "http://bit.ly/git_wa_stable";
|
||||
|
||||
var isMobile = {
|
||||
Android: function() {
|
||||
return navigator.userAgent.match(/Android/i) ? true : false;
|
||||
},
|
||||
BlackBerry: function() {
|
||||
return navigator.userAgent.match(/BlackBerry/i) ? true : false;
|
||||
},
|
||||
iOS: function() {
|
||||
return navigator.userAgent.match(/iPhone|iPad|iPod/i) ? true : false;
|
||||
},
|
||||
Windows: function() {
|
||||
return navigator.userAgent.match(/IEMobile/i) ? true : false;
|
||||
},
|
||||
Any: function() {
|
||||
return (isMobile.Android() || isMobile.BlackBerry() || isMobile.iOS() || isMobile.Windows());
|
||||
},
|
||||
NotAndroid: function() {
|
||||
return (isMobile.BlackBerry() || isMobile.iOS() || isMobile.Windows());
|
||||
}
|
||||
};
|
||||
|
||||
if(isMobile.Android()) {
|
||||
if(!hasCookie(ANDROID_COOKIE_NAME)) {
|
||||
setCookie(ANDROID_COOKIE_NAME, true, 365);
|
||||
var result=confirm("A Android App is available for What.CD, would you like to download it?");
|
||||
if (result==true) {
|
||||
window.location = ANDROID_APP_URL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
else if(isMobile.NotAndroid()) {
|
||||
if(!hasCookie(OTHER_COOKIE_NAME)) {
|
||||
setCookie(OTHER_COOKIE_NAME, true, 365);
|
||||
var result=confirm("A mobile version of What.CD is available, would you like to use it?");
|
||||
if (result==true) {
|
||||
window.location = MOBILE_SITE_URL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function setCookie(c_name,value,exdays)
|
||||
{
|
||||
var exdate=new Date();
|
||||
exdate.setDate(exdate.getDate() + exdays);
|
||||
var c_value=escape(value) + ((exdays==null) ? "" : "; expires="+exdate.toUTCString());
|
||||
document.cookie=c_name + "=" + c_value;
|
||||
}
|
||||
|
||||
function getCookie(c_name)
|
||||
{
|
||||
var i,x,y,ARRcookies=document.cookie.split(";");
|
||||
for (i=0;i<ARRcookies.length;i++)
|
||||
{
|
||||
x=ARRcookies[i].substr(0,ARRcookies[i].indexOf("="));
|
||||
y=ARRcookies[i].substr(ARRcookies[i].indexOf("=")+1);
|
||||
x=x.replace(/^\s+|\s+$/g,"");
|
||||
if (x==c_name)
|
||||
{
|
||||
return unescape(y);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function hasCookie(c_name)
|
||||
{
|
||||
var checked=getCookie(c_name);
|
||||
if (checked != null)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
Loading…
Reference in New Issue
Block a user