import the toggle_mobile stuff to shut up some warnings
This commit is contained in:
parent
7df33bb963
commit
f8bd476b88
16
boot.php
16
boot.php
@ -1924,3 +1924,19 @@ function dba_timer() {
|
|||||||
return microtime(true);
|
return microtime(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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;
|
||||||
|
}
|
||||||
|
@ -389,10 +389,10 @@ if(count($arr)) {
|
|||||||
|
|
||||||
if($a->is_mobile || $a->is_tablet) {
|
if($a->is_mobile || $a->is_tablet) {
|
||||||
if(isset($_SESSION['show-mobile']) && !$_SESSION['show-mobile']) {
|
if(isset($_SESSION['show-mobile']) && !$_SESSION['show-mobile']) {
|
||||||
$link = $a->get_baseurl() . '/toggle_mobile?address=' . curPageURL();
|
$link = $a->get_baseurl() . '/toggle_mobile?f=&address=' . curPageURL();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$link = $a->get_baseurl() . '/toggle_mobile?off=1&address=' . curPageURL();
|
$link = $a->get_baseurl() . '/toggle_mobile?f=&off=1&address=' . curPageURL();
|
||||||
}
|
}
|
||||||
$a->page['footer'] .= replace_macros(get_markup_template("toggle_mobile_footer.tpl"), array(
|
$a->page['footer'] .= replace_macros(get_markup_template("toggle_mobile_footer.tpl"), array(
|
||||||
'$toggle_link' => $link,
|
'$toggle_link' => $link,
|
||||||
|
@ -29,7 +29,7 @@ function profile_aside(&$a) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$x = q("select uid as profile_uid from channel where address = '%s' limit 1",
|
$x = q("select channel_id as profile_uid from channel where channel_address = '%s' limit 1",
|
||||||
dbesc(argv(1))
|
dbesc(argv(1))
|
||||||
);
|
);
|
||||||
if($x) {
|
if($x) {
|
||||||
|
17
mod/toggle_mobile.php
Normal file
17
mod/toggle_mobile.php
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
function toggle_mobile_init(&$a) {
|
||||||
|
|
||||||
|
if(isset($_GET['off']))
|
||||||
|
$_SESSION['show-mobile'] = false;
|
||||||
|
else
|
||||||
|
$_SESSION['show-mobile'] = true;
|
||||||
|
|
||||||
|
if(isset($_GET['address']))
|
||||||
|
$address = $_GET['address'];
|
||||||
|
else
|
||||||
|
$address = $a->get_baseurl();
|
||||||
|
|
||||||
|
goaway($address);
|
||||||
|
}
|
||||||
|
|
@ -1 +1 @@
|
|||||||
2013-01-02.188
|
2013-01-03.189
|
||||||
|
2
view/tpl/toggle_mobile_footer.tpl
Normal file
2
view/tpl/toggle_mobile_footer.tpl
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
<a id="toggle_mobile_link" href="$toggle_link">$toggle_text</a>
|
||||||
|
|
Reference in New Issue
Block a user