diff options
Diffstat (limited to 'mod/network.php')
-rwxr-xr-x | mod/network.php | 50 |
1 files changed, 33 insertions, 17 deletions
diff --git a/mod/network.php b/mod/network.php index 271a1236d..03a671b61 100755 --- a/mod/network.php +++ b/mod/network.php @@ -56,7 +56,9 @@ function saved_searches($search) { . ((x($_GET,'star')) ? '?star=' . $_GET['star'] : '') . ((x($_GET,'bmark')) ? '?bmark=' . $_GET['bmark'] : '') . ((x($_GET,'conv')) ? '?conv=' . $_GET['conv'] : '') - . ((x($_GET,'nets')) ? '?nets=' . $_GET['nets'] : ''); + . ((x($_GET,'nets')) ? '?nets=' . $_GET['nets'] : '') + . ((x($_GET,'cmin')) ? '?cmin=' . $_GET['cmin'] : '') + . ((x($_GET,'cmax')) ? '?cmax=' . $_GET['cmax'] : ''); $o = ''; @@ -113,6 +115,7 @@ function network_content(&$a, $update = 0) { $all_active = ''; $search_active = ''; $conv_active = ''; + $spam_active = ''; if(($a->argc > 1 && $a->argv[1] === 'new') || ($a->argc > 2 && $a->argv[2] === 'new')) { @@ -135,12 +138,17 @@ function network_content(&$a, $update = 0) { $conv_active = 'active'; } + if($_GET['spam']) { + $spam_active = 'active'; + } + if (($new_active == '') && ($starred_active == '') && ($bookmarked_active == '') && ($conv_active == '') - && ($search_active == '')) { + && ($search_active == '') + && ($spam_active == '')) { $all_active = 'active'; } @@ -151,9 +159,7 @@ function network_content(&$a, $update = 0) { $all_active = ''; $postord_active = 'active'; } - - - + // tabs $tabs = array( array( @@ -187,6 +193,13 @@ function network_content(&$a, $update = 0) { 'url'=>$a->get_baseurl() . '/' . str_replace('/new', '', $a->cmd) . ((x($_GET,'cid')) ? '/?cid=' . $_GET['cid'] : '') . '&bmark=1', 'sel'=>$bookmarked_active, ), +// array( +// 'label' => t('Spam'), +// 'url'=>$a->get_baseurl() . '/network?f=&spam=1' +// 'sel'=> $spam_active, +// ), + + ); $tpl = get_markup_template('common_tabs.tpl'); $o .= replace_macros($tpl, array('$tabs'=>$tabs)); @@ -209,7 +222,10 @@ function network_content(&$a, $update = 0) { $order = ((x($_GET,'order')) ? notags($_GET['order']) : 'comment'); $liked = ((x($_GET,'liked')) ? intval($_GET['liked']) : 0); $conv = ((x($_GET,'conv')) ? intval($_GET['conv']) : 0); + $spam = ((x($_GET,'spam')) ? intval($_GET['spam']) : 0); $nets = ((x($_GET,'nets')) ? $_GET['nets'] : ''); + $cmin = ((x($_GET,'cmin')) ? intval($_GET['cmin']) : 0); + $cmax = ((x($_GET,'cmax')) ? intval($_GET['cmax']) : 99); if(($a->argc > 2) && $a->argv[2] === 'new') $nouveau = true; @@ -271,11 +287,7 @@ function network_content(&$a, $update = 0) { $sql_nets = (($nets) ? sprintf(" and `contact`.`network` = '%s' ", dbesc($nets)) : ''); - // We'll need the following line if starred/bookmarks are allowed in comments in the future - // $sql_extra = " AND `item`.`parent` IN ( SELECT `parent` FROM `item` WHERE `id` = `parent` $sql_options ) "; - - // Otherwise, this is a bit faster: - $sql_extra = $sql_options; + $sql_extra = " AND `item`.`parent` IN ( SELECT `parent` FROM `item` WHERE `id` = `parent` $sql_options ) "; if($group) { $r = q("SELECT `name`, `id` FROM `group` WHERE `id` = %d AND `uid` = %d LIMIT 1", @@ -337,14 +349,18 @@ function network_content(&$a, $update = 0) { $o .= "<script> var profile_uid = " . $_SESSION['uid'] . "; var netargs = '" . substr($a->cmd,8) . '?f=' - . ((x($_GET,'cid')) ? '&cid=' . $_GET['cid'] : '') + . ((x($_GET,'cid')) ? '&cid=' . $_GET['cid'] : '') . ((x($_GET,'search')) ? '&search=' . $_GET['search'] : '') - . ((x($_GET,'star')) ? '&star=' . $_GET['star'] : '') - . ((x($_GET,'order')) ? '&order=' . $_GET['order'] : '') - . ((x($_GET,'bmark')) ? '&bmark=' . $_GET['bmark'] : '') - . ((x($_GET,'liked')) ? '&liked=' . $_GET['liked'] : '') - . ((x($_GET,'conv')) ? '&conv=' . $_GET['conv'] : '') - . ((x($_GET,'nets')) ? '&nets=' . $_GET['nets'] : '') + . ((x($_GET,'star')) ? '&star=' . $_GET['star'] : '') + . ((x($_GET,'order')) ? '&order=' . $_GET['order'] : '') + . ((x($_GET,'bmark')) ? '&bmark=' . $_GET['bmark'] : '') + . ((x($_GET,'liked')) ? '&liked=' . $_GET['liked'] : '') + . ((x($_GET,'conv')) ? '&conv=' . $_GET['conv'] : '') + . ((x($_GET,'spam')) ? '&spam=' . $_GET['spam'] : '') + . ((x($_GET,'nets')) ? '&nets=' . $_GET['nets'] : '') + . ((x($_GET,'cmin')) ? '&cmin=' . $_GET['cmin'] : '') + . ((x($_GET,'cmax')) ? '&cmax=' . $_GET['cmax'] : '') + . "'; var profile_page = " . $a->pager['page'] . "; </script>\r\n"; } |