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 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); }
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; }
case 'user_info': if (!$user) { $orca_integration_xml .= '<false />'; } else { $special_user = isSpecialOrcaUser($user); $orca_admin = isOrcaAdmin($user); require_once BX_DIRECTORY_PATH_ROOT . 'inc/utils.inc.php'; require_once BX_DIRECTORY_PATH_ROOT . 'profilePhotos.php'; $oProfile = new BxDolProfile($user); $userID = $oProfile->_iProfileID; $av = $gConf['url']['icon'] . 'basic.gif'; $profile_url = $gConf['url']['base'] . "?action=goto&amp;user={$user}"; if ('admin' == $user) { $av = $gConf['url']['icon'] . 'admin.gif'; } elseif ($userID) { $oPhoto = new ProfilePhotos($userID); $oPhoto->getMediaArray(); $aFile = $oPhoto->getPrimaryPhotoArray(); if (extFileExists($oPhoto->sMediaDir . 'icon_' . $aFile['med_file'])) { $av = $oPhoto->sMediaUrl . 'icon_' . $aFile['med_file']; } elseif ($special_user) { $av = $gConf['url']['icon'] . 'special.gif'; } $profile_url = $site['url'] . 'profile.php?ID=' . $userID; } // Ray integration [begin] $iId = $userID; $sPassword = md5(getPassword($iId)); $bEnableRay = getParam('enable_ray') == 'on'; $check_res = checkAction($iId, ACTION_ID_USE_RAY_IM); $aRay = '<ray_on>0</ray_on>';
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); } }
/** * page code function */ function PageCompPageMainCode() { global $site; global $dir; global $_page; global $p_arr; global $p_arr_new; global $db_vsbl; global $db_editbl; global $tab; global $autoApproval_ifProfile; global $ID; global $MEMBER; global $ADMIN; global $NEW_TO_ADD; global $Featured; global $pic; global $pics; global $pic_num; global $enable_audio_upload; global $enable_video_upload; global $sound_file_exist; global $video_file_exist; global $status_admin_ex; global $change_error_text; global $result_text; global $pictures_text; global $membership_message; global $max_thumb_height; global $max_thumb_width; global $enable_ray; global $enable_ray_pro; ob_start(); if ($NEW_TO_ADD) { $_page['header'] = _t("_New Member"); $_page['header_text'] = _t("_New Member Add Here"); } else { $_page['header'] = process_line_output($p_arr['NickName']) . ": " . process_line_output(strmaxtextlen($p_arr['DescriptionMe'], 45)); $_page['header_text'] = "<b>" . process_line_output($p_arr['NickName']) . "</b> - "; $_page['header_text'] .= _t('_' . $p_arr['Sex']); $_page['header_text'] .= ", " . _t("_y/o", age($p_arr['DateOfBirth'])) . " (ID: {$p_arr['ID']})"; } echo '<table width="100%" cellpadding="0" cellspacing="0" border="0"><tr><td>'; if ($ADMIN && $status_admin_ex) { echo $status_admin_ex; } if ($change_error_text) { echo $change_error_text . '<br />'; } global $moderator; if ($ADMIN && !$moderator) { echo "<div align=right class=text2><a href=\"{$_SERVER['PHP_SELF']}\">" . _t("_Add New Profile") . "</a></div>"; } if ($result_text) { echo '<center>' . $result_text . '</center><br />'; } if ($ADMIN && !$NEW_TO_ADD && $enable_video_upload && $enable_ray && $enable_ray_pro && file_exists($dir['root'] . "ray/modules/video/admin.php")) { $sRayHeaderPath = $dir['root'] . "ray/inc/header.inc.php"; $iId = (int) $p_arr['ID']; $aAdmin = db_arr("SELECT `Name`, `Password` FROM `Admins` LIMIT 1"); $sNick = $aAdmin['Name']; $sPassword = $aAdmin['Password']; echo "<tr><td><div style=\"width:179px; padding-bottom:10px; margin-left:auto; margin-right:auto;\">"; require_once $dir['root'] . "ray/modules/video/admin.php"; echo "</div></td></tr>"; } if ($ADMIN && !$NEW_TO_ADD) { // Print membership information and controls $memberships_arr = getMemberships(); $membership_info = getMemberMembershipInfo($ID); ?> <!-- MEMBERSHIP [BEGIN] --> <tr><td> <center><?php echo $membership_message; ?> </center> <form name="MembershipForm" action="profile_edit.php?ID=<?php echo $p_arr['ID']; ?> " method=post> <input type="hidden" name="SetMembership" value="YES"> <table width=100% cellspacing=0 cellpadding=2 class="text2" border=0> <?php echo print_rows_set_membership(1, $memberships_arr, $membership_info, 3, "table", "panel", "25%"); ?> </table> <center> <input class=no type="submit" value="Set" style="width: 50px;"> </center> </form> <hr> </td></tr> <!-- MEMBERSHIP [ END ] --> <?php } ?> <form name="jform" method="post" action="profile_edit.php?ID=<?php echo $p_arr['ID']; ?> "> <?php if ($NEW_TO_ADD) { ?> <input type="hidden" name="NewProfile" value="YES" /> <?php } ?> <input type="hidden" name="SaveChanges" value="YES" /> <?php if ($ADMIN) { ?> <table cellspacing="0" cellpadding="0" class="small2" align="center"> <tr> <td align="right" width="75%"><?php echo _t("_Mark as Featured"); ?> </td> <td align="left" width="25%"> <input type="checkbox" name="Featured" <?php if ($Featured) { echo 'checked="checked"'; } ?> > </td> </tr> </table> <?php } ?> <table border="0" cellspacing="0" cellpadding="0" width="100%"> <tr> <td valign="top"> <table border="0" cellspacing="1" cellpadding="0" width="100%"> <tr><td align="center" valign="middle"> <?php if ($NEW_TO_ADD) { echo _t("_New Member") . '<br /><br />'; } else { ?> <table border="0" cellspacing="0" cellpadding="0" width="250"> <tr> <td align="center" valign="middle" style="position:relative; display:block;width:112px;"> <?php echo get_member_thumbnail($p_arr['ID'], 'none'); ?> </td> <td> <?php $yes_ph = 0; require_once BX_DIRECTORY_PATH_ROOT . 'profilePhotos.php'; $oPhoto = new ProfilePhotos($p_arr['ID']); $oPhoto->getMediaArray(); $yes_ph = $oPhoto->iMediaCount; if ($yes_ph) { ?> <a href="<?php echo $site['url']; ?> photos_gallery.php?ID=<?php echo $p_arr['ID']; ?> " ><?php echo _t("_More Photos"); ?> </a><br /> <?php } if (!$MEMBER) { echo "<div class=small2>" . _t("_Last logged in") . ": "; if (!$p_arr['LastLoggedIn'] || $p_arr['LastLoggedIn'] == "0000-00-00 00:00:00") { echo _t("_never"); } else { echo $p_arr['LastLoggedIn']; } echo "</div>"; } else { echo _t("_Profile status"); ?> : <b><font class=prof_stat_<?php echo $p_arr['Status']; ?> > <?php echo _t("_" . $p_arr['Status']); ?> </font></b><br /> <?php if ($MEMBER) { switch ($p_arr['Status']) { case 'Active': echo '<a href="change_status.php">' . _t("_Suspend account") . '</a><br />'; break; case 'Suspended': echo '<a href="change_status.php">' . _t("_Activate account") . '</a><br />'; break; } } } ?> </td></tr> </table> <?php } ?> </td> <td valign="top" align="center" width="100%"> <?php $free_mode = getParam("free_mode") == "on" ? 1 : 0; ?> </td> </table> </td></tr> <tr><td> <table class="profile_edit_table"><!-- Profile edit page --> <?php $first_row = 1; $rd = !($ADMIN || $MEMBER); $columns = 2; $respd = db_res("SELECT *, (`editable` & {$db_editbl}) AS `is_editable` FROM `ProfilesDesc` WHERE `visible` & {$db_vsbl} AND ( FIND_IN_SET('0', `show_on_page`) OR FIND_IN_SET('" . (int) $_page['name_index'] . "', show_on_page)) ORDER BY `order` ASC"); while ($arrpd = mysql_fetch_array($respd)) { $fname = get_input_name($arrpd); if ($arrpd['get_value'] && $arrpd['to_db'] == 0) { $funcbody = $arrpd['get_value']; $func = create_function('$arg0', $funcbody); $p_arr[$fname] = $func($p_arr_new); } if ($arrpd['is_editable'] && isset($p_arr_new[$fname])) { $p_arr[$fname] = $p_arr_new[$fname]; } $not_first_row = 0; $read_only = !$arrpd['is_editable']; switch ($arrpd['type']) { case 'set': // set of checkboxes echo print_row_set($first_row, $arrpd, $p_arr[$fname], "table", $rd, $columns, "", $read_only); break; case 'rb': // radio buttons echo print_row_radio_button($first_row, $arrpd, $p_arr[$fname], "table", $rd, $columns, "", $read_only); break; case 'r': // reference to array for combo box if ($fname == 'Country') { $onchange = "flagImage = document.getElementById('flagImageId'); flagImage.src = '{$site['flags']}' + this.value.toLowerCase() + '.gif';"; if (strlen($p_arr[$fname]) == 0) { $p_arr[$fname] = getParam('default_country'); } $imagecode = '<img id="flagImageId" src="' . ($site['flags'] . strtolower($p_arr[$fname])) . '.gif" alt="flag" />'; } else { $onchange = ''; $imagecode = ''; } echo print_row_ref($first_row, $arrpd, $p_arr[$fname], "table", $rd, $columns, "", $read_only, $onchange, $imagecode); break; case '0': // divider echo print_row_delim($first_row, $arrpd, "panel", $columns); $not_first_row = 1; $first_row = 1; break; case 'e': // enum combo box. if field name is 'Sex', than this is simple text, user can not change it echo print_row_enum($first_row, $arrpd, $p_arr[$fname], "table", $javascript, $rd, $columns, "", $read_only); break; case 'en': // enum combo box with numbers echo print_row_enum_n($first_row, $arrpd, $p_arr[$fname], "table", $rd, $columns, "", $read_only); break; case 'eny': // enum combo box with years echo print_row_enum_years($first_row, $arrpd, $p_arr[$fname], "table", $rd, $columns, "", $read_only); break; case 'a': // text Area echo print_row_area($first_row, $arrpd, $p_arr[$fname], "table", $rd, $columns, "", $read_only); break; case 'c': // input box echo print_row_edit($first_row, $arrpd, $p_arr[$fname], "table", $rd, $columns, "", $read_only); break; case 'date': // date echo print_row_date($first_row, $arrpd, $p_arr[$fname], "table", $rd, $columns, "", $read_only); break; case 'p': // input box password echo print_row_pwd($first_row, $arrpd, '', "table", $rd, $columns, "", $read_only); break; default: $not_first_row = 1; } if (!$not_first_row && $first_row == 1) { $first_row = 0; } } ?> </table> </td></tr> </table> <br /> <?php if (!!($ADMIN || $MEMBER)) { ?> <center><input type="submit" value="<?php echo _t("_Save Changes"); ?> " /></center> </form> <br /> <?php if ($MEMBER && !$NEW_TO_ADD) { if (!$autoApproval_ifProfile) { attention(_t("_PROFILE_WARNING1", $site['title'])); } attention(_t("_PROFILE_WARNING2", $site['title'])); } } echo "</td></tr></table>"; $ret = ob_get_clean(); return $ret; }
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; }