use Friendica\Model\Item;
use Friendica\Model\Post\Category;
use Friendica\Model\Profile;
+use Friendica\Model\User;
use Friendica\Module\Contact as ModuleContact;
use Friendica\Module\Security\Login;
use Friendica\Util\DateTimeFormat;
return;
}
- Hook::add('head', __FILE__, 'network_infinite_scroll_head');
-
$is_a_date_query = false;
$group_id = (($a->argc > 1 && is_numeric($a->argv[1])) ? intval($a->argv[1]) : 0);
DI::page()['aside'] = '';
}
+ if (!empty(User::getAccountTypeByString($a->argv[1] ?? ''))) {
+ $accounttype = $a->argv[1];
+ } else {
+ $accounttype = '';
+ }
+
+ DI::page()['aside'] .= Widget::accounts('network', $accounttype);
DI::page()['aside'] .= Group::sidebarWidget('network/0', 'network', 'standard', $group_id);
DI::page()['aside'] .= ForumManager::widget(local_user(), $cid);
DI::page()['aside'] .= Widget::postedByYear('network', local_user(), false);
$arr = ['query' => DI::args()->getQueryString()];
Hook::callAll('network_content_init', $arr);
+ if (DI::pConfig()->get(local_user(), 'system', 'infinite_scroll') && ($_GET['mode'] ?? '') != 'minimal') {
+ $tpl = Renderer::getMarkupTemplate('infinite_scroll_head.tpl');
+ $o = Renderer::replaceMacros($tpl, ['$reload_uri' => DI::args()->getQueryString()]);
+ } else {
+ $o = '';
+ }
+
+ $account = User::getAccountTypeByString($a->argv[1] ?? '');
+
if (!empty($_GET['file'])) {
- $o = networkFlatView($a, $update);
+ $o .= networkFlatView($a, $update, $account);
} else {
- $o = networkThreadedView($a, $update, $parent);
+ $o .= networkThreadedView($a, $update, $parent, $account);
}
if (!$update && ($o === '')) {
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
* @global Pager $pager
*/
-function networkFlatView(App $a, $update = 0)
+function networkFlatView(App $a, $update, $account)
{
global $pager;
// Rawmode is used for fetching new content at the end of the page
networkSetSeen(['unseen' => true, 'uid' => local_user()]);
}
+ if (!empty($account)) {
+ $item_condition['contact-type'] = $account;
+ }
+
$result = Item::selectForUser(local_user(), [], $item_condition, $item_params);
$items = Item::inArray($result);
$o .= networkConversation($a, $items, $pager, 'network-new', $update);
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
* @global Pager $pager
*/
-function networkThreadedView(App $a, $update, $parent)
+function networkThreadedView(App $a, $update, $parent, $account)
{
/// @TODO this will have to be converted to a static property of the converted Module\Network class
global $pager;
$conditionFields = ['uid' => local_user()];
$conditionStrings = [];
+ if (!empty($account)) {
+ $conditionFields['contact-type'] = $account;
+ }
+
if ($star) {
$conditionFields['starred'] = true;
}
// --- end item filter tabs
}
-
-/**
- * Network hook into the HTML head to enable infinite scroll.
- *
- * Since the HTML head is built after the module content has been generated, we need to retrieve the base query string
- * of the page to make the correct asynchronous call. This is obtained through the Pager that was instantiated in
- * networkThreadedView or networkFlatView.
- *
- * @param App $a
- * @param string $htmlhead The head tag HTML string
- * @throws \Friendica\Network\HTTPException\InternalServerErrorException
- * @global Pager $pager
- */
-function network_infinite_scroll_head(App $a, &$htmlhead)
-{
- /// @TODO this will have to be converted to a static property of the converted Module\Network class
- /**
- * @var $pager Pager
- */
- global $pager;
-
- if (DI::pConfig()->get(local_user(), 'system', 'infinite_scroll')
- && ($_GET['mode'] ?? '') != 'minimal'
- ) {
- $tpl = Renderer::getMarkupTemplate('infinite_scroll_head.tpl');
- $htmlhead .= Renderer::replaceMacros($tpl, [
- '$pageno' => $pager->getPage(),
- '$reload_uri' => $pager->getBaseQueryString()
- ]);
- }
-}