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; }