X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fnetwork.php;h=64863b080d047492aa5baabef64c60c34097e6ba;hb=a5e91175243a41c77a56e73efc3672f20a7e6d23;hp=a78500174ea1d31f07981f81887e0fa2d84d0bb2;hpb=c12075a00518ae224c826d3e9373001b243f1839;p=friendica.git diff --git a/mod/network.php b/mod/network.php index a78500174e..64863b080d 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); + 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])) { @@ -139,16 +150,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); @@ -495,9 +503,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 = ''; @@ -573,11 +581,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; } } } @@ -626,7 +634,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); @@ -641,7 +649,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"]; } @@ -662,7 +670,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( @@ -673,7 +681,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, @@ -806,7 +814,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']; @@ -833,7 +841,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)); } } @@ -856,11 +864,12 @@ function networkThreadedView(App $a, $update = 0) { if (!$group && !$cid && !$star) { $condition = array('unseen' => true, 'uid' => local_user()); + networkSetSeen($condition); } elseif ($parents_str) { $condition = array("`uid` = ? AND `unseen` AND `parent` IN (" . dbesc($parents_str) . ")", local_user()); + networkSetSeen($condition); } - networkSetSeen($condition); $mode = 'network'; $o .= networkConversation($a, $items, $mode, $update);