X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=boot.php;h=3c54ccc3f88780fcf393cb03fc1f882bb380d7d9;hb=4758dc187c9bb74fc49f9bfcde5f6aa5fa709d3f;hp=00520c34aa617d108f645a0a11bc181b6850a318;hpb=cc9a1a647436c56b21c71c3bac79e502fb8a3c5e;p=friendica.git diff --git a/boot.php b/boot.php index 00520c34aa..3c54ccc3f8 100644 --- a/boot.php +++ b/boot.php @@ -11,9 +11,9 @@ require_once('include/cache.php'); require_once('library/Mobile_Detect/Mobile_Detect.php'); define ( 'FRIENDICA_PLATFORM', 'Friendica'); -define ( 'FRIENDICA_VERSION', '3.0.1458' ); +define ( 'FRIENDICA_VERSION', '3.0.1470' ); define ( 'DFRN_PROTOCOL_VERSION', '2.23' ); -define ( 'DB_UPDATE_VERSION', 1154 ); +define ( 'DB_UPDATE_VERSION', 1156 ); define ( 'EOL', "
\r\n" ); define ( 'ATOM_TIME', 'Y-m-d\TH:i:s\Z' ); @@ -1088,9 +1088,12 @@ if(! function_exists('profile_load')) { $a->profile = $r[0]; + $a->profile['mobile-theme'] = get_pconfig($profile_uid, 'system', 'mobile_theme'); + $a->page['title'] = $a->profile['name'] . " @ " . $a->config['sitename']; $_SESSION['theme'] = $a->profile['theme']; + $_SESSION['mobile-theme'] = $a->profile['mobile-theme']; /** * load/reload current theme info @@ -1508,8 +1511,20 @@ if(! function_exists('current_theme')) { $is_mobile = $mobile_detect->isMobile() || $mobile_detect->isTablet(); if($is_mobile) { - $system_theme = ((isset($a->config['system']['mobile-theme'])) ? $a->config['system']['mobile-theme'] : ''); - $theme_name = ((isset($_SESSION) && x($_SESSION,'mobile-theme')) ? $_SESSION['mobile-theme'] : $system_theme); + if(isset($_SESSION['show-mobile']) && !$_SESSION['show-mobile']) { + $system_theme = ''; + $theme_name = ''; + } + else { + $system_theme = ((isset($a->config['system']['mobile-theme'])) ? $a->config['system']['mobile-theme'] : ''); + $theme_name = ((isset($_SESSION) && x($_SESSION,'mobile-theme')) ? $_SESSION['mobile-theme'] : $system_theme); + + if($theme_name === '---') { + // user has selected to have the mobile theme be the same as the normal one + $system_theme = ''; + $theme_name = ''; + } + } } if(!$is_mobile || ($system_theme === '' && $theme_name === '')) { $system_theme = ((isset($a->config['system']['theme'])) ? $a->config['system']['theme'] : ''); @@ -1751,3 +1766,20 @@ function build_querystring($params, $name=null) { } return $ret; } + +/** +* Returns the complete URL of the current page, e.g.: http(s)://something.com/network +* +* Taken from http://webcheatsheet.com/php/get_current_page_url.php +*/ +function curPageURL() { + $pageURL = 'http'; + if ($_SERVER["HTTPS"] == "on") {$pageURL .= "s";} + $pageURL .= "://"; + if ($_SERVER["SERVER_PORT"] != "80" && $_SERVER["SERVER_PORT"] != "443") { + $pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"]; + } else { + $pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"]; + } + return $pageURL; +}