From 4e192b108d9ba3837ae881799b4376550a476ebf Mon Sep 17 00:00:00 2001 From: friendica Date: Thu, 13 Dec 2012 04:06:56 -0800 Subject: templatise the building of page queries so we can re-use it elsewhere --- js/main.js | 4 +-- mod/network.php | 71 ++++++++++++++---------------------------------- view/tpl/build_query.tpl | 50 ++++++++++++++++++++++++++++++++++ 3 files changed, 72 insertions(+), 53 deletions(-) create mode 100644 view/tpl/build_query.tpl diff --git a/js/main.js b/js/main.js index 18924834d..116cd5aeb 100644 --- a/js/main.js +++ b/js/main.js @@ -447,11 +447,11 @@ function updateConvItems(mode,data) { if(typeof buildCmd == 'function') { if(scroll_next) { - network_page = next_page; + bParam_page = next_page; page_load = true; } else { - network_page = 1; + bParam_page = 1; } update_url = buildCmd(); } diff --git a/mod/network.php b/mod/network.php index c86bbc261..4fd7ad200 100644 --- a/mod/network.php +++ b/mod/network.php @@ -495,57 +495,26 @@ function network_content(&$a, $update = 0, $load = false) { . "'; var profile_page = " . $a->pager['page'] . ";"; - $a->page['htmlhead'] .= "\r\n"; - - ; - - - - - + $a->page['htmlhead'] .= replace_macros(get_markup_template("build_query.tpl"),array( + '$baseurl' => z_root(), + '$uid' => ((local_user()) ? local_user() : '0'), + '$gid' => (($gid) ? $gid : '0'), + '$cid' => (($cid) ? $cid : '0'), + '$cmin' => (($cmin) ? $cmin : '0'), + '$cmax' => (($cmax) ? $cmax : '0'), + '$star' => (($star) ? $star : '0'), + '$liked' => (($liked) ? $liked : '0'), + '$conv' => (($conv) ? $conv : '0'), + '$spam' => (($spam) ? $spam : '0'), + '$nouveau' => (($nouveau) ? $nouveau : '0'), + '$wall' => '0', + '$page' => (($a->pager['page'] != 1) ? $a->pager['page'] : 1), + '$search' => $search, + '$order' => $order, + '$file' => $file, + '$dend' => $datequery, + '$dbegin' => $datequery2 + )); } $sql_extra3 = ''; diff --git a/view/tpl/build_query.tpl b/view/tpl/build_query.tpl new file mode 100644 index 000000000..25b370e69 --- /dev/null +++ b/view/tpl/build_query.tpl @@ -0,0 +1,50 @@ + + -- cgit v1.2.3