function BxPhotosSearch($sParamName = '', $sParamValue = '', $sParamValue1 = '', $sParamValue2 = '')
 {
     parent::BxTemplSearchResultSharedMedia('BxPhotosModule');
     $this->aConstants['linksTempl'] = array('home' => 'home', 'file' => 'view/{uri}', 'category' => 'browse/category/{uri}', 'browseAll' => 'browse/', 'browseUserAll' => 'albums/browse/owner/{uri}', 'browseAllTop' => 'browse/top', 'tag' => 'browse/tag/{uri}', 'album' => 'browse/album/{uri}', 'add' => 'browse/my/add', 'manageProfilePhoto' => 'albums/my/manage_profile_photos/{uri}');
     $aMain = array('name' => 'bx_photos', 'title' => '_bx_photos', 'table' => 'bx_photos_main');
     $this->aCurrent = array_merge($aMain, $this->aCurrent);
     $this->aCurrent['ownFields'] = array('ID', 'Title', 'Uri', 'Date', 'Size', 'Views', 'Rate', 'RateCount', 'Hash');
     $this->aCurrent['searchFields'] = array('Title', 'Tags', 'Desc', 'Categories');
     $this->aCurrent['rss']['title'] = _t('_bx_photos');
     // redeclaration some unique fav fields
     $this->aAddPartsConfig['favorite']['table'] = 'bx_photos_favorites';
     $this->aAddPartsConfig['favorite']['mainField'] = 'ID';
     $this->oTemplate =& $this->oModule->_oTemplate;
     $this->aConstants['filesUrl'] = $this->oModule->_oConfig->getFilesUrl();
     $this->aConstants['filesDir'] = $this->oModule->_oConfig->getFilesPath();
     $this->aConstants['filesInAlbumCover'] = 17;
     $this->aConstants['filesInEmptyAlbumCover'] = 1;
     $this->aConstants['picPostfix'] = $this->oModule->_oConfig->aFilePostfix;
     $this->aCurrent['restriction']['albumType']['value'] = $this->aCurrent['name'];
     switch ($sParamName) {
         case 'calendar':
             $this->aCurrent['restriction']['calendar-min'] = array('value' => "UNIX_TIMESTAMP('{$sParamValue}-{$sParamValue1}-{$sParamValue2} 00:00:00')", 'field' => 'Date', 'operator' => '>=', 'no_quote_value' => true);
             $this->aCurrent['restriction']['calendar-max'] = array('value' => "UNIX_TIMESTAMP('{$sParamValue}-{$sParamValue1}-{$sParamValue2} 23:59:59')", 'field' => 'Date', 'operator' => '<=', 'no_quote_value' => true);
             $this->aCurrent['title'] = _t('_bx_photos_caption_browse_by_day') . sprintf("%04u-%02u-%02u", $sParamValue, $sParamValue1, $sParamValue2);
             break;
         case 'top':
             $this->aCurrent['sorting'] = 'top';
             break;
         case 'popular':
             $this->aCurrent['sorting'] = 'popular';
             break;
         case 'featured':
             $this->aCurrent['restriction']['featured'] = array('value' => '1', 'field' => 'Featured', 'operator' => '=', 'paramName' => 'bx_photos_mode');
             break;
         case 'favorited':
             if (isset($this->aAddPartsConfig['favorite']) && !empty($this->aAddPartsConfig['favorite']) && getLoggedId() != 0) {
                 $this->aCurrent['join']['favorite'] = $this->aAddPartsConfig['favorite'];
                 $this->aCurrent['restriction']['fav'] = array('value' => getLoggedId(), 'field' => $this->aAddPartsConfig['favorite']['userField'], 'operator' => '=', 'table' => $this->aAddPartsConfig['favorite']['table']);
             }
             break;
         case 'album':
             $this->aCurrent['sorting'] = 'album_order';
             $this->aCurrent['restriction']['album'] = array('value' => '', 'field' => 'Uri', 'operator' => '=', 'paramName' => 'albumUri', 'table' => 'sys_albums');
             $this->aCurrent['restriction']['albumType'] = array('value' => $this->aCurrent['name'], 'field' => 'Type', 'operator' => '=', 'paramName' => 'albumType', 'table' => 'sys_albums');
             if ($sParamValue1 == 'owner' && strlen($sParamValue2) > 0) {
                 $this->aCurrent['restriction']['owner'] = array('value' => $sParamValue2, 'field' => 'NickName', 'operator' => '=', 'paramName' => 'ownerName', 'table' => 'Profiles');
             }
             break;
     }
 }
Example #2
0
 function BxVideosSearch($sParamName = '', $sParamValue = '', $sParamValue1 = '', $sParamValue2 = '')
 {
     parent::BxTemplSearchResultSharedMedia('BxVideosModule');
     $this->aConstants['linksTempl'] = array('home' => 'home', 'file' => 'view/{uri}', 'category' => 'browse/category/{uri}', 'browseAll' => 'browse/', 'browseUserAll' => 'albums/browse/owner/{uri}', 'browseAllTop' => 'browse/top', 'tag' => 'browse/tag/{uri}', 'album' => 'browse/album/{uri}', 'add' => 'browse/my/add');
     // main part of aCurrent settings, usual most unique part of every module
     $aMain = array('name' => 'bx_videos', 'title' => '_bx_videos', 'table' => 'RayVideoFiles');
     $this->aCurrent = array_merge($aMain, $this->aCurrent);
     $this->aCurrent['ownFields'] = array_merge($this->aCurrent['ownFields'], array('Views', 'Source', 'Video'));
     $this->aCurrent['rss']['title'] = _t('_bx_videos');
     $this->aAddPartsConfig['favorite']['table'] = 'bx_videos_favorites';
     $this->oModule = BxDolModule::getInstance('BxVideosModule');
     $this->oTemplate =& $this->oModule->_oTemplate;
     $this->aConstants['filesUrl'] = $this->oModule->_oConfig->getFilesUrl();
     $this->aConstants['filesDir'] = $this->oModule->_oConfig->getFilesPath();
     $this->aConstants['filesInAlbumCover'] = 12;
     $this->aConstants['picPostfix'] = array('browse' => '_small.jpg', 'file' => '.mp4', 'main' => '.flv');
     $this->aCurrent['restriction']['albumType']['value'] = $this->aCurrent['name'];
     switch ($sParamName) {
         case 'calendar':
             $this->aCurrent['restriction']['calendar-min'] = array('value' => "UNIX_TIMESTAMP('{$sParamValue}-{$sParamValue1}-{$sParamValue2} 00:00:00')", 'field' => 'Date', 'operator' => '>=', 'no_quote_value' => true);
             $this->aCurrent['restriction']['calendar-max'] = array('value' => "UNIX_TIMESTAMP('{$sParamValue}-{$sParamValue1}-{$sParamValue2} 23:59:59')", 'field' => 'Date', 'operator' => '<=', 'no_quote_value' => true);
             $this->aCurrent['title'] = _t('_bx_videos_caption_browse_by_day') . sprintf("%04u-%02u-%02u", $sParamValue, $sParamValue1, $sParamValue2);
             break;
         case 'top':
             $this->aCurrent['sorting'] = 'top';
             break;
         case 'popular':
             $this->aCurrent['sorting'] = 'popular';
             break;
         case 'featured':
             $this->aCurrent['restriction']['featured'] = array('value' => '1', 'field' => 'Featured', 'operator' => '=', 'paramName' => 'bx_videos_mode');
             break;
         case 'favorited':
             if (isset($this->aAddPartsConfig['favorite']) && !empty($this->aAddPartsConfig['favorite']) && getLoggedId() != 0) {
                 $this->aCurrent['join']['favorite'] = $this->aAddPartsConfig['favorite'];
                 $this->aCurrent['restriction']['fav'] = array('value' => getLoggedId(), 'field' => $this->aAddPartsConfig['favorite']['userField'], 'operator' => '=', 'table' => $this->aAddPartsConfig['favorite']['table']);
             }
             break;
         case 'album':
             $this->aCurrent['sorting'] = 'album_order';
             $this->aCurrent['restriction']['album'] = array('value' => '', 'field' => 'Uri', 'operator' => '=', 'paramName' => 'albumUri', 'table' => 'sys_albums');
             if ($sParamValue1 == 'owner' && strlen($sParamValue2) > 0) {
                 $this->aCurrent['restriction']['owner'] = array('value' => $sParamValue2, 'field' => 'NickName', 'operator' => '=', 'paramName' => 'ownerName', 'table' => 'Profiles');
             }
             break;
     }
 }