aCurrent = array( 'name' => 'bx_posts', 'module_name' => 'bx_posts', 'object_metatags' => 'bx_posts', 'title' => _t('_bx_posts_page_title_browse'), 'table' => 'bx_posts_posts', 'ownFields' => array('id', 'title', 'text', 'thumb', 'author', 'added'), 'searchFields' => array('title', 'text'), 'restriction' => array( 'author' => array('value' => '', 'field' => 'author', 'operator' => '='), 'status' => array('value' => 'active', 'field' => 'status', 'operator' => '='), ), 'paginate' => array('perPage' => getParam('bx_posts_per_page_browse'), 'start' => 0), 'sorting' => 'last', 'rss' => array( 'title' => '', 'link' => '', 'image' => '', 'profile' => 0, 'fields' => array ( 'Guid' => 'link', 'Link' => 'link', 'Title' => 'title', 'DateTimeUTS' => 'added', 'Desc' => 'text', ), ), 'ident' => 'id', ); $this->sFilterName = 'bx_posts_filter'; $this->oModule = $this->getMain(); $oProfileAuthor = null; $CNF = &$this->oModule->_oConfig->CNF; switch ($sMode) { case 'author': $oProfileAuthor = BxDolProfile::getInstance((int)$aParams['author']); if (!$oProfileAuthor) { $this->isError = true; break; } $this->aCurrent['restriction']['author']['value'] = $oProfileAuthor->id(); $this->sBrowseUrl = 'page.php?i=' . $CNF['URI_AUTHOR_ENTRIES'] . '&profile_id={profile_id}'; $this->aCurrent['title'] = _t('_bx_posts_page_title_browse_by_author'); $this->aCurrent['rss']['link'] = 'modules/?r=posts/rss/' . $sMode . '/' . $oProfileAuthor->id(); break; case 'public': $this->sBrowseUrl = BxDolPermalinks::getInstance()->permalink($CNF['URL_HOME']); $this->aCurrent['title'] = _t('_bx_posts_page_title_browse_recent'); $this->aCurrent['rss']['link'] = 'modules/?r=posts/rss/' . $sMode; break; case 'popular': $this->sBrowseUrl = BxDolPermalinks::getInstance()->permalink($CNF['URL_POPULAR']); $this->aCurrent['title'] = _t('_bx_posts_page_title_browse_popular'); $this->aCurrent['rss']['link'] = 'modules/?r=posts/rss/' . $sMode; $this->aCurrent['sorting'] = 'popular'; break; case 'updated': $this->sBrowseUrl = BxDolPermalinks::getInstance()->permalink($CNF['URL_UPDATED']); $this->aCurrent['title'] = _t('_bx_posts_page_title_browse_updated'); $this->aCurrent['rss']['link'] = 'modules/?r=posts/rss/' . $sMode; $this->aCurrent['sorting'] = 'updated'; break; case '': // search results $this->sBrowseUrl = BX_DOL_SEARCH_KEYWORD_PAGE; $this->aCurrent['title'] = _t('_bx_posts'); $this->aCurrent['paginate']['perPage'] = 3; unset($this->aCurrent['rss']); break; default: $sMode = ''; $this->isError = true; } $this->processReplaceableMarkers($oProfileAuthor); $this->addConditionsForPrivateContent($CNF, $oProfileAuthor); } function getAlterOrder() { $aSql = array(); switch ($this->aCurrent['sorting']) { case 'last': $aSql['order'] = ' ORDER BY `bx_posts_posts`.`added` DESC'; break; case 'updated': $aSql['order'] = ' ORDER BY `bx_posts_posts`.`changed` DESC'; break; case 'popular': $aSql['order'] = ' ORDER BY `bx_posts_posts`.`views` DESC'; break; } return $aSql; } } /** @} */