示例#1
0
 function __construct($sMode = '', $aParams = array())
 {
     parent::__construct($sMode, $aParams);
     $this->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 __construct($sMode = '', $aParams = array())
 {
     $this->sCenterContentUnitSelector = '.bx-albums-unit-size';
     $this->aUnitViews = array('gallery' => 'unit_media.html');
     $this->sUnitTemplateLiveSearch = 'unit_media_live_search.html';
     if (empty($aParams['unit_view'])) {
         $aParams['unit_view'] = 'gallery';
     }
     parent::__construct($sMode, $aParams);
     $this->aCurrent = array('name' => 'bx_albums_media', 'module_name' => 'bx_albums', 'object_metatags' => 'bx_albums_media', 'title' => _t('_bx_albums_media'), 'table' => 'bx_albums_files2albums', 'ownFields' => array('id', 'title', 'data', 'content_id', 'file_id', 'order', 'views'), 'searchFields' => array('title'), 'restriction_sql' => '', 'restriction' => array('author' => array('value' => '', 'field' => 'author', 'operator' => '='), 'album' => array('value' => '', 'field' => 'content_id', 'operator' => '=')), 'join' => array('albums' => array('type' => 'INNER', 'table' => 'bx_albums_albums', 'mainField' => 'content_id', 'onField' => 'id', 'joinFields' => array()), 'files' => array('type' => 'INNER', 'table' => 'bx_albums_files', 'table_alias' => 'f', 'mainField' => 'file_id', 'onField' => 'id', 'joinFields' => array('added'))), 'paginate' => array('perPage' => getParam('bx_albums_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' => 'title')), 'ident' => 'id');
     $this->sFilterName = 'bx_albums_filter';
     $this->oModule = $this->getMain();
     $oProfileAuthor = isset($aParams['author']) ? BxDolProfile::getInstance((int) $aParams['author']) : null;
     $CNF =& $this->oModule->_oConfig->CNF;
     switch ($sMode) {
         case 'album':
             $this->aCurrent['restriction']['album']['value'] = (int) $aParams['album_id'];
             $this->sBrowseUrl = BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URI_VIEW_ENTRY'] . '&id=' . (int) $aParams['album_id']);
             $this->aCurrent['title'] = _t('_bx_albums_page_title_browse_media_in_album');
             $this->aCurrent['rss']['link'] = 'modules/?r=albums/rss_media/' . $sMode . '/' . (int) $aParams['album_id'];
             $this->aCurrent['sorting'] = 'order';
             $this->sOrderDirection = 'ASC';
             break;
         case 'recent':
             $this->sBrowseUrl = BxDolPermalinks::getInstance()->permalink($CNF['URL_RECENT_MEDIA']);
             $this->aCurrent['title'] = _t('_bx_albums_page_title_browse_recent_media');
             $this->aCurrent['rss']['link'] = 'modules/?r=albums/rss_media/' . $sMode;
             $this->aCurrent['sorting'] = 'last';
             break;
         case 'popular':
             $this->sBrowseUrl = BxDolPermalinks::getInstance()->permalink($CNF['URL_POPULAR_MEDIA']);
             $this->aCurrent['title'] = _t('_bx_albums_page_title_browse_popular_media');
             $this->aCurrent['rss']['link'] = BxDolPermalinks::getInstance()->permalink('modules/?r=albums/rss_media/' . $sMode);
             $this->aCurrent['sorting'] = 'popular';
             break;
         case '':
             // search results
             $this->sBrowseUrl = BX_DOL_SEARCH_KEYWORD_PAGE;
             $this->aCurrent['paginate']['perPage'] = 3;
             unset($this->aCurrent['rss']);
             break;
         default:
             $sMode = '';
             $this->isError = true;
     }
     $this->sBrowseUrl = $this->_replaceMarkers($this->sBrowseUrl);
     $this->aCurrent['title'] = $this->_replaceMarkers($this->aCurrent['title']);
     $this->addConditionsForPrivateContent($CNF, $oProfileAuthor);
 }
示例#3
0
 function __construct($sMode = '', $aParams = array())
 {
     parent::__construct($sMode, $aParams);
     $this->aCurrent = array('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':
             bx_import('BxDolProfile');
             $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':
             bx_import('BxDolPermalinks');
             $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':
             bx_import('BxDolPermalinks');
             $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 '':
             // 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;
     }
     // add replaceable markers and replace them
     if ($oProfileAuthor) {
         $this->addMarkers($oProfileAuthor->getInfo());
         // profile info is replacable
         $this->addMarkers(array('profile_id' => $oProfileAuthor->id()));
         // profile id is replacable
         $this->addMarkers(array('display_name' => $oProfileAuthor->getDisplayName()));
         // profile display name is replacable
     }
     $this->sBrowseUrl = $this->_replaceMarkers($this->sBrowseUrl);
     $this->aCurrent['title'] = $this->_replaceMarkers($this->aCurrent['title']);
     // add conditions for private content
     bx_import('BxDolPrivacy');
     $oPrivacy = BxDolPrivacy::getObjectInstance($CNF['OBJECT_PRIVACY_VIEW']);
     $a = $oPrivacy ? $oPrivacy->getContentPublicAsCondition($oProfileAuthor ? $oProfileAuthor->id() : 0) : array();
     if (isset($a['restriction'])) {
         $this->aCurrent['restriction'] = array_merge($this->aCurrent['restriction'], $a['restriction']);
     }
     if (isset($a['join'])) {
         $this->aCurrent['join'] = array_merge($this->aCurrent['join'], $a['join']);
     }
     $this->setProcessPrivateContent(false);
 }
 function displayResultBlock()
 {
     $s = parent::displayResultBlock();
     $s = '<div class="bx-notes-wrapper ' . ('unit_gallery.html' == $this->sUnitTemplate ? 'bx-def-margin-neg bx-clearfix' : '') . '">' . $s . '</div>';
     return $s;
 }