From: Michael Date: Wed, 3 Jan 2018 14:54:25 +0000 (+0000) Subject: Standard X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=11cdb25aeb11b0418805d3006efd1f81cb558da1;p=friendica.git Standard --- diff --git a/src/Module/Global.php b/src/Module/Global.php deleted file mode 100644 index a48ea4dc18..0000000000 --- a/src/Module/Global.php +++ /dev/null @@ -1,94 +0,0 @@ -data,'search')) { - $search = notags(trim($a->data['search'])); - } else { - $search = (x($_GET,'search') ? notags(trim(rawurldecode($_GET['search']))) : ''); - } - - // Here is the way permissions work in this module... - // Only public posts can be shown - // OR your own posts if you are a logged in member - - $r = self::getPublicItems($a->pager['start'], $a->pager['itemspage']); - - if (!DBM::is_result($r)) { - info(t('No results.') . EOL); - return $o; - } - - // we behave the same in message lists as the search module - - $o .= conversation($a, $r, 'community', $update); - - $o .= alt_pager($a, count($r)); - - $t = get_markup_template("community.tpl"); - return replace_macros($t, array( - '$content' => $o, - '$header' => t("Global Timeline"), - '$show_global_community_hint' => Config::get('system', 'show_global_community_hint'), - '$global_community_hint' => t("This community stream shows all public posts received by this node. They may not reflect the opinions of this node’s users.") - )); - } - - private static function getPublicItems($start, $itemspage) { - $r = dba::p("SELECT ".item_fieldlists()." FROM `thread` - INNER JOIN `item` ON `item`.`id` = `thread`.`iid` ".item_joins(). - "WHERE `thread`.`uid` = 0 AND `verb` = ? - ORDER BY `thread`.`created` DESC LIMIT ".intval($start).", ".intval($itemspage), - ACTIVITY_POST - ); - - return dba::inArray($r); - } -} diff --git a/src/Module/GlobalModule.php b/src/Module/GlobalModule.php new file mode 100644 index 0000000000..2032497f65 --- /dev/null +++ b/src/Module/GlobalModule.php @@ -0,0 +1,97 @@ +data,'search')) { + $search = notags(trim($a->data['search'])); + } else { + $search = (x($_GET,'search') ? notags(trim(rawurldecode($_GET['search']))) : ''); + } + + // Here is the way permissions work in this module... + // Only public posts can be shown + // OR your own posts if you are a logged in member + + $r = self::getPublicItems($a->pager['start'], $a->pager['itemspage']); + + if (!DBM::is_result($r)) { + info(t('No results.') . EOL); + return $o; + } + + // we behave the same in message lists as the search module + + $o .= conversation($a, $r, 'community', $update); + + $o .= alt_pager($a, count($r)); + + $t = get_markup_template("community.tpl"); + return replace_macros($t, array( + '$content' => $o, + '$header' => t("Global Timeline"), + '$show_global_community_hint' => Config::get('system', 'show_global_community_hint'), + '$global_community_hint' => t("This community stream shows all public posts received by this node. They may not reflect the opinions of this node’s users.") + )); + } + + private static function getPublicItems($start, $itemspage) + { + $r = dba::p("SELECT ".item_fieldlists()." FROM `thread` + INNER JOIN `item` ON `item`.`id` = `thread`.`iid` ".item_joins(). + "WHERE `thread`.`uid` = 0 AND `verb` = ? + ORDER BY `thread`.`created` DESC LIMIT ".intval($start).", ".intval($itemspage), + ACTIVITY_POST + ); + + return dba::inArray($r); + } +}