本文整理汇总了PHP中_t_err函数的典型用法代码示例。如果您正苦于以下问题:PHP _t_err函数的具体用法?PHP _t_err怎么用?PHP _t_err使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了_t_err函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: PageCompPageMainCode
/**
* page code function
*/
function PageCompPageMainCode()
{
global $_page;
//define ajax mode
$bAjxMod = isset($_SERVER['HTTP_X_REQUESTED_WITH']) && $_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest' ? true : false;
$member['ID'] = getLoggedId();
if (!isset($_POST['ID'])) {
return _t_err("_No member specified");
}
$ID = getID($_POST['ID'], 0);
if (!$ID) {
return _t_err("_PROFILE_NOT_AVAILABLE");
}
$profile = getProfileInfo($ID);
// Check if member can get email ADD CART CHECK HERE
$check_res = checkAction($member['ID'], ACTION_ID_GET_EMAIL);
if ($check_res[CHECK_ACTION_RESULT] != CHECK_ACTION_RESULT_ALLOWED) {
if ($bAjxMod) {
showAjaxModeResult($check_res[CHECK_ACTION_MESSAGE], $ID);
}
return '<div class="soundPop">' . $check_res[CHECK_ACTION_MESSAGE] . '</div>';
}
// Check if profile found
if (!$profile) {
$ret = _t_err("_PROFILE_NOT_AVAILABLE");
return $ret;
}
$action_result = "";
$get_result = MemberFreeEmail($member['ID'], $profile);
switch ($get_result) {
case 7:
$action_result = _t_err("_PROFILE_NOT_AVAILABLE");
break;
case 13:
$action_result = _t_err("_YOUR PROFILE_IS_NOT_ACTIVE");
break;
case 20:
$action_result = _t_err("_FREEMAIL_NOT_ALLOWED");
break;
case 21:
$action_result = _t_err("_FREEMAIL_ALREADY_SENT", $ID);
break;
case 25:
$action_result = _t_err("_FREEMAIL_BLOCK", $ID);
break;
case 44:
$action_result = _t_err("_FREEMAIL_NOT_KISSED", $ID);
break;
case 45:
$action_result = _t_err("_FREEMAIL_ERROR");
break;
default:
$action_result = _t("_FREEMAIL_SENT", $profile['NickName']);
break;
}
if ($get_result) {
$_page['header_text'] = _t("_Contact information not sent");
} else {
$_page['header_text'] = _t("_Contact information sent");
}
$ret = '<div class="soundPop">' . $action_result . '</div>' . "\n";
if ($bAjxMod) {
showAjaxModeResult($action_result, $ID);
}
return $ret;
}
示例2: PageCompPageMainCodeWithForm
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);
}
示例3: AddRecord
function AddRecord()
{
global $record_maxlength;
global $period;
global $record_limit;
global $logged;
$ret = "";
$record_text = addslashes(clear_xss(process_pass_data($_POST['newrecord'])));
$record_sender = strlen($_COOKIE['memberID']) ? (int) $_COOKIE['memberID'] : "";
$record_recipient = (int) $_REQUEST['owner'];
$ip = getenv('HTTP_CLIENT_IP') ? getenv('HTTP_CLIENT_IP') : getenv('REMOTE_ADDR');
if (!$record_recipient) {
return $ret;
}
// Test if IP is defined
if (!$ip) {
$ret .= "<br />\r\n\t\t\t<table width=\"100%\" cellpadding=\"1\" cellspacing=\"1\" border=\"0\">\r\n\t\t\t\t<tr>\r\n\t\t\t\t\t<td class=\"text\" align=\"center\">\r\n\t\t\t\t\t\t<br />" . _t_err("_sorry, i can not define you ip adress. IT'S TIME TO COME OUT !") . "<br />\r\n\t\t\t\t\t</td>\r\n\t\t\t\t</tr>\r\n\t\t\t</table>\n";
return $ret;
}
// Test if last message is old enough
$last_count = db_arr("SELECT COUNT( * ) AS `last_count` FROM `Guestbook` WHERE `IP` = '{$ip}' AND (UNIX_TIMESTAMP(NOW()) - UNIX_TIMESTAMP(`Date`) < {$period}*60)");
if ($last_count['last_count'] != 0) {
$ret .= "<br />\r\n\t\t\t<table width=\"100%\" cellpadding=\"1\" cellspacing=\"1\" border=\"0\">\r\n\t\t\t\t<tr>\r\n\t\t\t\t\t<td class=\"text\" align=\"center\">\r\n\t\t\t\t\t\t<br />" . _t_err("_You have to wait for PERIOD minutes before you can write another message!", $period) . "<br />\r\n\t\t\t\t\t</td>\r\n\t\t\t\t</tr>\r\n\t\t\t</table>\n";
return $ret;
}
// Restrict with total records count
$total_count = db_arr("SELECT COUNT(*) AS `total_count` FROM `Guestbook` WHERE `Recipient` = '{$record_recipient}'");
if ($total_count['total_count'] - 1 > $record_limit) {
$del_res = db_res("SELECT `ID` FROM `Guestbook` WHERE `Recipient` = '{$record_recipient}' ORDER BY `Date` ASC LIMIT " . ($total_count['total_count'] - $record_limit + 1));
while ($del_arr = mysql_fetch_array($del_res)) {
db_res("DELETE FROM `Guestbook` WHERE `ID` = {$del_arr['ID']}");
}
}
// Perform insertion
db_res("INSERT INTO `Guestbook` SET `Date` = NOW(), `IP` = '{$ip}', `Sender` = '{$record_sender}', `Recipient` = '{$record_recipient}', `Text` = '{$record_text}', `New` = '1'");
return $ret;
}
示例4: parseUploadedFiles
/**
* Parsing uploaded files, store its with temp names, fill data into SQL tables
*
* @param $iMemberID current member ID
* @return Text presentation of data (enum ID`s)
*/
function parseUploadedFiles($iMemberID)
{
global $dir;
$sCurrentTime = time();
if ($_FILES) {
$iIDs = '';
for ($i = 0; $i < count($_FILES['userfile']['tmp_name']); $i++) {
if ($_FILES['userfile']['error'][$i]) {
continue;
}
if ($_FILES['userfile']['size'][$i] > $this->iMaxUplFileSize) {
//if size more than 1mb
print _t_err('_WARNING_MAX_SIZE_FILE', $_FILES['userfile']['name'][$i]);
continue;
}
list($width, $height, $type, $attr) = getimagesize($_FILES['userfile']['tmp_name'][$i]);
if ($type != 1 and $type != 2 and $type != 3) {
continue;
}
$sBaseName = $iMemberID . '_' . $sCurrentTime . '_' . ($i + 1);
$sExt = strrchr($_FILES['userfile']['name'][$i], '.');
$sExt = strtolower(trim($sExt));
$vResizeRes = imageResize($_FILES['userfile']['tmp_name'][$i], "{$dir['root']}{$this->sUploadDir}img_{$sBaseName}{$sExt}", $this->iImgSize, $this->iImgSize);
$vThumbResizeRes = imageResize($_FILES['userfile']['tmp_name'][$i], "{$dir['root']}{$this->sUploadDir}thumb_{$sBaseName}{$sExt}", $this->iThumbSize, $this->iThumbSize);
$vBigThumbResizeRes = imageResize($_FILES['userfile']['tmp_name'][$i], "{$dir['root']}{$this->sUploadDir}big_thumb_{$sBaseName}{$sExt}", $this->iBigThumbSize, $this->iBigThumbSize);
$vIconResizeRes = imageResize($_FILES['userfile']['tmp_name'][$i], "{$dir['root']}{$this->sUploadDir}icon_{$sBaseName}{$sExt}", $this->iIconSize, $this->iIconSize);
if ($vResizeRes || $vThumbResizeRes || $vBigThumbResizeRes || $vIconResizeRes) {
print _t_err("_ERROR_WHILE_PROCESSING");
continue;
}
$vSqlRes = $this->InsertCAM($iMemberID, $sBaseName, $sExt);
if ($vSqlRes) {
$iIDs .= mysql_insert_id() . ',';
}
}
return $iIDs;
}
}
示例5: _t_err
case 'archives_paginate':
$sOutputHtml = $oMailBox->genArchiveMessages();
break;
// will return message's replay window;
// will return message's replay window;
case 'reply_message':
if ($iMessageID and $vRecipientID) {
$vRecipientID = (int) $vRecipientID;
$sOutputHtml = $oMailBox->genReplayMessage($vRecipientID, $iMessageID);
}
break;
case 'compose_mail':
if ($sMessageSubject and $sMessageBody and $vRecipientID) {
$sOutputHtml = $oMailBox->sendMessage($sMessageSubject, $sMessageBody, $vRecipientID, $aComposeSettings);
} else {
$sOutputHtml = _t_err('_please_fill_next_fields_first');
}
break;
case 'auto_complete':
if ($sAutoCompleteQ) {
$sOutputHtml = $oMailBox->getAutoCompleteList($sAutoCompleteQ);
}
break;
case 'get_thumbnail':
$iRecipientID = getId($vRecipientID);
if ($iRecipientID) {
$sOutputHtml = get_member_thumbnail($iRecipientID, 'none');
}
break;
}
// try to define the callback function name ;
示例6: parseUploadedFiles
/**
* Parsing uploaded files, store its with temp names, fill data into SQL tables
*
* @param $iMemberID current member ID
* @return Text presentation of data (enum ID`s)
*/
function parseUploadedFiles()
{
$sCurrentTime = time();
if ($_FILES) {
$aIDs = array();
for ($i = 0; $i < count($_FILES['userfile']['tmp_name']); $i++) {
if ($_FILES['userfile']['error'][$i]) {
continue;
}
if ($_FILES['userfile']['size'][$i] > $this->iMaxUplFileSize) {
echo _t_err('_bx_ads_Warn_max_file_size', $_FILES['userfile']['name'][$i]);
continue;
}
list($width, $height, $type, $attr) = getimagesize($_FILES['userfile']['tmp_name'][$i]);
if ($type != 1 && $type != 2 && $type != 3) {
continue;
}
$sBaseName = $this->_iVisitorID . '_' . $sCurrentTime . '_' . ($i + 1);
$sExt = strrchr($_FILES['userfile']['name'][$i], '.');
$sExt = strtolower(trim($sExt));
$sImg = BX_DIRECTORY_PATH_ROOT . "{$this->sUploadDir}img_{$sBaseName}{$sExt}";
$sImgThumb = BX_DIRECTORY_PATH_ROOT . "{$this->sUploadDir}thumb_{$sBaseName}{$sExt}";
$sImgThumbBig = BX_DIRECTORY_PATH_ROOT . "{$this->sUploadDir}big_thumb_{$sBaseName}{$sExt}";
$sImgIcon = BX_DIRECTORY_PATH_ROOT . "{$this->sUploadDir}icon_{$sBaseName}{$sExt}";
$vResizeRes = imageResize($_FILES['userfile']['tmp_name'][$i], $sImg, $this->iImgSize, $this->iImgSize);
$vThumbResizeRes = imageResize($_FILES['userfile']['tmp_name'][$i], $sImgThumb, $this->iThumbSize, $this->iThumbSize);
$vBigThumbResizeRes = imageResize($_FILES['userfile']['tmp_name'][$i], $sImgThumbBig, $this->iBigThumbSize, $this->iBigThumbSize);
$vIconResizeRes = imageResize($_FILES['userfile']['tmp_name'][$i], $sImgIcon, $this->iIconSize, $this->iIconSize);
if ($vResizeRes || $vThumbResizeRes || $vBigThumbResizeRes || $vIconResizeRes) {
echo _t_err("_ERROR_WHILE_PROCESSING");
continue;
}
$iImgId = $this->_oDb->insertMedia($this->_iVisitorID, $sBaseName, $sExt);
if (!$iImgId) {
@unlink($sImg);
@unlink($sImgThumb);
@unlink($sImgThumbBig);
@unlink($sImgIcon);
continue;
}
$aIDs[] = $iImgId;
}
return implode(',', $aIDs);
}
}
示例7: MemberPrintPoll
function MemberPrintPoll($ID)
{
$queryQuestion = "SELECT `Question` FROM `polls_q` WHERE `Active` = 'on' AND `ID` = {$ID}";
$queryAnswers = "SELECT `IDanswer`, `Answer`, `Votes` FROM `polls_a` WHERE `ID` = {$ID}";
$aQuestion = db_arr($queryQuestion);
$rAnswers = db_res($queryAnswers);
if (!$aQuestion or !mysql_num_rows($rAnswers)) {
return _t_err("_Poll not available");
}
$aVotes = db_arr("SELECT SUM(`Votes`) FROM `polls_a` WHERE `ID` = {$ID}");
$iTotalVotes = (int) $aVotes[0];
ob_start();
?>
<div class="tableVote_wrapper">
<form method="post" name="FormVote" action="poll.php">
<input type="hidden" name="ID" value="<?php
echo $ID;
?>
" />
<table class="tableVote">
<tr><th colspan="2"><?php
echo process_line_output($aQuestion['Question']);
?>
</th>
</tr>
<?php
$j = 1;
while ($aAnswer = mysql_fetch_array($rAnswers)) {
if ($j % 2 == 0) {
$add = '2';
} else {
$add = '1';
}
?>
<tr>
<td>
<input type="radio" onclick="javascript: this.form.submit()" name="vote"
value="<?php
echo $aAnswer['IDanswer'];
?>
" ID="l<?php
echo $aAnswer['IDanswer'];
?>
" />
<label for="l<?php
echo $aAnswer['IDanswer'];
?>
"><?php
echo process_line_output($aAnswer['Answer']);
?>
</label>
</td>
<td><?php
echo DesignProgressPos(_t("_votes") . ": " . $aAnswer['Votes'], 100, $iTotalVotes, $aAnswer['Votes'], $add);
?>
</td>
</tr>
<?php
$j++;
}
?>
</table>
</form>
</div>
<?php
return ob_get_clean();
}
示例8: PageCompPageMainCode
/**
* page code function
*/
function PageCompPageMainCode()
{
global $_page;
global $oTemplConfig;
$ret = "";
$member['ID'] = (int) $_COOKIE['memberID'];
$member['Password'] = $_COOKIE['memberPassword'];
$recipientID = getID($_REQUEST['sendto'], 0);
$recipient = getProfileInfo($recipientID);
//db_arr( "SELECT `ID`, `Status`, `Email` FROM `Profiles` WHERE `ID` = '" . $recipientID . "' LIMIT 1;" );
$contact_allowed = contact_allowed($member['ID'], $recipientID);
if ($_REQUEST['ConfCode'] && $_REQUEST['from'] && strcmp($_REQUEST['ConfCode'], base64_encode(base64_encode(crypt($_REQUEST['from'], "vkiss_secret_string")))) == 0) {
$member['ID'] = (int) $_REQUEST['from'];
}
//
// Check if member can send messages
$check_res = checkAction($member['ID'], ACTION_ID_SEND_VKISS);
if ($check_res[CHECK_ACTION_RESULT] != CHECK_ACTION_RESULT_ALLOWED && !$contact_allowed) {
$_page['header_text'] = _t("_Send virtual kiss3");
$ret = "\n\t\t\t<table width=\"100%\" cellpadding=\"4\" cellspacing=\"4\" border=\"0\">\n\t\t\t\t<tr>\n\t\t\t\t\t<td align=center class=text2>" . $check_res[CHECK_ACTION_MESSAGE] . "</td>\n\t\t\t\t</tr>\n\t\t\t</table>\n";
return $ret;
}
$action_result = "";
// Check if recipient found
if (!$recipient) {
$_page['header_text'] = _t("_Send virtual kiss3");
$ret = "\n\t\t\t<table width=\"100%\" cellpadding=\"4\" cellspacing=\"4\">\n\t\t\t\t<tr>\n\t\t\t\t\t<td align=center class=text2>\n\t\t\t\t\t\t<form method=\"GET\" action=\"{$_SERVER['PHP_SELF']}\">\n\t\t\t\t\t\t\t<input class=no size=15 type=\"text\" name=\"sendto\"> <input class=no type=\"submit\" value=\"" . _t("_Send kiss") . "!\">\n\t\t\t\t\t\t</form>\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t</table>\n";
return $ret;
}
// Perform sending
$send_result = MemberSendVKiss($member, $recipient);
switch ($send_result) {
case 1:
$action_result .= _t_err("_VKISS_BAD");
break;
case 7:
$action_result .= _t_err("_VKISS_BAD_COUSE_B");
break;
case 10:
$action_result .= _t_err("_VKISS_BAD_COUSE_C");
break;
case 13:
$action_result .= _t_err("_VKISS_BAD_COUSE_A3");
break;
case 23:
$action_result .= _t_err("_VKISS_BAD_COUSE_X");
break;
case 24:
$action_result .= _t_err("_VKISS_BAD_COUSE_Y");
break;
default:
$action_result .= _t("_VKISS_OK");
break;
}
if ($send_result == 0) {
$_page['header_text'] = _t("_Send virtual kiss2");
} else {
$_page['header_text'] = _t("_Send virtual kiss3");
}
$ret = "\n\t\t<table width=\"100%\" cellpadding=\"4\" cellspacing=\"4\">\n\t\t\t<tr>\n\t\t\t\t<td align=center class=text2>\n\t\t\t\t\t{$action_result}<br />\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t</table>\n";
return DesignBoxContent(_t("_Send virtual kiss"), $ret, $oTemplConfig->PageVkiss_db_num);
}
示例9: GenEditCategoryForm
//.........这里部分代码省略.........
$categImg = $aCategory['CategoryPhoto'];
} else {
$categCaption = '';
$categDesc = '';
$categImg = '';
}
$sCategoryCaptionC = _t('_category_caption');
$sPleaseFillFieldsC = _t('_please_fill_next_fields_first');
$sRetHtml .= <<<EOF
<script type="text/javascript">
\tfunction checkForm() {
\t\tvar el;
\t\tvar hasErr = false;
\t\tvar fild = "";
\t\tel = document.getElementById("caption");
\t\tif( el.value.length < 3 ) {
\t\t\tel.style.backgroundColor = "pink";
\t\t\tel.style.border = "1px solid silver";
\t\t\thasErr = true;
\t\t\tfild += "{$sCategoryCaptionC}";
\t\t} else {
\t\t\tel.style.backgroundColor = "#fff";
\t\t}
\t\tif (hasErr) {
\t\t\talert( "{$sPleaseFillFieldsC}!" + fild )
\t\t\treturn false;
\t\t} else {
\t\t\treturn true;
\t\t}
\t\treturn false;
\t}
</script>
EOF;
$sCategoryCaptionC = _t('_category_caption');
$sCharactersLeftC = _t('_characters_left');
//$sCategoryDescriptionC = _t('_category_description');
$sAssociatedImageC = _t('_associated_image');
$sApplyChangesC = _t('apply changes');
$sAddCategoryC = _t('_add_category');
$sEditCategoryC = _t('_edit_category');
$sBlogPhoto = '';
if ($categImg) {
$sBlogPhoto = <<<EOF
<div class="blogPhoto">
\t\t<img src="{$site['blogImage']}big_{$categImg}" alt="" />
</div>
EOF;
}
$sEditCategory = '';
if ('edit_category' == $_REQUEST['action']) {
$sEditCategory = <<<EOF
<input type="submit" value="{$sApplyChangesC}" />
<input type="hidden" name="action" value="editcategory" />
<input type="hidden" name="categoryID" value="{$iCategoryID}" />
<input type="hidden" name="categoryPhoto" value="{$categImg}" />
EOF;
} else {
$sEditCategory = <<<EOF
<input type="submit" value="{$sAddCategoryC}" />
<input type="hidden" name="action" value="addcategory" />
EOF;
}
$iMemberID = (int) process_db_input($_REQUEST['ownerID']);
$aUser = array('Permalink' => getNickName($iMemberID), 'Link' => $iMemberID);
$sBlogOwnerLink = $this->genBlogLink('show_member_blog', $aUser);
$sCategImg = '<img src="' . $site['icons'] . 'folder.png" style="position:static;" />';
$sCategInput = '<input type="" name="categoryCaption" id="caption" value="' . $categCaption . '" class="categoryCaption1" onkeydown="return charCounter(\'caption\', ' . $this->aBlogConf['categoryCaptionMaxLenght'] . ', \'captCounter\');" />';
$sCategInputImg = $this->GenCenteredActionsBlock($sCategImg, $sCategInput);
$sRetHtml .= <<<EOF
<div>
\t<form action="{$sBlogOwnerLink}" enctype="multipart/form-data" method="post" onsubmit="return checkForm();">
\t\t<div class="margin_bottom_10">
\t\t\t{$sCategoryCaptionC} (<span id="captCounter">{$this->aBlogConf['categoryCaptionMaxLenght']}</span>{$sCharactersLeftC})
\t\t</div>
\t\t<div class="margin_bottom_10">
\t\t\t{$sCategInputImg}
\t\t</div>
\t\t<div class="assocImageBlock">
\t\t\t<div style="margin-bottom:5px;">
\t\t\t\t{$sAssociatedImageC}
\t\t\t</div>
\t\t\t{$sBlogPhoto}
\t\t\t<div class="margin_bottom_10">
\t\t\t\t<input type="file" name="CategPic" />
\t\t\t</div>
\t\t\t<div class="clear_both"></div>
\t\t</div>
\t\t{$sEditCategory}
\t\t<input type="hidden" name="ownerID" value="{$iMemberID}" />
\t</form>
</div>
EOF;
} else {
$ret .= _t_err('_you_have_no_permiss_to_edit');
$sRetHtml = $ret;
}
return DesignBoxContent($sEditCategoryC, $sRetHtml, 1);
}
示例10: get_input_name
continue;
}
$fname = get_input_name($arrpd);
$funcbody = $arrpd['check'];
$func = create_function('$arg0', $funcbody);
if (!$func($p_arr_new[$fname])) {
$result_text .= _t_err($arrpd['because']);
}
}
} else {
if (!conf_nick($_POST['NickName']) && $p_arr['NickName'] != $p_arr_new['NickName']) {
$result_text .= _t_err("_this_nick_already_used");
}
//$result_text .= report_err( _t("This Nickname already used !!"));
if ($_POST['Password1'] != $_POST['Password2']) {
$result_text .= _t_err('_PWD_INVALID3');
}
}
if (!strlen($result_text)) {
// check for modification (change status)
if (!$autoApproval_ifProfile && $MEMBER && !$NEW_TO_ADD && $p_arr['Status'] != "Unconfirmed" && $p_arr['Status'] != "Approval") {
$respd = db_res("SELECT * FROM `ProfilesDesc` WHERE `visible` & {$db_vsbl} AND `editable` & {$db_editbl} AND ( FIND_IN_SET('0', `show_on_page`) OR FIND_IN_SET('" . (int) $_page['name_index'] . "', `show_on_page`)) AND `to_db` = 1 ORDER BY `order` ASC");
while ($arrpd = mysql_fetch_array($respd)) {
$fname = get_input_name($arrpd);
$dbname = get_field_name($arrpd);
if ($dbname == 'Password') {
continue;
}
switch ($arrpd['type']) {
case 'a':
case 'c':
示例11: ActionAddBlogComment
/**
* Adding a Comment to Post
*
* @return MsgBox result
*/
function ActionAddBlogComment()
{
$this->CheckLogged();
$blogID = (int) $_POST['CommPostID'];
$senderID = $this->aBlogConf['visitorID'];
$commentText = $this->process_html_db_input($_POST['message']);
$replyTo = (int) $_POST['replyTo'];
$ip = getVisitorIP();
// ( getenv('HTTP_CLIENT_IP') ? getenv('HTTP_CLIENT_IP') : getenv('REMOTE_ADDR') );
if (!$ip) {
$ret = _t_err("_sorry, i can not define you ip adress. IT'S TIME TO COME OUT !");
return $ret;
}
if (0 >= $senderID) {
return _t_err('_im_textLogin');
}
if (0 >= $blogID) {
return '';
}
$last_count = db_arr("SELECT COUNT( * ) AS `last_count` FROM `BlogPostComments` WHERE `IP` = '{$ip}' AND (UNIX_TIMESTAMP(NOW()) - UNIX_TIMESTAMP(`Date`) < 1*60)");
if ($last_count['last_count'] != 0) {
$ret = _t("_You have to wait for PERIOD minutes before you can write another message!", 1);
return MsgBox($ret);
}
$addCommentQuery = "\n\t\t\tINSERT INTO `BlogPostComments`\n\t\t\tSET\n\t\t\t\t`PostID` = '{$blogID}',\n\t\t\t\t`SenderID` = '{$senderID}',\n\t\t\t\t`CommentText` = '{$commentText}',\n\t\t\t\t`ReplyTo` = '{$replyTo}',\n\t\t\t\t`IP` = '{$ip}',\n\t\t\t\t`Date` = NOW()\n\t\t";
//echo $addCommentQuery;
if (db_res($addCommentQuery)) {
$ret = _t('_comment_added_successfully');
} else {
$ret = _t('_failed_to_add_comment');
}
return MsgBox($ret);
}
示例12: ThisPageMainCode
/**
* page code function
*/
function ThisPageMainCode()
{
global $logged;
global $member;
// create poll section -------------------------------------------------------------------
$ret .= '<div class="createPollSection">';
$query = "SELECT COUNT(id_poll) FROM ProfilesPolls WHERE id_profile = '{$member['ID']}'";
$ras_arr = db_arr($query);
$polls_num = db_arr($query);
$profile_poll_num = getParam("profile_poll_num");
if ($profile_poll_num && $polls_num[0] < $profile_poll_num) {
// limit number of polls
$ret .= ShowPollCreationForm();
} else {
$ret .= _t('_max_poll_reached');
}
$ret .= '</div>';
// show polls section --------------------------------------------------------------------
$ret .= '<div class="pollContainer" id="pol_container">';
$ret .= '<div class="clear_both"></div>';
$query = "SELECT id_poll, poll_status FROM ProfilesPolls WHERE id_profile = '{$member['ID']}'";
$polls_num = db_res($query);
while ($poll_arr = mysql_fetch_array($polls_num)) {
$uID = $poll_arr['id_poll'];
$ret .= '<div id="pol_container_pol_' . $uID . '" class="controlsDiv">';
$ret .= ShowPoll($uID);
$ret .= '<div class="innerControlBlock">';
//$ret .= '<div class="controlsHeader">' . _t('_controls') . ':</div>';
$sCurStatus = '';
$sCTStatus = '';
$status_change_to = '';
if ('active' == $poll_arr['poll_status']) {
$sCurStatus = _t('_Active');
$sCTStatus = _t('_Disabled');
$status_change_to = 'disabled';
} else {
$sCurStatus = _t('_Disabled');
$sCTStatus = _t('_Active');
$status_change_to = 'active';
}
$ret .= "<span id=\"poll_status_{$uID}\" style=\"padding: 0px 2px;\"></span>";
$ret .= '<span class="deleteDiv"><a href="#" onclick=" if ( window.confirm(\'' . _t('_are you sure?') . '\') ) { send_data( \'\', \'delete\', \'\', \'' . $uID . '\' ); del_question_bar( document.getElementById(\'pol_container\'), document.getElementById(\'pol_container_pol_' . $uID . '\') ); } return false;">' . _t('_delete') . '</a></span>';
$ret .= '<script language="javascript">
poll_status_show( \'' . $uID . '\', \'poll_status_' . $uID . '\', \'' . $poll_arr['poll_status'] . '\', \'' . $status_change_to . '\', \'' . $sCurStatus . '\', \'' . $sCTStatus . '\' );
</script>';
$ret .= '</div>';
$ret .= '</div>';
}
// if no polls
if (!$uID) {
$ret .= _t_err('_no poll');
}
$ret .= '<div class="clear_both"></div>';
$ret .= '</div>';
return $ret;
}
示例13: addComment
function addComment($profileID)
{
global $logged;
global $oProfile;
if ($logged['member']) {
$record_sender = (int) $_COOKIE['memberID'];
} else {
return;
}
$period = 1;
// time period before user can add another record (in minutes)
$record_maxlength = 1600;
// max length of record
// Test if IP is defined
$ip = getVisitorIP();
if ($ip == '0.0.0.0') {
return _t_err("_sorry, i can not define you ip adress. IT'S TIME TO COME OUT !");
}
// get record text
$record_text = addslashes(clear_xss(trim(process_pass_data($_POST['commenttext']))));
if (strlen($record_text) < 2) {
return _t_err("_enter_message_text");
}
// Test if last message is old enough
$last_count = db_value("SELECT COUNT(*) FROM `ProfilesComments` WHERE `IP` = '{$ip}' AND (UNIX_TIMESTAMP(NOW()) - UNIX_TIMESTAMP(`Date`) < {$period}*60)");
if ($last_count != 0) {
return _t_err("_You have to wait for PERIOD minutes before you can write another message!", $period);
}
$replyTO = (int) $_POST['replyTO'];
// Perform insertion
$query = "\n\t\tINSERT INTO `ProfilesComments` SET\n\t\t\t`Date` = NOW(),\n\t\t\t`IP` = '{$ip}',\n\t\t\t`Sender` = {$record_sender},\n\t\t\t`Recipient` = {$oProfile->_iProfileID},\n\t\t\t`Text` = '{$record_text}',\n\t\t\t`New` = '1',\n\t\t\t`ReplyTO` = {$replyTO}\n\t\t";
db_res($query);
}
示例14: PageCompPageMainCode
/**
* page code function
*/
function PageCompPageMainCode()
{
global $_page;
$member['ID'] = (int) $_COOKIE['memberID'];
if (!$_REQUEST['ID']) {
return _t_err("_No member specified");
}
$ID = getID($_REQUEST['ID'], 0);
if (!$ID) {
return _t_err("_PROFILE_NOT_AVAILABLE");
}
$profile = getProfileInfo($ID);
//db_arr( "SELECT * FROM `Profiles` WHERE `ID` = '$ID' LIMIT 1;" );
// Check if member can get email ADD CART CHECK HERE
$check_res = checkAction($member['ID'], ACTION_ID_GET_EMAIL);
if ($check_res[CHECK_ACTION_RESULT] != CHECK_ACTION_RESULT_ALLOWED) {
$ret = '<div class="soundPop">' . $check_res[CHECK_ACTION_MESSAGE] . '</div>';
return $ret;
}
// Check if profile found
if (!$profile) {
$ret = _t_err("_PROFILE_NOT_AVAILABLE");
return $ret;
}
$action_result = "";
$get_result = MemberFreeEmail($member['ID'], $profile);
switch ($get_result) {
case 7:
$action_result = _t_err("_PROFILE_NOT_AVAILABLE");
break;
case 13:
$action_result = _t_err("_YOUR PROFILE_IS_NOT_ACTIVE");
break;
case 20:
$action_result = _t_err("_FREEMAIL_NOT_ALLOWED");
break;
case 21:
$action_result = _t_err("_FREEMAIL_ALREADY_SENT", $ID);
break;
case 25:
$action_result = _t_err("_FREEMAIL_BLOCK", $ID);
break;
case 44:
$action_result = _t_err("_FREEMAIL_NOT_KISSED", $ID);
break;
case 45:
$action_result = _t_err("_FREEMAIL_ERROR");
break;
default:
$action_result = _t("_FREEMAIL_SENT", $profile['NickName']);
break;
}
if ($get_result) {
$_page['header_text'] = _t("_Contact information not sent");
} else {
$_page['header_text'] = _t("_Contact information sent");
}
/*
if ( $get_result != 0 && $get_result != 25 )
$send_form = send_form();
else
$send_form = "";
*/
$ret = '<div class="soundPop">' . $action_result . '</div>' . "\n";
return $ret;
}
示例15: PageCompPageMainCode
/**
* page code function
*/
function PageCompPageMainCode()
{
global $site;
global $dir;
global $tmpl;
global $ADMIN;
global $max_l;
global $max_h;
global $short_date_format;
$max_l = getParam("max_story_text");
$max_h = getParam("max_story_header");
ob_start();
if (!$max_l) {
$max_l = 4096;
}
if (!$max_h) {
$max_h = 32;
}
$action_result = "";
if ($_POST['action'] == 'new') {
if (strlen($_POST['header'])) {
if (MemberAddStory()) {
$action_result .= _t("_STORY_ADDED");
} else {
$action_result .= _t_err("_STORY_ADDED_FAILED");
}
} else {
$action_result .= _t_err("_STORY_EMPTY_HEADER");
}
}
if ($_POST['action'] == 'edit' && (int) $_POST['edit_id'] != 0) {
if (strlen($_POST['header'])) {
if (MemberEditStory()) {
$action_result .= _t("_STORY_UPDATED");
} else {
$action_result .= _t_err("_STORY_UPDATED_FAILED");
}
} else {
$action_result .= _t_err("_STORY_EMPTY_HEADER");
}
}
if ($_POST['do_delete'] and $_POST['select_story'] and is_array($_POST['select_story'])) {
$sqlAdd = $ADMIN ? '' : "AND `Sender`=" . (int) $_COOKIE['memberID'];
foreach ($_POST['select_story'] as $iStoryID) {
$iStoryID = (int) $iStoryID;
if (!$iStoryID) {
continue;
}
$sQuery = "DELETE FROM `Stories` WHERE `ID`={$iStoryID} {$sqlAdd}";
db_res($sQuery);
}
}
if ($ADMIN and $_POST['do_activate'] and $_POST['select_story'] and is_array($_POST['select_story'])) {
foreach ($_POST['select_story'] as $iStoryID) {
$iStoryID = (int) $iStoryID;
if (!$iStoryID) {
continue;
}
$sQuery = "UPDATE `Stories` SET `active`='on' WHERE `ID`={$iStoryID}";
db_res($sQuery);
}
}
if ($ADMIN and $_POST['do_deactivate'] and $_POST['select_story'] and is_array($_POST['select_story'])) {
foreach ($_POST['select_story'] as $iStoryID) {
$iStoryID = (int) $iStoryID;
if (!$iStoryID) {
continue;
}
$sQuery = "UPDATE `Stories` SET `active`='' WHERE `ID`={$iStoryID}";
db_res($sQuery);
}
}
if (!$ADMIN) {
echo "<table width=\"100%\" cellpadding=4 cellspacing=4><td align=center class=text2>\n";
} else {
echo "<div style=\"padding: 10px 10px 10px 10px;\">";
}
if (strlen($action_result)) {
echo "<br /><center><div>{$action_result}</div></center><br />\n";
}
echo MemberPrintStories();
if (!$ADMIN || (int) $_GET['edit_id'] != 0) {
if ((int) $_GET['edit_id'] != 0) {
$story_arr = db_arr("SELECT * FROM `Stories` WHERE `ID` = " . (int) $_GET['edit_id']);
}
$actions = '';
if ((int) $_GET['edit_id']) {
$actions .= '<input type="hidden" name="action" value="edit" />';
$actions .= '<input type="hidden" name="sender" value="' . $story_arr['Sender'] . '" />';
$actions .= '<input type="hidden" name="edit_id" value="' . $story_arr['ID'] . '" />';
$actions .= '<input class="no" type="submit" value="' . _t('_Update story') . '" />';
} else {
$actions .= '<input type="hidden" name="action" value="new" />';
$actions .= '<input class="no" type="submit" value="' . _t("_Add story") . '" />';
}
$aReplace = array();
$aReplace['icons'] = $site['icons'];
//.........这里部分代码省略.........