function getPageMainCode()
{
    $aPhotoConf = array();
    $aPhotoConf['profileID'] = (int) $_REQUEST['ID'];
    $aPhotoConf['visitorID'] = (int) $_COOKIE['memberID'];
    $aPhotoConf['isOwner'] = $aPhotoConf['profileID'] == $aPhotoConf['visitorID'] ? true : false;
    if ($aPhotoConf['isOwner']) {
        header("Location:upload_media.php?show=photos");
        exit;
    }
    $check_res = checkAction($aPhotoConf['visitorID'], ACTION_ID_VIEW_PHOTOS);
    if ($check_res[CHECK_ACTION_RESULT] != CHECK_ACTION_RESULT_ALLOWED) {
        $ret = '
			<table width="100%" cellpadding="4" cellspacing="4" border="0">
				<tr>
					<td align="center">' . $check_res[CHECK_ACTION_MESSAGE] . '</td>
				</tr>
			</table>';
        return $ret;
    }
    $oPhotos = new ProfilePhotos($aPhotoConf['profileID']);
    $oPhotos->getActiveMediaArray();
    $ret = '';
    if ($_REQUEST['voteSubmit'] && $_REQUEST['photoID']) {
        $oPhotos->setVoting();
        header('Location:' . $_SERVER['PHP_SELF'] . '?ID=' . $oPhotos->iProfileID . '&photoID=' . $_REQUEST['photoID']);
    }
    if (!$aPhotoConf['isOwner']) {
        $ret .= ProfileDetails($oPhotos->iProfileID);
        $ret .= '<div class="clear_both"></div>';
    }
    if (0 < $_REQUEST['photoID']) {
        $iPhotoID = $_REQUEST['photoID'];
        $ret .= $oPhotos->getMediaPage($iPhotoID);
    } else {
        $ret .= $oPhotos->getMediaPage();
    }
    return $ret;
}
function get_member_icon($ID, $float = 'none', $bDrawMargin = FALSE)
{
    global $site;
    require_once BX_DIRECTORY_PATH_ROOT . 'profilePhotos.php';
    //$sSexSql = "SELECT `Sex` FROM `Profiles` WHERE `ID` = '{$ID}'";
    $aSexSql = getProfileInfo($ID);
    //db_arr( $sSexSql );
    $oPhoto = new ProfilePhotos($ID);
    $oPhoto->getActiveMediaArray();
    $aFile = $oPhoto->getPrimaryPhotoArray();
    if (extFileExists($oPhoto->sMediaDir . 'icon_' . $aFile['med_file'])) {
        $sFileName = $oPhoto->sMediaUrl . 'icon_' . $aFile['med_file'];
    } else {
        if ($aSexSql['Sex'] == 'female' or $aSexSql['Sex'] == 'Female') {
            $sSexPic = 'woman_small.gif';
        } elseif ($aSexSql['Sex'] == 'male' or $aSexSql['Sex'] == 'Male') {
            $sSexPic = 'man_small.gif';
        } else {
            $sSexPic = 'visitor_small.gif';
        }
        $sFileName = getTemplateIcon($sSexPic);
    }
    $sMarginsAddon = $bDrawMargin ? " margin-right:10px;margin-bottom:10px; " : '';
    $style = 'width:' . $oPhoto->aMediaConfig['size']['iconWidth'] . 'px;' . 'height:' . $oPhoto->aMediaConfig['size']['iconHeight'] . 'px;' . 'background-image:url(' . $sFileName . ');';
    $ret = '';
    $ret .= '<div class="thumbnail_block" style="float:' . $float . '; position:relative; ">';
    $ret .= "<a href=\"" . getProfileLink($ID) . "\">";
    $ret .= '<img src="' . getTemplateIcon('spacer.gif') . '" style="' . $sMarginsAddon . $style . '" alt="' . process_line_output($aFileName['med_title']) . '" />';
    $ret .= '</a>';
    $ret .= '</div>';
    return $ret;
}
 function showBlockPhoto($iCol, $bNoDB = false)
 {
     if ($iCol == 1) {
         $iPID = $this->_iProfileID;
         $sNickName = $this->_aProfile['NickName'];
     } elseif ($iCol == 2) {
         if (!$this->_aProfile['Couple']) {
             return;
         }
         $iPID = $this->_iProfileID;
         //$iPID = (int)$this -> _aProfile['Couple'];
         $sNickName = $this->_aProfile['NickName'] . '(2)';
     }
     $oPhotos = new ProfilePhotos($iPID);
     $oPhotos->getActiveMediaArray();
     if ($this->_aProfile['Couple'] && $iCol != 1) {
         $aCoupleInfo = getProfileInfo($this->_aProfile['Couple']);
         if ($aCoupleInfo['Picture'] == 0) {
             $oPhotos = new ProfilePhotos($this->_aProfile['Couple']);
             $oPhotos->getActiveMediaArray();
         }
         $ret = $oPhotos->getMediaBlock($aCoupleInfo['PrimPhoto'], true);
     } else {
         $ret = $oPhotos->getMediaBlock(0);
     }
     if ($bNoDB) {
         return DesignBoxContent(_t('_PROFILE Photos', $sNickName), $ret, 1);
     } else {
         echo DesignBoxContent(_t('_PROFILE Photos', $sNickName), $ret, 1);
     }
 }
Пример #4
0
function get_member_primary_photo($ID, $float)
{
    global $site;
    require_once BX_DIRECTORY_PATH_ROOT . 'profilePhotos.php';
    $oPhoto = new ProfilePhotos($ID);
    $oPhoto->getActiveMediaArray();
    $aFile = $oPhoto->getPrimaryPhotoArray();
    if (extFileExists($oPhoto->sMediaDir . 'photo_' . $aFile['med_file'])) {
        $sFileName = $oPhoto->sMediaUrl . 'photo_' . $aFile['med_file'];
    } else {
        $sFileName = getTemplateIcon($oPhoto->sSexPic);
    }
    $style = 'width:' . $oPhoto->aMediaConfig['size']['photoWidth'] . 'px;' . 'height:' . $oPhoto->aMediaConfig['size']['photoHeight'] . 'px;' . 'background-image:url(' . $sFileName . ');';
    $ret = '';
    $ret .= '<div class="thumbnail_block" style="float:' . $float . '; ">';
    $ret .= "<a href=\"{$site['url']}upload_media.php\">";
    $ret .= '<img src="' . getTemplateIcon('spacer.gif') . '" style="' . $style . '" alt="' . process_line_output($aFileName['med_title']) . '" />';
    $ret .= '</a>';
    $ret .= '</div>';
    return $ret;
}
 function showBlockPhoto($sCaption)
 {
     global $memberID;
     global $p_arr;
     $oPhotos = new ProfilePhotos($this->_iProfileID);
     $oPhotos->getActiveMediaArray();
     /*
     		//perform photo voting
     		if( $_REQUEST['voteSubmit'] && $_REQUEST['photoID'] )
     		{
     			$oPhotos -> setVoting();
     			$oPhotos -> getActiveMediaArray();
     		}
     */
     $iPhotoID = (int) $_REQUEST['photoID'];
     $ret = $oPhotos->getMediaBlock($iPhotoID);
     echo DesignBoxContent(_t($sCaption, $p_arr['NickName']), $ret, 1);
 }