X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fnetwork.php;h=67dd651e225e521b1a5849f19d41a384d956b50e;hb=5af9596dde162b1b9819869e3d5129f571a1c503;hp=442ae669babfe0ee25bc8f22bee449d341a45468;hpb=1e9bff88bc05fce154edee9f047e7d8922184140;p=friendica.git diff --git a/mod/network.php b/mod/network.php index 442ae669ba..67dd651e22 100644 --- a/mod/network.php +++ b/mod/network.php @@ -360,21 +360,21 @@ function network_content(App $a, $update = 0, $parent = 0) $arr = ['query' => $a->query_string]; Addon::callHooks('network_content_init', $arr); - $nouveau = false; + $flat_mode = false; if ($a->argc > 1) { for ($x = 1; $x < $a->argc; $x ++) { if ($a->argv[$x] === 'new') { - $nouveau = true; + $flat_mode = true; } } } if (x($_GET, 'file')) { - $nouveau = true; + $flat_mode = true; } - if ($nouveau) { + if ($flat_mode) { $o = networkFlatView($a, $update); } else { $o = networkThreadedView($a, $update, $parent); @@ -393,7 +393,7 @@ function network_content(App $a, $update = 0, $parent = 0) function networkFlatView(App $a, $update = 0) { // Rawmode is used for fetching new content at the end of the page - $rawmode = (isset($_GET['mode']) AND ( $_GET['mode'] == 'raw')); + $rawmode = (isset($_GET['mode']) && ($_GET['mode'] == 'raw')); if (isset($_GET['last_id'])) { $last_id = intval($_GET['last_id']); @@ -589,13 +589,14 @@ function networkThreadedView(App $a, $update, $parent) // desired. $sql_post_table = ''; - $sql_options = (($star) ? " AND `thread`.`starred` " : ''); - $sql_options .= (($bmark) ? " AND `thread`.`bookmark` " : ''); + $sql_options = ($star ? " AND `thread`.`starred` " : ''); + $sql_options .= ($bmark ? sprintf(" AND `thread`.`post-type` = %d ", Item::PT_PAGE) : ''); $sql_extra = $sql_options; $sql_extra2 = ''; $sql_extra3 = ''; $sql_table = '`thread`'; $sql_parent = '`iid`'; + $sql_order = ''; if ($update) { $sql_table = '`item`'; @@ -699,9 +700,7 @@ function networkThreadedView(App $a, $update, $parent) $order_mode = 'commented'; } - if ($sql_order == '') { - $sql_order = "$sql_table.$ordering"; - } + $sql_order = "$sql_table.$ordering"; if (x($_GET, 'offset')) { $sql_range = sprintf(" AND $sql_order <= '%s'", dbesc($_GET['offset'])); @@ -835,7 +834,7 @@ function networkThreadedView(App $a, $update, $parent) $top_limit = DateTimeFormat::utcNow(); } - $items = dba::p("SELECT `item`.`parent-uri` AS `uri`, 0 AS `item_id`, `item`.$ordering AS `order_date` FROM `item` + $items = dba::p("SELECT `item`.`parent-uri` AS `uri`, 0 AS `item_id`, `item`.$ordering AS `order_date`, `author`.`url` AS `author-link` FROM `item` STRAIGHT_JOIN (SELECT `oid` FROM `term` WHERE `term` IN (SELECT SUBSTR(`term`, 2) FROM `search` WHERE `uid` = ? AND `term` LIKE '#%') AND `otype` = ? AND `type` = ? AND `uid` = 0) AS `term` ON `item`.`id` = `term`.`oid`