X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fnetwork.php;h=e74df1633aab0daebfeb440826aa1ac1788f9a2f;hb=3359f3f5c7ecc4b6a34c4fcfc095ab4dd5fab0f1;hp=f79becd9d0af2d0717c572aac7c3a0a68c8c528f;hpb=1b53b8cae9fe11f17c282fb8ea62f785ca901f68;p=friendica.git diff --git a/mod/network.php b/mod/network.php index f79becd9d0..e74df1633a 100644 --- a/mod/network.php +++ b/mod/network.php @@ -1,15 +1,19 @@ argc > 1 && is_numeric($a->argv[1])) ? intval($a->argv[1]) : 0); + + $cid = 0; if (x($_GET, 'cid') && intval($_GET['cid']) != 0) { $cid = $_GET['cid']; $_GET['nets'] = 'all'; - + $group_id = 0; } + PConfig::set(local_user(), 'network.view', 'group.selected', $group_id); + if ($a->argc > 1) { for ($x = 1; $x < $a->argc; $x ++) { if (is_a_date_arg($a->argv[$x])) { @@ -141,16 +151,13 @@ function network_init(App $a) { unset($_GET['nets']); } - $group_id = (($a->argc > 1 && is_numeric($a->argv[1])) ? intval($a->argv[1]) : 0); - - PConfig::set(local_user(), 'network.view', 'group.selected', $group_id); if (!x($a->page, 'aside')) { $a->page['aside'] = ''; } $a->page['aside'] .= (feature_enabled(local_user(),'groups') ? group_side('network/0','network','standard',$group_id) : ''); - $a->page['aside'] .= (feature_enabled(local_user(),'forumlist_widget') ? ForumManager::widget(local_user(),$cid) : ''); + $a->page['aside'] .= (feature_enabled(local_user(), 'forumlist_widget') ? ForumManager::widget(local_user(), $cid) : ''); $a->page['aside'] .= posted_date_widget('network',local_user(),false); $a->page['aside'] .= networks_widget('network',(x($_GET, 'nets') ? $_GET['nets'] : '')); $a->page['aside'] .= saved_searches($search); @@ -497,9 +504,9 @@ function networkThreadedView(App $a, $update = 0) { $rawmode = (isset($_GET["mode"]) AND ($_GET["mode"] == "raw")); if (isset($_GET["last_received"]) && isset($_GET["last_commented"]) && isset($_GET["last_created"]) && isset($_GET["last_id"])) { - $last_received = dbm::date($_GET["last_received"]); - $last_commented = dbm::date($_GET["last_commented"]); - $last_created = dbm::date($_GET["last_created"]); + $last_received = DBM::date($_GET["last_received"]); + $last_commented = DBM::date($_GET["last_commented"]); + $last_created = DBM::date($_GET["last_created"]); $last_id = intval($_GET["last_id"]); } else { $last_received = ''; @@ -575,11 +582,11 @@ function networkThreadedView(App $a, $update = 0) { // If $cid belongs to a communitity forum or a privat goup,.add a mention to the status editor $condition = array("`id` = ? AND (`forum` OR `prv`)", $cid); $contact = dba::select('contact', array('addr', 'nick'), $condition, array('limit' => 1)); - if (dbm::is_result($contact)) { + if (DBM::is_result($contact)) { if ($contact["addr"] != '') { - $content = "@".$contact["addr"]; + $content = "!".$contact["addr"]; } else { - $content = "@".$contact["nick"]."+".$cid; + $content = "!".$contact["nick"]."+".$cid; } } } @@ -628,7 +635,7 @@ function networkThreadedView(App $a, $update = 0) { if ($group) { $r = dba::select('group', array('name'), array('id' => $group, 'uid' => $_SESSION['uid']), array('limit' => 1)); - if (!dbm::is_result($r)) { + if (!DBM::is_result($r)) { if ($update) killme(); notice(t('No such group') . EOL); @@ -643,7 +650,7 @@ function networkThreadedView(App $a, $update = 0) { $contact_str = implode(',',$contacts); $self = dba::select('contact', array('id'), array('uid' => $_SESSION['uid'], 'self' => true), array('limit' => 1)); - if (dbm::is_result($self)) { + if (DBM::is_result($self)) { $contact_str_self = $self["id"]; } @@ -664,7 +671,7 @@ function networkThreadedView(App $a, $update = 0) { 'forum', 'prv', 'contact-type', 'addr', 'thumb', 'location'); $condition = array("`id` = ? AND (NOT `blocked` OR `pending`)", $cid); $r = dba::select('contact', $fields, $condition, array('limit' => 1)); - if (dbm::is_result($r)) { + if (DBM::is_result($r)) { $sql_extra = " AND ".$sql_table.".`contact-id` = ".intval($cid); $entries[0] = array( @@ -675,7 +682,7 @@ function networkThreadedView(App $a, $update = 0) { 'details' => $r['location'], ); - $entries[0]["account_type"] = account_type($r); + $entries[0]["account_type"] = Contact::getAccountType($r); $o = replace_macros(get_markup_template("viewcontact_template.tpl"),array( 'contacts' => $entries, @@ -808,7 +815,7 @@ function networkThreadedView(App $a, $update = 0) { $parents_str = ''; $date_offset = ""; - if (dbm::is_result($r)) { + if (DBM::is_result($r)) { foreach ($r as $rr) { if (!in_array($rr['item_id'],$parents_arr)) { $parents_arr[] = $rr['item_id']; @@ -835,7 +842,7 @@ function networkThreadedView(App $a, $update = 0) { $parents ); - if (dbm::is_result($thread_items)) { + if (DBM::is_result($thread_items)) { $items = array_merge($items, dba::inArray($thread_items)); } } @@ -877,17 +884,19 @@ function networkThreadedView(App $a, $update = 0) { * @param App $a The global App * @return string Html of the networktab */ -function network_tabs(App $a) { +function network_tabs(App $a) +{ // item filter tabs /// @TODO fix this logic, reduce duplication /// $a->page['content'] .= '
'; - list($no_active, $all_active, $postord_active, $conv_active, $new_active, $starred_active, $bookmarked_active, $spam_active) = network_query_get_sel_tab($a); + // if no tabs are selected, defaults to comments - if ($no_active=='active') $all_active='active'; + if ($no_active == 'active') { + $all_active = 'active'; + } - $cmd = (($datequery) ? '' : $a->cmd); - $len_naked_cmd = strlen(str_replace('/new','',$cmd)); + $cmd = $a->cmd; // tabs $tabs = array(