function getLatestNews()
    {
        $iNewsOnHome = $this->oTemplConfig->iMaxNewsOnIndex;
        $query = "\r\n\t\t\tSELECT\r\n\t\t\t\t`ID`,\r\n\t\t\t\t`Text`,\r\n\t\t\t\t`Header`,\r\n\t\t\t\t`Date`\r\n\t\t\tFROM\r\n\t\t\t\t`News`\r\n\t\t\tORDER BY `Date` DESC\r\n\r\n\t\t\tLIMIT {$iNewsOnHome}\r\n\t\t;";
        $rNews = $this->oDb->getAll($query);
        if (!is_array($rNews['0'])) {
            return _t_action('_No news available');
        }
        $ret = '';
        foreach ($rNews as $aNews) {
            $ret .= '
				<div class="indexNewsBlock">
					<div class="indexNewsHeader">
						<a href="' . $this->aSite['url'] . 'news_view.php?ID=' . process_line_output($aNews['ID']) . '">
							' . strmaxtextlen(process_line_output($aNews['Header']), $this->oTemplConfig->iNewsHeader) . '
						</a>
					</div>
					<div class="indexNewsText">
						' . strmaxtextlen(process_html_output($aNews['Text']), $this->oTemplConfig->iNewsPreview) . '
					</div>
					<div class="indexNewsDate">
						' . process_line_output($aNews['Date']) . '
					</div>
				</div>
			';
        }
        $ret .= '<div class="indexNewsArchive"><a href="' . $this->aSite['url'] . 'news.php">' . _t("_Read news in archive") . '</a></div>';
        return $ret;
    }
function PageCompPageMainCode()
{
    global $site;
    global $oTemplConfig;
    $aPhoto = getVotingItem();
    $check_res = checkAction($_COOKIE['memberID'], ACTION_ID_RATE_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;
    }
    $ret = '';
    if ($_GET['prev_id']) {
        $ret .= showPreviousRated((int) $_GET['prev_id']);
    }
    if ($oTemplConfig->customize['rate']['showSexSelector']) {
        $ret .= '<div class="rate_sex_form">';
        $ret .= '<form method="post" name="FormVote" action="' . $_SERVER['PHP_SELF'] . '">';
        $ret .= '<span>';
        $ret .= _t("_Show me");
        $ret .= '</span>';
        $ret .= '<span>';
        $ret .= '<select name="showme" onchange="document.forms[\'FormVote\'].submit()">' . "\n";
        $selected_all = $_REQUEST['showme'] == 'all' || strlen(trim($_REQUEST['showme'])) == 0 ? ' selected="selected" ' : '';
        $ret .= '<option value="all"' . $selected_all . '>' . _t("_all") . '</option>';
        $ret .= SelectOptions('Sex', $_REQUEST['showme']);
        $ret .= '</select>';
        $ret .= '</span>';
        $ret .= '</form>';
        $ret .= '</div>';
    }
    if (empty($aPhoto)) {
        $ret .= _t_action('_there_is_no_photo_that_you_can_rate');
    } else {
        if ($oTemplConfig->customize['rate']['showProfileInfo']) {
            $ret .= '<div class="clear_both"></div>';
            $ret .= ProfileDetails($aPhoto['med_prof_id']);
            $ret .= '<div class="clear_both"></div>';
        }
        $ret .= getRatingPhoto($aPhoto);
        $oVotingView = new BxTemplVotingView('media', (int) $aPhoto['med_id']);
        if ($oVotingView->isEnabled()) {
            $sUrlAdd = '';
            if ($_REQUEST['showme']) {
                $sUrlAdd .= 'showme=' . $_REQUEST['showme'] . '&';
            }
            $ret .= "\r\n\t\t\t\t<script>\r\n\t\t\t\t\tBxDolVoting.prototype.onvote = function (fRate, iCount)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tdocument.location = '{$site['url']}rate.php?{$sUrlAdd}prev_id=' + this._iObjId;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tBxDolVoting.prototype.onvotefail = function ()\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tdocument.location = '{$site['url']}rate.php?{$sUrlAdd}prev_id=' + this._iObjId;\r\n\t\t\t\t\t}\r\n\t\t\t\t</script>";
            $ret .= '<div style="margin-left:55px">' . $oVotingView->getBigVoting() . '</div>';
        }
    }
    return $ret;
}
function PageCompPageMainCodeWithForm()
{
    global $oTemplConfig;
    global $site;
    $sActionText = '';
    if (isset($_POST['do_submit'])) {
        if (!isset($_POST['securityImageValue']) || !isset($_COOKIE['strSec']) || md5($_POST['securityImageValue']) != $_COOKIE['strSec']) {
            $sActionText = _t_err('_SIMG_ERR');
        } else {
            $sSenderName = process_db_input($_POST['name']);
            $sSenderEmail = process_db_input($_POST['email']);
            $sLetterSubject = process_db_input($_POST['subject']);
            $sLetterBody = process_db_input($_POST['body']);
            $sLetterBody = $sLetterBody . "\r\n" . '============' . "\r\n" . _t('_from') . ' ' . $sSenderName . "\r\n" . 'with email ' . $sSenderEmail;
            if (sendMail($site['email'], $sLetterSubject, $sLetterBody)) {
                $sActionText = _t_action('_ADM_PROFILE_SEND_MSG');
            } else {
                $sActionText = _t_err('_Email sent failed');
            }
        }
    }
    ob_start();
    echo $sActionText;
    ?>
	<form action="<?php 
    echo $_SERVER['PHP_SELF'];
    ?>
" method="post">
		<table class="messageBlock">
			<tr>
				<td class="contact_label"><?php 
    echo _t('_Your name');
    ?>
:</td>
				<td class="contact_value"><input type="text" name="name" value="" class="inputText" /></td>
			</tr>
			<tr>
				<td class="contact_label"><?php 
    echo _t('_Your email');
    ?>
:</td>
				<td class="contact_value"><input type="text" name="email" value="" class="inputText"  onkeyup="if( emailCheck( this.value ) ) this.form.do_submit.disabled=false; else this.form.do_submit.disabled=true;" /></td>
			</tr>
			<tr>
				<td class="contact_label"><?php 
    echo _t('_message_subject');
    ?>
:</td>
				<td class="contact_value"><input type="text" name="subject" value="" class="inputText" /></td>
			</tr>
			<tr>
				<td class="contact_label"><?php 
    echo _t('_Message text');
    ?>
:</td>
				<td class="contact_value"><textarea name="body" class="inputTextarea"></textarea></td>
			</tr>
			<tr>
				<td class="contact_label"><?php 
    echo _t("_Enter what you see:");
    ?>
</div>
				<td class="contact_value">
					<img alt="Security Image" src="<?php 
    echo $site['url'];
    ?>
simg/simg.php" /><br />
					<input name="securityImageValue" type="text" size="15" />
				</td>
			</tr>
			<tr>
				<td colspan="2" class="contact_submit"><input type="submit" name="do_submit" value="<?php 
    echo _t('_Submit');
    ?>
" disabled="disabled"/></td>
			</tr>
		</table>
	</form>
	<?php 
    $ret = ob_get_clean();
    return DesignBoxContent(_t("_CONTACT_H1"), $ret, $oTemplConfig->PageCompThird_db_num);
}
function PageCompMainCode()
{
    global $tmpl, $_page, $oTemplConfig;
    global $enable_video_upload, $enable_audio_upload;
    $iProfileID = (int) $_COOKIE['memberID'];
    $show = $_REQUEST['show'];
    switch ($show) {
        case 'audio':
            if ($enable_audio_upload) {
                require_once BX_DIRECTORY_PATH_ROOT . 'uploadAudio.php';
                $oMedia = new UploadAudio($iProfileID);
                $oMedia->getMediaArray();
                $_page['header_text'] = _t("_My Audio");
            }
            break;
        case 'video':
            if ($enable_video_upload) {
                require_once BX_DIRECTORY_PATH_ROOT . 'uploadVideo.php';
                $oMedia = new UploadVideo($iProfileID);
                $oMedia->getMediaArray();
                $_page['header_text'] = _t("_My Videos");
            }
            break;
        case 'photo':
        default:
            require_once BX_DIRECTORY_PATH_ROOT . 'uploadPhoto.php';
            $oMedia = new UploadPhoto($iProfileID);
            $oMedia->getMediaArray();
            $_page['header_text'] = _t("_My Photos");
            break;
    }
    //	print_r($oMedia -> aMediaConfig);
    $ret = '';
    $ret .= '
			<script type="text/javascript">

				function checkForm()
				{


					var el;
					var hasErr = false;
					var fild = "";

					el = document.getElementById("mediaTitle");
					if( el.value.length < ' . $oMedia->aMediaConfig['min']['mediaTitle'] . ' )
					{
						el.style.backgroundColor = "pink";
						el.style.border = "1px solid silver";
						hasErr = true;
						fild += "\\n ' . _t('_title_min_lenght', $oMedia->aMediaConfig['min']['mediaTitle']) . '";
					}
					else
					{
						el.style.backgroundColor = "#fff";
					}

					if (hasErr)
					{
						alert( fild )
						return false;

					}
					else
					{
						return true;
					}


					return false;
				}
			</script>
';
    if ($oTemplConfig->customize['upload_media']['showMediaTabs']) {
        $ret .= '<div class="choiseBlock">';
        $ret .= getMediaTabs($oMedia->sMediaType, $oMedia->aMediaConfig['enable']);
        $ret .= '</div>' . "\n";
        $ret .= '<div class="clear_both"></div>';
    }
    if ($oTemplConfig->customize['upload_media']['showAddButton']) {
        $ret .= '<div class="addNew">';
        $ret .= '<a href="javascript:void(0);" onclick="return BxShowBlock(\'addNewBlock\');">' . _t('_add_new', _t('_' . $oMedia->sMediaType . '')) . '</a>';
        $ret .= '</div>' . "\n";
    }
    //$ret .= ' Max -- [' . $oMedia -> aMediaConfig['max'][$oMedia -> sMediaType] . ']<br>';
    //$ret .= ' Med Count -- [' . $oMedia -> iMediaCount . ']<br>';
    $ret .= '<div id="addNewBlock" style="display:' . $oTemplConfig->customize['upload_media']['addNewBlock_display'] . ';">';
    if ($oMedia->iMediaCount >= $oMedia->aMediaConfig['max'][$oMedia->sMediaType]) {
        $ret .= _t_action('_too_many_files');
    } else {
        $ret .= '<form enctype="multipart/form-data" action="' . $oMedia->aMediaConfig['url']['media'] . '?show=' . $oMedia->sMediaType . '" method="post" onsubmit="return checkForm();">';
        $ret .= '<div>';
        $ret .= _t('_Title');
        $ret .= '&nbsp;(&nbsp;<span id="charCount" class="charCount">' . $oMedia->aMediaConfig['max']['mediaTitle'] . '</span>';
        $ret .= '<span class="charCount">' . _t('_characters_left') . '</span>&nbsp;)';
        $ret .= '</div>' . "\n";
        $ret .= '<div>';
        $ret .= '<input type="text" name="title" class="title" id="mediaTitle" onkeydown="return charCounter(\'mediaTitle\', ' . $oMedia->aMediaConfig['max']['mediaTitle'] . ', \'charCount\');" onkeyup="return charCounter(\'mediaTitle\', ' . $oMedia->aMediaConfig['max']['mediaTitle'] . ', \'charCount\');"  />';
        $ret .= '</div>' . "\n";
        $ret .= '<div>';
        $ret .= '<input type="file" size="34" name="' . $oMedia->sMediaType . '" class="file" />';
        $ret .= '</div>' . "\n";
        $ret .= '<div>';
        $ret .= '<input type="submit" value="' . _t('_Submit') . '">';
        $ret .= '<input type="hidden" name="media_type" value="' . $oMedia->sMediaType . '" />';
        $ret .= '<input type="hidden" name="show" value="' . $oMedia->sMediaType . '" />';
        $ret .= '<input type="hidden" name="action" value="upload" />';
        $ret .= '</div>' . "\n";
        $ret .= '</form>';
    }
    $ret .= '</div>' . "\n";
    $action = $_REQUEST['action'];
    if ($_POST['makePrim'] || isset($_POST['makePrim_x'])) {
        $action = 'makePrim';
    } elseif ($_POST['deletePhoto'] || isset($_POST['deletePhoto_x'])) {
        $action = 'deletePhoto';
    }
    $iPhotoID = (int) $_REQUEST['photoID'];
    $iMediaID = (int) $_REQUEST['mediaID'];
    switch ($action) {
        case 'upload':
            $ret .= $oMedia->uploadMedia();
            header('Location:' . $_SERVER['PHP_SELF'] . '?show=' . $oMedia->sMediaType);
            break;
        case 'makePrim':
            $ret .= $oMedia->makePrimPhoto($iPhotoID);
            header('Location:' . $_SERVER['PHP_SELF'] . '?show=' . $oMedia->sMediaType);
            break;
        case 'deletePhoto':
            $ret .= $oMedia->deleteMedia($iPhotoID);
            header('Location:' . $_SERVER['PHP_SELF'] . '?show=' . $oMedia->sMediaType);
            break;
        case 'delete':
            $ret .= $oMedia->deleteMedia($iMediaID);
            header('Location:' . $_SERVER['PHP_SELF'] . '?show=' . $oMedia->sMediaType);
            break;
    }
    switch ($show) {
        case 'audio':
            if ($enable_audio_upload) {
                $ret .= $oMedia->getMediaPage();
            } else {
                $ret .= '';
            }
            break;
        case 'video':
            if ($enable_video_upload) {
                $ret .= $oMedia->getMediaPage();
                //------------------ Ray Integration ------------------//
                $ret .= '<div class="clear_both"></div>';
                $ret .= '<div class="addNew"><center>';
                if (widgetExists('video')) {
                    $sRayHeaderPath = $dir['root'] . "ray/inc/header.inc.php";
                    $iId = (int) $_COOKIE['memberID'];
                    $sPassword = getPassword($iId);
                    $ret .= getApplicationContent('video', 'recorder', array('id' => $iId, 'password' => $sPassword));
                }
                $ret .= '</center></div>';
                //------------------ Ray Integration ------------------//
            } else {
                $ret .= '';
            }
            break;
        case 'photo':
        default:
            if ($_REQUEST['photoID']) {
                $iPhotoId = (int) $_REQUEST['photoID'];
                $ret .= $oMedia->getMediaPage($iPhotoId);
            } else {
                $ret .= $oMedia->getMediaPage();
            }
            break;
    }
    return $ret;
}
function upload_photo($pic_index)
{
    global $pics;
    global $site;
    global $p_arr;
    global $gl_pic;
    global $dir;
    global $pictures_text;
    global $COMPOSITE;
    global $ADMIN;
    $autoApproval_ifPhoto = isAutoApproval('photo');
    $up_name = "file_{$pic_index}";
    $pic_addon_field = "Pic_{$pic_index}_addon";
    $temp_filename = tempnam(rtrim($dir['tmp'], '/'), $p_arr['ID']);
    unlink($temp_filename);
    $pic_name = $pics[$pic_index]['name'];
    $pic_tmp = $_FILES[$up_name]['tmp_name'];
    $ext = strrchr($_FILES[$up_name]['name'], '.');
    if ($pics[$pic_index]['exist']) {
        unlink("{$pic_name}.jpg");
    }
    $scan = getimagesize($_FILES[$up_name]['tmp_name']);
    if (1 != $scan[2] && 2 != $scan[2] && 3 != $scan[2] && 6 != $scan[2]) {
        return 0;
    }
    if (move_uploaded_file($pic_tmp, "{$temp_filename}{$ext}")) {
        if (imageResize("{$temp_filename}{$ext}", "{$temp_filename}.jpg", $gl_pic['pic']['width'], $gl_pic['pic']['height'], true)) {
            echo _t("_FAILED_TO_UPLOAD_PIC", $_FILES[$up_name]['name'], "undef");
            return 0;
        }
        if (strtolower($ext) != '.jpg') {
            unlink("{$temp_filename}{$ext}");
        }
        if (getParam('enable_watermark') == 'on') {
            $transparent1 = getParam('transparent1');
            $water_mark = $dir['profileImage'] . getParam('Water_Mark');
            if (strlen(getParam('Water_Mark')) && file_exists($water_mark)) {
                applyWatermark("{$temp_filename}.jpg", "{$temp_filename}.jpg", $water_mark, $transparent1);
            }
        }
        srand(time());
        $p_arr[$pic_addon_field] = rand(10000, 99999);
        $pics[$pic_index]['name'] = "{$dir['profileImage']}{$p_arr['ID']}_{$pic_index}_" . $p_arr[$pic_addon_field];
        $pic_name = $pics[$pic_index]['name'];
        if (!rename("{$temp_filename}.jpg", "{$pic_name}.jpg")) {
            echo _t("_FAILED_TO_UPLOAD_PIC", $_FILES[$up_name]['name'], "fail to rename");
            return 0;
        }
        db_res("UPDATE `Profiles` SET {$pic_addon_field} = '" . $p_arr[$pic_addon_field] . "' WHERE ID = {$p_arr['ID']}");
        chmod("{$pic_name}.jpg", 0644);
        $pictures_text = _t_action('_Successfully uploaded');
        $pics[$pic_index]['exist'] = true;
        if ($p_arr['Status'] == 'Active' && !$autoApproval_ifPhoto && !$ADMIN) {
            $update_res = db_res("UPDATE `Profiles` SET `Status` = 'Approval' WHERE `ID` = {$p_arr['ID']}");
            $p_arr['Status'] = 'Approval';
            modules_block($p_arr['ID']);
        }
        createUserDataFile($p_arr['ID']);
        return 1;
    } else {
        echo _t_err("_FAILED_TO_UPLOAD_PIC", $_FILES[$up_name]['name'], "undef");
    }
    return 0;
}
/**
* page code function
*/
function PageCompPageMainCode()
{
    global $site;
    $ret = '';
    $en_inbox_notify = getParam("enable_inbox_notify");
    $en_dest_choice = getParam("enable_msg_dest_choice");
    $free_mode = getParam("free_mode");
    $member['ID'] = (int) $_COOKIE['memberID'];
    $member['Password'] = $_COOKIE['memberPassword'];
    $recipientID = getID($_REQUEST['ID'], 0);
    $recipient = getProfileInfo($recipientID);
    $contact_allowed = contact_allowed($member['ID'], $recipientID);
    // Check if credits could be used for message sending
    $could_use_credits = false;
    // Check if member can send messages
    $check_res = checkAction($member['ID'], ACTION_ID_SEND_MESSAGE);
    if ($check_res[CHECK_ACTION_RESULT] != CHECK_ACTION_RESULT_ALLOWED && !$could_use_credits && !$contact_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;
    }
    // Set if credits should be used anyway
    $must_use_credits = $could_use_credits && $check_res[CHECK_ACTION_RESULT] != CHECK_ACTION_RESULT_ALLOWED;
    //ob_start();
    $ret = '';
    if ($_POST['action'] == "send" && strlen($_POST['text'])) {
        $action_result = "";
        // Check if recipient found
        if (!$recipient) {
            $ret = "\r\n\t\t\t\t<table width=\"100%\" cellpadding=\"4\" cellspacing=\"4\" align=\"center\">\r\n\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t<td align=center>" . _t("_COMPOSE_REJECT_MEMBER_NOT_FOUND") . "</td>\r\n\t\t\t\t\t</tr>\r\n\t\t\t\t</table>\n";
            return $ret;
        }
        // Perform sending
        $send_result = MemberSendMessage($member, $recipient, $must_use_credits);
        switch ($send_result) {
            case 1:
                $action_result .= _t_err("_FAILED_TO_SEND_MESSAGE");
                $hide_form = '0';
                break;
            case 3:
                $action_result .= _t_err("_You have to wait for PERIOD minutes before you can write another message!", 1);
                $hide_form = '1';
                break;
            case 5:
                $action_result .= _t_err("_FAILED_TO_SEND_MESSAGE_BLOCK");
                $hide_form = '0';
                break;
            case 10:
                $action_result .= _t_err("_FAILED_TO_SEND_MESSAGE_NOT_ACTIVE");
                $hide_form = '0';
                break;
            case 21:
                $action_result .= _t_err("_FAILED_TO_SEND_MESSAGE_NO_CREDITS");
                $hide_form = '0';
                break;
            default:
                $action_result .= _t_action("_MESSAGE_SENT");
                $hide_form = '1';
                break;
        }
    }
    $ret .= '<div class="com_box"">';
    if (strlen($action_result)) {
        $ret .= $action_result;
    }
    if ($recipient && $hide_form != '1') {
        $ret .= '<div class="clear_both"></div>';
        $ret .= ProfileDetails($recipient['ID']);
        $ret .= '<div class="clear_both"></div>';
    }
    if ('1' != $hide_form) {
        $sSubject = isset($_REQUEST['subject']) ? 'Re: ' . process_db_input($_REQUEST['subject']) : '';
        ob_start();
        ?>
		<script type="text/javascript">
			<!--
			function changeDest(control)
			{
				if ( control.value == 'lovemail' )
				{
					z = document.getElementById("id0004");
					z.disabled = false;
				}
				else
				{
					xxx = document.getElementById("id0004");
					xxx.disabled = true;
				}
			}
			
			function checkForm()
			{
				var el;
				var hasErr = false;
				var fild = "";
				el = document.getElementById("inpSubj");
				if( el.value.length < 3 )
				{
					el.style.backgroundColor = "pink";
					el.style.border = "1px solid silver";
					hasErr = true;
					fild += " <?php 
        echo _t('_Subject');
        ?>
";
				}
				else
					el.style.backgroundColor = "#fff";
				
				if (hasErr)
				{
					alert( "<?php 
        echo _t('_please_fill_next_fields_first');
        ?>
!" + fild )
					return false;
				}
				else
				{
					return true;
				}
				return false;
			}
			//-->
		</script>
		
		<form name="compose_form" method="post"
		  action="<?php 
        echo $_SERVER['PHP_SELF'] . ($recipient ? "?ID={$recipient['ID']}" : "");
        ?>
" onsubmit="return checkForm();">
			<table class="composeTable">
				<tr>
		<?php 
        if (!$recipient) {
            ?>
					<td class="form_label"><?php 
            echo _t("_SEND_MSG_TO");
            ?>
</td>
					<td class="form_value">
						<input class="inpMessageTo" type="text" name="ID" />
					</td>
				</tr>
				<tr>
			<?php 
        }
        ?>
					<td class="form_label"><?php 
        echo _t('_Subject');
        ?>
:</td>
					<td class="form_value">
						<input class="inpSubj" id="inpSubj" name="mes_subject" type="text" value="<?php 
        echo $sSubject;
        ?>
" />
					</td>
				</tr>
				<tr>
					<td class="form_label"><?php 
        echo _t("_Message text");
        ?>
:</td>
					<td class="form_value">
						<textarea class="blogText" id="blogText" name="text"></textarea>
					</td>
				</tr>
		<?php 
        if ($_POST['notify'] == 'on') {
            $notify_sel = "checked";
        } else {
            $notify_sel = "";
        }
        switch ($_POST['sendto']) {
            case 'email':
                $email_sel = ' checked="checked" ';
                $lovemail_sel = "";
                $both_sel = "";
                break;
            case 'lovemail':
                $email_sel = "";
                $lovemail_sel = ' checked="checked"';
                $both_sel = "";
                break;
            default:
                $email_sel = "";
                $lovemail_sel = "";
                $both_sel = ' checked="checked"';
                break;
        }
        if ('on' == $en_dest_choice) {
            $javascript = $en_inbox_notify ? "" : "onClick=\"javascript: changeDest(this);\"";
            $notify_dis = "";
            if (!$lovemail_sel && $en_dest_choice) {
                $notify_sel = "";
                $notify_dis = ' disabled="disabled"';
            }
            ?>
				<tr>
					<td>&nbsp;</td>
					<td nowrap="nowrap">
						<input type="radio" id="id0001" name="sendto" value="email"  <?php 
            echo $javascript . $email_sel;
            ?>
 />
						<label for="id0001"><?php 
            echo _t("_Send to e-mail");
            ?>
</label>
					</td>
				</tr>
				<tr>
					<td>&nbsp;</td>
					<td>
						<input type="radio" id="id0002" name="sendto" value="lovemail" <?php 
            echo $javascript . $lovemail_sel;
            ?>
 />
						<label for="id0002"><?php 
            echo _t("_Send to communicator");
            ?>
</label>
						
						<input type="checkbox" id="id0004" name="notify" <?php 
            echo $notify_sel . $notify_dis;
            ?>
 />
						<label for="id0004"><?php 
            echo _t("_Notify by e-mail");
            ?>
</label>
					</td>
				</tr>
				<tr>
					<td>&nbsp;</td>
					<td nowrap="nowrap" colspan="3" align="left" style="padding-left:5px;">
						<input type="radio" id="id0003" name="sendto" value="both" <?php 
            echo $javascript . $both_sel;
            ?>
 />
						<label for=id0003> <?php 
            echo _t("_both2");
            ?>
</label>
					</td>
				</tr>
			<?php 
        } else {
            ?>
				<input type="hidden" name="sendto" value="lovemail" />
			<?php 
        }
        ?>
				<tr>
					<td colspan="2" class="form_colspan">
						<input class="button" type="submit" value=" <?php 
        echo _t("_Send");
        ?>
" />
					</td>
				</tr>
			</table>
			<input type="hidden" name="action" value="send" />
		</form>
		
		<?php 
        $ret .= ob_get_clean();
    } else {
        $ret .= '<div style="margin:15px 0px; text-align:center;">' . _t('_to_compose_new_message', $recipient['NickName'], $recipient['ID'], $site['url']) . '</div>';
    }
    $ret .= '</div>';
    return $ret;
}
 $create_result = db_res($cl_values);
 $affected_rows = mysql_affected_rows($MySQL->link);
 if (!$affected_rows) {
     $result_text .= _t("_No modification");
 } else {
     if ($ADMIN && $_POST['NewProfile'] == 'YES') {
         $IDnormal = mysql_insert_id($MySQL->link);
         createUserDataFile($IDnormal);
         $result_text .= _t_action("_New profile created") . " ID: <a href='profile_edit.php?ID={$IDnormal}'>{$IDnormal}</a>.";
     } else {
         createUserDataFile($ID);
         if ('Unconfirmed' == $STATUS_CHANGE_TO) {
             // Send confirmation request to the user.
             activation_mail($ID);
         }
         $result_text .= _t_action('_MODIFICATIONS_APPLIED');
     }
 }
 if ($ADMIN) {
     $Featured = $_POST['Featured'] == "on" ? 1 : 0;
     db_res("UPDATE `Profiles` SET `Featured` = '{$Featured}' WHERE `ID` = {$ID};");
     createUserDataFile($ID);
 }
 if ($MEMBER) {
     setcookie("memberPassword", $p_arr_new['Password1'], 0, "/");
 }
 if ($send_cupid_mail_id) {
     cupid_email($send_cupid_mail_id);
 }
 //
 // MODULES [ BEGIN ]
// --------------- page variables / login
$_page['name_index'] = 39;
$_page['css_name'] = 'poll.css';
if (!($logged['admin'] = member_auth(1, false))) {
    if (!($logged['member'] = member_auth(0, false))) {
        if (!($logged['aff'] = member_auth(2, false))) {
            $logged['moderator'] = member_auth(3, false);
        }
    }
}
$_page['header'] = _t("_Site Poll");
$_page['header_text'] = _t("_Site Poll");
$ID = (int) $_REQUEST['ID'];
if ($_POST['vote']) {
    if (PollsVoteAdd()) {
        $actionText = _t_action("_Vote accepted");
    } else {
        $actionText = _t_err("_You already voted");
    }
} else {
    $actionText = '';
}
// --------------- page components
$_ni = $_page['name_index'];
$_page_cont[$_ni]['page_main_code'] = $actionText . MemberPrintPoll($ID);
// --------------- [END] page components
PageCode();
// --------------- page components functions
/**
 * page code function
 */
function PageListSpam($sourceID, $targetID)
{
    global $site;
    $reporterID = $sourceID;
    $spamerID = $targetID;
    $aReporter = getProfileInfo($reporterID);
    // db_arr("SELECT `NickName` FROM `Profiles` WHERE `ID` = '$reporterID';", 0);
    $aSpamer = getProfileInfo($spamerID);
    //db_arr("SELECT `NickName` FROM `Profiles` WHERE `ID` = '$spamerID';", 0);
    $message = getParam("t_SpamReport");
    $subject = getParam('t_SpamReport_subject');
    $aPlus = array();
    $aPlus['reporterID'] = $reporterID;
    $aPlus['reporterNick'] = $aReporter['NickName'];
    $aPlus['spamerID'] = $spamerID;
    $aPlus['spamerNick'] = $aSpamer['NickName'];
    $mail_result = sendMail($site['email'], $subject, $message, '', $aPlus);
    if ($mail_result) {
        $ret = _t_action('_Report about spam was sent');
    } else {
        $ret = _t_err('_Report about spam failed to sent');
    }
    return $ret;
}