From f8bd476b882e95b8bdb589ae74645d030ef198fd Mon Sep 17 00:00:00 2001 From: friendica Date: Thu, 3 Jan 2013 15:52:05 -0800 Subject: import the toggle_mobile stuff to shut up some warnings --- boot.php | 16 ++++++++++++++++ index.php | 4 ++-- mod/profile.php | 2 +- mod/toggle_mobile.php | 17 +++++++++++++++++ version.inc | 2 +- view/tpl/toggle_mobile_footer.tpl | 2 ++ 6 files changed, 39 insertions(+), 4 deletions(-) create mode 100644 mod/toggle_mobile.php create mode 100644 view/tpl/toggle_mobile_footer.tpl diff --git a/boot.php b/boot.php index d86b48436..fc93879e7 100644 --- a/boot.php +++ b/boot.php @@ -1924,3 +1924,19 @@ function dba_timer() { 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; +} diff --git a/index.php b/index.php index a4e8899d9..f718850a8 100644 --- a/index.php +++ b/index.php @@ -389,10 +389,10 @@ if(count($arr)) { if($a->is_mobile || $a->is_tablet) { 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 { - $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( '$toggle_link' => $link, diff --git a/mod/profile.php b/mod/profile.php index 1865d69fc..549536931 100644 --- a/mod/profile.php +++ b/mod/profile.php @@ -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)) ); if($x) { diff --git a/mod/toggle_mobile.php b/mod/toggle_mobile.php new file mode 100644 index 000000000..00991e44c --- /dev/null +++ b/mod/toggle_mobile.php @@ -0,0 +1,17 @@ +get_baseurl(); + + goaway($address); +} + diff --git a/version.inc b/version.inc index f3645eb72..46bcb3bea 100644 --- a/version.inc +++ b/version.inc @@ -1 +1 @@ -2013-01-02.188 +2013-01-03.189 diff --git a/view/tpl/toggle_mobile_footer.tpl b/view/tpl/toggle_mobile_footer.tpl new file mode 100644 index 000000000..58695f4df --- /dev/null +++ b/view/tpl/toggle_mobile_footer.tpl @@ -0,0 +1,2 @@ +$toggle_text + -- cgit v1.2.3