HomeHelpTrac

Changeset 13775


Ignore:
Timestamp:
03/10/10 11:19:50 (2 years ago)
Author:
Leonid Sokushev
Message:

ticket #1900 + mem levels checking for sounds and videos blocks at profile page

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/modules/boonex/photos/classes/BxPhotosSearch.php

    r13766 r13775  
    201201    function _getImageDbInfo ($iId) { 
    202202        $iId = (int)$iId; 
    203         $sqlQuery = "SELECT `bx_photos_main`.`ID` as `id`, 
    204                             `Ext` as `ext`, 
    205                             `Title` as `title`, 
    206                             `Desc` as `description`, 
    207                             `Uri` as `uri`, 
    208                             `Owner` as `owner`, 
    209                             `Date` as `date`, 
    210                             `Rate` as `rate`, 
    211                             `Hash`, 
    212                             `id_album` as `album_id` 
    213                             FROM `bx_photos_main` 
    214                             LEFT JOIN `sys_albums_objects` ON `sys_albums_objects`.`id_object` = `bx_photos_main`.`ID` 
    215                             WHERE `bx_photos_main`.`ID`='" . $iId . "' AND `Status`<>'disapproved'"; 
     203        $sqlQuery = "SELECT a.`ID` as `id`, 
     204                            a.`Ext` as `ext`, 
     205                            a.`Title` as `title`, 
     206                            a.`Desc` as `description`, 
     207                            a.`Uri` as `uri`, 
     208                            a.`Owner` as `owner`, 
     209                            a.`Date` as `date`, 
     210                            a.`Rate` as `rate`, 
     211                            a.`Hash`, 
     212                            b.`id_album` as `album_id` 
     213                            FROM `bx_photos_main` as a 
     214                            LEFT JOIN `sys_albums_objects` as b ON b.`id_object` = a.`ID` 
     215                            LEFT JOIN `sys_albums` as c ON c.`ID`=b.`id_album` 
     216                            WHERE a.`ID`='" . $iId . "' AND a.`Status`<>'disapproved' and c.`Type`='bx_photos'"; 
    216217        $aImageInfo = ($iId) ? db_arr($sqlQuery) : null; 
    217218        return $aImageInfo; 
  • trunk/modules/boonex/sounds/classes/BxSoundsSearch.php

    r13731 r13775  
    130130    function serviceGetMusicArray ($iPicId, $sImgType) { 
    131131        $iPicId = (int)$iPicId; 
    132         $sqlQuery = "SELECT `ID` as `id`, 
    133                              `Title` as `title`, 
    134                              `Description` as `description`, 
    135                              `Uri` as `uri`, `Owner` as `owner`, 
    136                              `Date` as `date`, 
    137                              `id_album` as `album_id` 
    138                              FROM `RayMp3Files` 
    139                              LEFT JOIN `sys_albums_objects` ON `sys_albums_objects`.`id_object` = `RayMp3Files`.`ID` 
    140                              WHERE `ID`='$iPicId' AND `Status`='approved'"; 
     132        $sqlQuery = "SELECT a.`ID` as `id`, 
     133                            a.`Title` as `title`, 
     134                            a.`Description` as `description`, 
     135                            a.`Uri` as `uri`, 
     136                            a.`Owner` as `owner`, 
     137                            a.`Date` as `date`, 
     138                            b.`id_album` as `album_id` 
     139                        FROM `RayMp3Files` as a 
     140                        LEFT JOIN `sys_albums_objects` as b ON b.`id_object` = a.`ID` 
     141                        LEFT JOIN `sys_albums` as c ON c.`ID`=b.`id_album` 
     142                        WHERE a.`ID`='$iPicId' AND a.`Status`='approved' AND c.`Type`='bx_sounds'"; 
    141143        $aImageInfo = db_arr($sqlQuery); 
    142144        if(empty($aImageInfo) || !is_array($aImageInfo)) 
     
    222224                    'cpt_music_url' => $aMusic['url'], 
    223225                    'cpt_music' => $sMusicTxt, 
    224                     'cnt_player' => getApplicationContent('mp3', 'player', array('id' => $aEvent['object_id'], 'user' => $_COOKIE['memberID'], 'password' => $_COOKIE['memberPassword']), true), 
     226                    'cnt_player' => $this->_getSharedThumb($aEvent['object_id'], $aMusic['url']), 
    225227                    'post_id' => $aEvent['id'] 
    226228                )) 
     
    231233     
    232234    function serviceProfileSoundBlock($iProfileId) { 
    233         $aVars = array ( 
     235        if(!$this->checkMemAction($iProfileId, 'view')) 
     236            return ''; 
     237        $aVars = array ( 
    234238            'title' => false, 
    235239            'prefix' => 'id' . time() . '_' . rand(1, 999999), 
  • trunk/modules/boonex/videos/classes/BxVideosSearch.php

    r13731 r13775  
    112112    function serviceGetVideoArray ($iPicId, $sImgType = 'browse') { 
    113113        $iPicId = (int)$iPicId; 
    114         $sqlQuery = "SELECT `ID` as `id`, 
    115                              `Title` as `title`, 
    116                              `Description` as `description`, 
    117                              `Uri` as `uri`, 
    118                              `Owner` as `owner`, 
    119                              `Date` as `date`, 
    120                              `Video`, 
    121                              `Source`, 
    122                              `id_album` as `album_id` 
    123                       FROM `RayVideoFiles` 
    124                       LEFT JOIN `sys_albums_objects` ON `sys_albums_objects`.`id_object` = `RayVideoFiles`.`ID` 
    125                       WHERE `ID`='$iPicId' AND `Status` != 'disapproved'"; 
     114        $sqlQuery = "SELECT a.`ID` as `id`, 
     115                            a.`Title` as `title`, 
     116                            a.`Description` as `description`, 
     117                            a.`Uri` as `uri`, 
     118                            a.`Owner` as `owner`, 
     119                            a.`Date` as `date`, 
     120                            b.`id_album` as `album_id` 
     121                        FROM `RayVideoFiles` as a 
     122                        LEFT JOIN `sys_albums_objects` as b ON b.`id_object` = a.`ID` 
     123                        LEFT JOIN `sys_albums` as c ON c.`ID`=b.`id_album` 
     124                        WHERE a.`ID`='$iPicId' AND a.`Status`<>'approved' AND c.`Type`='bx_videos'"; 
    126125        $aImageInfo = db_arr($sqlQuery); 
    127126 
     
    211210        } 
    212211        else { 
    213             $sVideoTxt = _t('_bx_videos_wall_video'); 
     212            $sVideoTxt = _t('_bx_videos_wall_video'); 
    214213            $aOut = array(  
    215214                'title' => $aOwner['username'] . ' ' . $sAddedNewTxt . ' ' . $sVideoTxt, 
     
    220219                    'cpt_video_url' => $aVideo['url'], 
    221220                    'cpt_video' => $sVideoTxt, 
    222                     'cnt_player' => $this->oTemplate->getFileConcept($aEvent['object_id'], array('ext'=>$aVideo['video'], 'source'=>$aVideo['source'])), 
     221                    'cnt_player' => $this->_getSharedThumb($aEvent['object_id'], $aVideo['url']), 
    223222                    'post_id' => $aEvent['id'] 
    224223                )) 
     
    229228     
    230229    function serviceProfileVideoBlock($iProfileId) { 
    231         $aVars = array ( 
     230        if(!$this->checkMemAction($iProfileId, 'view')) 
     231            return ''; 
     232        $aVars = array ( 
    232233            'title' => false, 
    233234            'prefix' => 'id' . time() . '_' . rand(1, 999999), 
  • trunk/modules/boonex/wall/classes/BxWallModule.php

    r13611 r13775  
    203203    function actionGetPhotoUploaders($iOwnerId) { 
    204204        $this->_iOwnerId = $iOwnerId;         
    205         return BxDolService::call('photos', 'get_uploader_form', array(array('mode' => 'single', 'category' => 'wall', 'album'=>_t('_wall_photo_album', getNickName($this->_iOwnerId)), 'from_wall' => 1, 'owner_id' => $this->_iOwnerId)), 'Uploader'); 
    206     }    
     205        return BxDolService::call('photos', 'get_uploader_form', array(array('mode' => 'single', 'category' => 'wall', 'album'=>_t('_wall_photo_album', getNickName(getLoggedId())), 'from_wall' => 1, 'owner_id' => $this->_iOwnerId)), 'Uploader'); 
     206    } 
    207207    /** 
    208208     * Get music uploading form. 
     
    212212    function actionGetMusicUploaders($iOwnerId) { 
    213213        $this->_iOwnerId = $iOwnerId; 
    214         return BxDolService::call('sounds', 'get_uploader_form', array(array('mode' => 'single', 'category' => 'wall', 'album'=>_t('_wall_sound_album', getNickName($this->_iOwnerId)), 'from_wall' => 1, 'owner_id' => $this->_iOwnerId)), 'Uploader'); 
     214        return BxDolService::call('sounds', 'get_uploader_form', array(array('mode' => 'single', 'category' => 'wall', 'album'=>_t('_wall_sound_album', getNickName(getLoggedId())), 'from_wall' => 1, 'owner_id' => $this->_iOwnerId)), 'Uploader'); 
    215215    }    
    216216    /** 
     
    221221    function actionGetVideoUploaders($iOwnerId) { 
    222222        $this->_iOwnerId = $iOwnerId; 
    223         return BxDolService::call('videos', 'get_uploader_form', array(array('mode' => 'single', 'category' => 'wall', 'album'=>_t('_wall_video_album', getNickName($this->_iOwnerId)), 'from_wall' => 1, 'owner_id' => $this->_iOwnerId)), 'Uploader'); 
     223        return BxDolService::call('videos', 'get_uploader_form', array(array('mode' => 'single', 'category' => 'wall', 'album'=>_t('_wall_video_album', getNickName(getLoggedId())), 'from_wall' => 1, 'owner_id' => $this->_iOwnerId)), 'Uploader'); 
    224224    } 
    225225    /** 
  • trunk/templates/base/scripts/BxBaseSearchResultSharedMedia.php

    r13727 r13775  
    611611        return $aFiles; 
    612612    } 
     613     
     614    function checkMemAction ($iFileOwner, $sAction = 'view') { 
     615        $iFileOwner = (int)$iFileOwner; 
     616        $sAction = clear_xss($sAction); 
     617        if ($this->oModule->isAdmin($this->oModule->_iProfileId) || $iFileOwner == $this->oModule->_iProfileId) return true; 
     618        $this->oModule->_defineActions(); 
     619        $aCheck = checkAction($this->oModule->_iProfileId, $this->oModule->_defineActionName($sAction)); 
     620        if ($aCheck[CHECK_ACTION_RESULT] != CHECK_ACTION_RESULT_ALLOWED) 
     621            return false; 
     622        return true; 
     623    } 
    613624} 
    614625 
Note: See TracChangeset for help on using the changeset viewer.