本文整理汇总了PHP中get_user_lang函数的典型用法代码示例。如果您正苦于以下问题:PHP get_user_lang函数的具体用法?PHP get_user_lang怎么用?PHP get_user_lang使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_user_lang函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: set_emoncms_lang
function set_emoncms_lang($userid)
{
// Get language from database user
$lang = get_user_lang($userid);
// If no language defined use the language browser
if ($lang == '') {
set_lang(lang_http_accept());
} else {
set_lang_by_user($lang);
}
}
示例2: migrate2utf8_questionnaire_response_other_response
function migrate2utf8_questionnaire_response_other_response($recordid)
{
global $CFG, $globallang;
/// Some trivial checks
if (empty($recordid)) {
log_the_problem_somewhere();
return false;
}
if (!($rother = get_record('questionnaire_response_other', 'id', $recordid))) {
log_the_problem_somewhere();
return false;
}
if (!($courseid = get_field('questionnaire_survey', 'owner', 'id', get_field('questionnaire_question', 'survey_id', 'id', $rother->question_id)))) {
log_the_problem_somewhere();
return false;
}
if ($globallang) {
$fromenc = $globallang;
} else {
$sitelang = $CFG->lang;
$courselang = get_course_lang($courseid);
//Non existing!
$userid = get_field('questionnaire_response', 'username', 'id', $rother->response_id);
if (is_numeric($userid)) {
$userlang = get_user_lang($userid);
} else {
$userlang = false;
}
$fromenc = get_original_encoding($sitelang, $courselang, $userlang);
}
/// We are going to use textlib facilities
/// Convert the text
if ($fromenc != 'utf-8' && $fromenc != 'UTF-8') {
$result = utfconvert($rother->response, $fromenc);
$newrother = new object();
$newrother->id = $recordid;
$newrother->response = $result;
migrate2utf8_update_record('questionnaire_response_other', $newrother);
}
/// And finally, just return the converted field
return $result;
}
示例3: fopen
$fp = fopen("{$torrent_dir}/{$id}.torrent", "w");
if ($fp) {
@fwrite($fp, benc($dict), strlen(benc($dict)));
fclose($fp);
}
//===add karma
KPS("+", $uploadtorrent_bonus, $CURUSER["id"]);
//===end
write_log("Torrent {$id} ({$torrent}) was uploaded by {$anon}");
//===notify people who voted on offer thanks CoLdFuSiOn :)
if ($is_offer) {
$res = sql_query("SELECT `userid` FROM `offervotes` WHERE `userid` != " . $CURUSER["id"] . " AND `offerid` = " . sqlesc($offerid) . " AND `vote` = 'yeah'") or sqlerr(__FILE__, __LINE__);
while ($row = mysql_fetch_assoc($res)) {
$pn_msg = $lang_takeupload_target[get_user_lang($row["userid"])]['msg_offer_you_voted'] . $torrent . $lang_takeupload_target[get_user_lang($row["userid"])]['msg_was_uploaded_by'] . $CURUSER["username"] . $lang_takeupload_target[get_user_lang($row["userid"])]['msg_you_can_download'] . "[url=" . get_protocol_prefix() . "{$BASEURL}/details.php?id={$id}&hit=1]" . $lang_takeupload_target[get_user_lang($row["userid"])]['msg_here'] . "[/url]";
//=== use this if you DO have subject in your PMs
$subject = $lang_takeupload_target[get_user_lang($row["userid"])]['msg_offer'] . $torrent . $lang_takeupload_target[get_user_lang($row["userid"])]['msg_was_just_uploaded'];
//=== use this if you DO NOT have subject in your PMs
//$some_variable .= "(0, $row[userid], '" . date("Y-m-d H:i:s") . "', " . sqlesc($pn_msg) . ")";
//=== use this if you DO have subject in your PMs
sql_query("INSERT INTO messages (sender, subject, receiver, added, msg) VALUES (0, " . sqlesc($subject) . ", {$row['userid']}, " . sqlesc(date("Y-m-d H:i:s")) . ", " . sqlesc($pn_msg) . ")") or sqlerr(__FILE__, __LINE__);
//=== use this if you do NOT have subject in your PMs
//sql_query("INSERT INTO messages (sender, receiver, added, msg) VALUES ".$some_variable."") or sqlerr(__FILE__, __LINE__);
//===end
}
//=== delete all offer stuff
sql_query("DELETE FROM offers WHERE id = " . $offerid);
sql_query("DELETE FROM offervotes WHERE offerid = " . $offerid);
sql_query("DELETE FROM comments WHERE offer = " . $offerid);
}
//=== end notify people who voted on offer
/* Email notifs */
示例4: stderr
$query->execute();
$query->bind_result($title, $descrption, $banned);
// 没有找到种子。
if (!$query->fetch()) {
stderr($lang_details['std_error'], $lang_details['std_no_torrent_id']);
die;
}
// Ban 项目的特殊权限检查。
if ($banned == 'yes' && get_user_class() < $seebanned_class) {
permissiondenied();
die;
}
// 关闭数据库。
$sql->close();
// 当前用户的语言。
$user_lang = get_user_lang($CURUSER['id']);
?>
<h1><?php
echo MessageFormatter::formatMessage($user_lang, $lang_bbcode['text_title_format'], $title);
?>
</h1>
<p><?php
echo $lang_bbcode['text_instruction'];
?>
</p>
<table style="width: 95%; margin: 10px;">
<thead>
<tr>
<th class="colhead" align="center"><?php
示例5: stdmsg
if ($userid == $useridgift) {
stdmsg($lang_mybonus['text_huh'], $lang_mybonus['text_karma_self_giving_warning'], 0);
stdfoot();
die;
}
if (!$useridgift) {
stdmsg($lang_mybonus['text_error'], $lang_mybonus['text_receiver_not_exists'], 0);
stdfoot();
die;
}
sql_query("UPDATE users SET seedbonus = seedbonus - {$points}, bonuscomment = " . sqlesc($bonuscomment) . " WHERE id = " . sqlesc($userid)) or sqlerr(__FILE__, __LINE__);
sql_query("UPDATE users SET seedbonus = seedbonus + {$aftertaxpoint}, bonuscomment = " . sqlesc($newreceiverbonuscomment) . " WHERE id = " . sqlesc($useridgift));
//===send message
$subject = sqlesc($lang_mybonus_target[get_user_lang($useridgift)]['msg_someone_loves_you']);
$added = sqlesc(date("Y-m-d H:i:s"));
$msg = $lang_mybonus_target[get_user_lang($useridgift)]['msg_you_have_been_given'] . $points2 . $lang_mybonus_target[get_user_lang($useridgift)]['msg_after_tax'] . $points2receiver . $lang_mybonus_target[get_user_lang($useridgift)]['msg_karma_points_by'] . $CURUSER['username'];
if ($message) {
$msg .= "\n" . $lang_mybonus_target[get_user_lang($useridgift)]['msg_personal_message_from'] . $CURUSER['username'] . $lang_mybonus_target[get_user_lang($useridgift)]['msg_colon'] . $message;
}
$msg = sqlesc($msg);
sql_query("INSERT INTO messages (sender, subject, receiver, msg, added) VALUES(0, {$subject}, {$useridgift}, {$msg}, {$added})") or sqlerr(__FILE__, __LINE__);
$usernamegift = unesc($_POST["username"]);
redirect("" . get_protocol_prefix() . "{$BASEURL}/mybonus.php?do=transfer");
} else {
print "<table width=\"940\"><tr><td class=\"colhead\" align=\"left\" colspan=\"2\"><h1>" . $lang_mybonus['text_oups'] . "</h1></td></tr>";
print "<tr><td align=\"left\"></td><td align=\"left\">" . $lang_mybonus['text_not_enough_karma'] . "<br /><br /></td></tr></table>";
}
}
}
}
stdfoot();
示例6: funreward
function funreward($funvote, $totalvote, $title, $posterid, $bonus)
{
global $lang_fun_target, $lang_fun;
KPS("+", $bonus, $posterid);
$subject = $lang_fun_target[get_user_lang($posterid)]['msg_fun_item_reward'];
$msg = $funvote . $lang_fun_target[get_user_lang($posterid)]['msg_out_of'] . $totalvote . $lang_fun_target[get_user_lang($posterid)]['msg_people_think'] . $title . $lang_fun_target[get_user_lang($posterid)]['msg_is_fun'] . $bonus . $lang_fun_target[get_user_lang($posterid)]['msg_bonus_as_reward'];
$sql = "INSERT INTO messages (sender, subject, receiver, added, msg) VALUES(0, " . sqlesc($subject) . "," . $posterid . ",'" . date("Y-m-d H:i:s") . "', " . sqlesc($msg) . ")";
sql_query($sql) or sqlerr(__FILE__, __LINE__);
$Cache->delete_value('user_' . $posterid . '_unread_message_count');
$Cache->delete_value('user_' . $posterid . '_inbox_count');
}
示例7: user_to_peasant
function user_to_peasant($down_floor_gb, $minratio)
{
global $lang_cleanup_target;
global $deletepeasant_account;
$length = $deletepeasant_account * 86400;
// warn users until xxx days
$until = date("Y-m-d H:i:s", TIMENOW + $length);
$downlimit_floor = $down_floor_gb * 1024 * 1024 * 1024;
$res = sql_query("SELECT id FROM users WHERE class = 1 AND downloaded > {$downlimit_floor} AND uploaded / downloaded < {$minratio}") or sqlerr(__FILE__, __LINE__);
if (mysql_num_rows($res) > 0) {
$dt = sqlesc(date("Y-m-d H:i:s"));
while ($arr = mysql_fetch_assoc($res)) {
$subject = $lang_cleanup_target[get_user_lang($arr[id])]['msg_demoted_to'] . get_user_class_name(UC_PEASANT, false, false, false);
$msg = $lang_cleanup_target[get_user_lang($arr[id])]['msg_must_fix_ratio_within'] . $deletepeasant_account . $lang_cleanup_target[get_user_lang($arr[id])]['msg_days_or_get_banned'];
writecomment($arr[id], "Leech Warned by System - Low Ratio.");
sql_query("UPDATE users SET class = 0 , leechwarn = 'yes', leechwarnuntil = " . sqlesc($until) . " WHERE id = {$arr['id']}") or sqlerr(__FILE__, __LINE__);
sql_query("INSERT INTO messages (sender, receiver, added, subject, msg) VALUES(0, {$arr['id']}, {$dt}, " . sqlesc($subject) . ", " . sqlesc($msg) . ")") or sqlerr(__FILE__, __LINE__);
}
}
}
示例8: sql_query
{$lang_takesignup['mail_one']}{$usern}{$lang_takesignup['mail_two']}({$email}){$lang_takesignup['mail_three']}{$ip}{$lang_takesignup['mail_four']}
<b><a href="javascript:void(null)" onclick="window.open('http://{$BASEURL}/confirm.php?id={$id}&secret={$psecret}')">
{$lang_takesignup['mail_this_link']} </a></b><br />
http://{$BASEURL}/confirm.php?id={$id}&secret={$psecret}
{$lang_takesignup['mail_four_1']}
<b><a href="javascript:void(null)" onclick="window.open('http://{$BASEURL}/confirm_resend.php')">{$lang_takesignup['mail_here']}</a></b><br />
http://{$BASEURL}/confirm_resend.php
<br />
{$lang_takesignup['mail_five']}
EOD;
if ($type == 'invite') {
//don't forget to delete confirmed invitee's hash code from table invites
sql_query("DELETE FROM invites WHERE hash = '" . mysql_real_escape_string($code) . "'");
$dt = sqlesc(date("Y-m-d H:i:s"));
$subject = sqlesc($lang_takesignup_target[get_user_lang($inviter)]['msg_invited_user_has_registered']);
$msg = sqlesc($lang_takesignup_target[get_user_lang($inviter)]['msg_user_you_invited'] . $usern . $lang_takesignup_target[get_user_lang($inviter)]['msg_has_registered']);
//sql_query("UPDATE users SET uploaded = uploaded + 10737418240 WHERE id = $inviter"); //add 10GB to invitor's uploading credit
sql_query("INSERT INTO messages (sender, receiver, subject, added, msg) VALUES(0, {$inviter}, {$subject}, {$dt}, {$msg})") or sqlerr(__FILE__, __LINE__);
$Cache->delete_value('user_' . $inviter . '_unread_message_count');
$Cache->delete_value('user_' . $inviter . '_inbox_count');
}
if ($verification == 'admin') {
if ($type == 'invite') {
header("Location: " . get_protocol_prefix() . "{$BASEURL}/ok.php?type=inviter");
} else {
header("Location: " . get_protocol_prefix() . "{$BASEURL}/ok.php?type=adminactivate");
}
} elseif ($verification == 'automatic' || $smtptype == 'none') {
header("Location: " . get_protocol_prefix() . "{$BASEURL}/confirm.php?id={$id}&secret={$psecret}");
} else {
sent_mail($send_email, $SITENAME, $SITEEMAIL, change_email_encode(get_langfolder_cookie(), $title), change_email_encode(get_langfolder_cookie(), $body), "signup", false, false, '', get_email_encode(get_langfolder_cookie()));
示例9: stderr
}
}
if ($sure == 0) {
stderr($lang_offers['std_delete_offer'], $lang_offers['std_delete_offer_note'] . "<br /><form method=post action=offers.php?id={$offer}&del_offer=1&sure=1>" . $lang_offers['text_reason_is'] . "<input type=text style=\"width: 200px\" name=reason><input type=submit value=\"" . $lang_offers['submit_confirm'] . "\"></form>", false);
} elseif ($sure == 1) {
$reason = $_POST["reason"];
sql_query("DELETE FROM offers WHERE id={$offer}");
sql_query("DELETE FROM offervotes WHERE offerid={$offer}");
sql_query("DELETE FROM comments WHERE offer={$offer}");
//===add karma //=== use this if you use the karma mod
//sql_query("UPDATE users SET seedbonus = seedbonus-10.0 WHERE id = $num[userid]") or sqlerr(__FILE__, __LINE__);
//===end
if ($CURUSER["id"] != $num["userid"]) {
$added = sqlesc(date("Y-m-d H:i:s"));
$subject = sqlesc($lang_offers_target[get_user_lang($num["userid"])]['msg_offer_deleted']);
$msg = sqlesc($lang_offers_target[get_user_lang($num["userid"])]['msg_your_offer'] . $num[name] . $lang_offers_target[get_user_lang($num["userid"])]['msg_was_deleted_by'] . "[url=userdetails.php?id=" . $CURUSER['id'] . "]" . $CURUSER['username'] . "[/url]" . $lang_offers_target[get_user_lang($num["userid"])]['msg_blank'] . ($reason != "" ? $lang_offers_target[get_user_lang($num["userid"])]['msg_reason_is'] . $reason : ""));
sql_query("INSERT INTO messages (sender, receiver, msg, added, subject) VALUES(0, {$num['userid']}, {$msg}, {$added}, {$subject})") or sqlerr(__FILE__, __LINE__);
}
write_log("Offer: {$offer} ({$num['name']}) was deleted by {$CURUSER['username']}" . ($reason != "" ? " (" . $reason . ")" : ""), 'normal');
header("Refresh: 0; url=offers.php");
die;
} else {
stderr($lang_offers['std_error'], $lang_offers['std_smell_rat']);
}
}
//== end delete offer
//=== prolly not needed, but what the hell... basically stopping the page getting screwed up
if ($_GET["sort"]) {
$sort = $_GET["sort"];
if ($sort == 'cat' || $sort == 'name' || $sort == 'added' || $sort == 'comments' || $sort == 'yeah' || $sort == 'against' || $sort == 'v_res') {
$sort = $_GET["sort"];
示例10: bark
bark($lang_fastdelete['std_missing_form_data']);
}
$id = 0 + $id;
int_check($id);
$sure = $_GET["sure"];
$res = sql_query("SELECT name,owner,seeders,anonymous FROM torrents WHERE id = {$id}");
$row = mysql_fetch_array($res);
if (!$row) {
die;
}
if (get_user_class() < $torrentmanage_class) {
bark($lang_fastdelete['text_no_permission']);
}
if (!$sure) {
stderr($lang_fastdelete['std_delete_torrent'], $lang_fastdelete['std_delete_torrent_note'] . "<a class=altlink href=fastdelete.php?id={$id}&sure=1>" . $lang_fastdelete['std_here_if_sure'], false);
}
deletetorrent($id);
KPS("-", $uploadtorrent_bonus, $row["owner"]);
if ($row['anonymous'] == 'yes' && $CURUSER["id"] == $row["owner"]) {
write_log("Torrent {$id} ({$row['name']}) was deleted by its anonymous uploader", 'normal');
} else {
write_log("Torrent {$id} ({$row['name']}) was deleted by {$CURUSER['username']}", 'normal');
}
//Send pm to torrent uploader
if ($CURUSER["id"] != $row["owner"]) {
$dt = sqlesc(date("Y-m-d H:i:s"));
$subject = sqlesc($lang_fastdelete_target[get_user_lang($row["owner"])]['msg_torrent_deleted']);
$msg = sqlesc($lang_fastdelete_target[get_user_lang($row["owner"])]['msg_the_torrent_you_uploaded'] . $row['name'] . $lang_fastdelete_target[get_user_lang($row["owner"])]['msg_was_deleted_by'] . "[url=userdetails.php?id=" . $CURUSER['id'] . "]" . $CURUSER['username'] . "[/url]" . $lang_fastdelete_target[get_user_lang($row["owner"])]['msg_blank']);
sql_query("INSERT INTO messages (sender, receiver, subject, added, msg) VALUES(0, {$row['owner']}, {$subject}, {$dt}, {$msg})") or sqlerr(__FILE__, __LINE__);
}
header("Refresh: 0; url=torrents.php");
示例11: strlen
{
global $dbConnection;
$mid = $_SESSION['helpdesk_user_id'];
$stmt = $dbConnection->prepare('SELECT lang from users where id=:mid');
$stmt->execute(array(':mid' => $mid));
$max = $stmt->fetch(PDO::FETCH_NUM);
$max_id = $max[0];
$length = strlen(utf8_decode($max_id));
if ($length < 1 || $max_id == "0") {
$ress = 'ru';
} else {
$ress = $max_id;
}
return $ress;
}
$lang = get_user_lang();
switch ($lang) {
case 'ua':
$lang_file = 'lang.ua.php';
break;
case 'ru':
$lang_file = 'lang.ru.php';
break;
case 'en':
$lang_file = 'lang.en.php';
break;
default:
$lang_file = 'lang.ru.php';
}
include_once 'lang/' . $lang_file;
function get_conf_param($in)
示例12: sql_query
sql_query("INSERT INTO messages (sender, receiver, subject, msg, added) VALUES (0, {$userid}, {$subject}, {$msg}, {$added})") or sqlerr(__FILE__, __LINE__);
} else {
$modcomment = date("Y-m-d") . " - Upload disabled by " . $CURUSER['username'] . ".\n" . $modcomment;
$subject = sqlesc($lang_modtask_target[get_user_lang($userid)]['msg_upload_rights_removed']);
$msg = sqlesc($lang_modtask_target[get_user_lang($userid)]['msg_your_upload_rights_removed'] . $CURUSER['username'] . $lang_modtask_target[get_user_lang($userid)]['msg_probably_reason_two']);
$added = sqlesc(date("Y-m-d H:i:s"));
sql_query("INSERT INTO messages (sender, receiver, subject, msg, added) VALUES (0, {$userid}, {$subject}, {$msg}, {$added})") or sqlerr(__FILE__, __LINE__);
}
}
if ($downloadpos != $curdownloadpos) {
if ($downloadpos == 'yes') {
$modcomment = date("Y-m-d") . " - Download enabled by " . $CURUSER['username'] . ".\n" . $modcomment;
$subject = sqlesc($lang_modtask_target[get_user_lang($userid)]['msg_download_rights_restored']);
$msg = sqlesc($lang_modtask_target[get_user_lang($userid)]['msg_your_download_rights_restored'] . $CURUSER['username'] . $lang_modtask_target[get_user_lang($userid)]['msg_you_can_download']);
$added = sqlesc(date("Y-m-d H:i:s"));
sql_query("INSERT INTO messages (sender, receiver, subject, msg, added) VALUES (0, {$userid}, {$subject}, {$msg}, {$added})") or sqlerr(__FILE__, __LINE__);
} else {
$modcomment = date("Y-m-d") . " - Download disabled by " . $CURUSER['username'] . ".\n" . $modcomment;
$subject = sqlesc($lang_modtask_target[get_user_lang($userid)]['msg_download_rights_removed']);
$msg = sqlesc($lang_modtask_target[get_user_lang($userid)]['msg_your_download_rights_removed'] . $CURUSER['username'] . $lang_modtask_target[get_user_lang($userid)]['msg_probably_reason_three']);
$added = sqlesc(date("Y-m-d H:i:s"));
sql_query("INSERT INTO messages (sender, receiver, subject, msg, added) VALUES (0, {$userid}, {$subject}, {$msg}, {$added})") or sqlerr(__FILE__, __LINE__);
}
}
$updateset[] = "modcomment = " . sqlesc($modcomment);
sql_query("UPDATE users SET " . implode(", ", $updateset) . " WHERE id={$userid}") or sqlerr(__FILE__, __LINE__);
$returnto = htmlspecialchars($_POST["returnto"]);
header("Location: " . get_protocol_prefix() . "{$BASEURL}/{$returnto}");
die;
}
puke();
示例13: sql_query
if (get_user_class() >= $submanage_class || $a["uppedby"] == $CURUSER["id"]) {
$sure = $_GET["sure"];
if ($sure == 1) {
$reason = $_POST["reason"];
sql_query("DELETE FROM subs WHERE id={$delete}") or sqlerr(__FILE__, __LINE__);
if (!unlink("{$SUBSPATH}/{$a['torrent_id']}/{$a['id']}.{$a['ext']}")) {
stdmsg($lang_subtitles['std_error'], $lang_subtitles['std_this_file'] . "{$a['filename']}" . $lang_subtitles['std_is_invalid']);
stdfoot();
die;
} else {
KPS("-", $uploadsubtitle_bonus, $a["uppedby"]);
//subtitle uploader loses bonus for deleted subtitle
}
if ($CURUSER['id'] != $a['uppedby']) {
$msg = $CURUSER['username'] . $lang_subtitles_target[get_user_lang($a['uppedby'])]['msg_deleted_your_sub'] . $a['title'] . ($reason != "" ? $lang_subtitles_target[get_user_lang($a['uppedby'])]['msg_reason_is'] . $reason : "");
$subject = $lang_subtitles_target[get_user_lang($a['uppedby'])]['msg_your_sub_deleted'];
$time = date("Y-m-d H:i:s");
sql_query("INSERT INTO messages (sender, receiver, added, msg, subject) VALUES(0, {$a['uppedby']}, '" . $time . "', " . sqlesc($msg) . ", " . sqlesc($subject) . ")") or sqlerr(__FILE__, __LINE__);
}
$res = sql_query("SELECT lang_name from language WHERE sub_lang=1 AND id = " . sqlesc($a["lang_id"])) or sqlerr(__FILE__, __LINE__);
$arr = mysql_fetch_assoc($res);
write_log("{$arr['lang_name']} Subtitle {$delete} ({$a['title']}) was deleted by " . ($a["anonymous"] == 'yes' && $a["uppedby"] == $CURUSER["id"] ? "Anonymous" : $CURUSER['username']) . ($a["uppedby"] != $CURUSER["id"] ? ", Mod Delete" : "") . ($reason != "" ? " (" . $reason . ")" : ""));
} else {
stdmsg($lang_subtitles['std_delete_subtitle'], $lang_subtitles['std_delete_subtitle_note'] . "<br /><form method=post action=subtitles.php?delete={$delete}&sure=1>" . $lang_subtitles['text_reason_is'] . "<input type=text style=\"width: 200px\" name=reason><input type=submit value=\"" . $lang_subtitles['submit_confirm'] . "\"></form>");
stdfoot();
die;
}
}
}
}
}
示例14: sql_query
} else {
if ($type == "request") {
sql_query("UPDATE req SET comments = comments + 1 WHERE id = {$parent_id}");
}
}
}
$ras = sql_query("SELECT commentpm FROM users WHERE id = {$arr['owner']}") or sqlerr(__FILE__, __LINE__);
$arg = mysql_fetch_array($ras);
if ($arg["commentpm"] == 'yes' && $CURUSER['id'] != $arr["owner"]) {
$added = sqlesc(date("Y-m-d H:i:s"));
$subject = sqlesc($lang_comment_target[get_user_lang($arr["owner"])]['msg_new_comment']);
if ($type == "torrent") {
$notifs = sqlesc($lang_comment_target[get_user_lang($arr["owner"])]['msg_torrent_receive_comment'] . " [url=" . get_protocol_prefix() . "{$BASEURL}/details.php?id={$parent_id}#startcomments] " . $arr['name'] . "[/url].");
}
if ($type == "offer") {
$notifs = sqlesc($lang_comment_target[get_user_lang($arr["owner"])]['msg_torrent_receive_comment'] . " [url=" . get_protocol_prefix() . "{$BASEURL}/offers.php?id={$parent_id}&off_details=1] " . $arr['name'] . "[/url].");
}
if ($type == "request") {
$notifs = sqlesc("你的求种 [url=" . get_protocol_prefix() . "{$BASEURL}/viewrequest.php?action=view&id={$parent_id}#cid{$postid}] 收到了新评论" . $arr['name'] . "[/url].");
}
sql_query("INSERT INTO messages (sender, receiver, subject, msg, added) VALUES(0, " . $arr['owner'] . ", {$subject}, {$notifs}, {$added})") or sqlerr(__FILE__, __LINE__);
$Cache->delete_value('user_' . $arr['owner'] . '_unread_message_count');
$Cache->delete_value('user_' . $arr['owner'] . '_inbox_count');
}
KPS("+", $addcomment_bonus, $CURUSER["id"]);
// Update Last comment sent...
sql_query("UPDATE users SET last_comment = NOW() WHERE id = " . sqlesc($CURUSER['id'])) or sqlerr(__FILE__, __LINE__);
if ($type == "torrent") {
header("Refresh: 0; url=details.php?id={$parent_id}#cid{$postid}");
} else {
if ($type == "offer") {
示例15: sent_mail
$body = <<<EOD
\t\t{$lang_takemessage_target[get_user_lang($user["id"])]['mail_dear']}{$msg_receiver},
\t\t
\t\t{$lang_takemessage_target[get_user_lang($user["id"])]['mail_you_received_a_pm']}
\t\t
\t\t{$lang_takemessage_target[get_user_lang($user["id"])]['mail_sender']}: {$username}
\t\t{$lang_takemessage_target[get_user_lang($user["id"])]['mail_subject']}: {$subject}
\t\t{$lang_takemessage_target[get_user_lang($user["id"])]['mail_date']}: {$date}
\t\t
\t\t{$lang_takemessage_target[get_user_lang($user["id"])]['mail_use_following_url']}<b><a href="javascript:void(null)" onclick="window.open('{$prefix}{$BASEURL}/messages.php?action=viewmessage&id={$msgid}')">{$lang_takemessage_target[get_user_lang($user["id"])]['mail_here']}</a></b>{$lang_takemessage_target[get_user_lang($user["id"])]['mail_use_following_url_1']}<br />
{$prefix}{$BASEURL}/messages.php?action=viewmessage&id={$msgid}
\t\t
\t\t------{$lang_takemessage_target[get_user_lang($user["id"])]['mail_yours']}
\t\t{$lang_takemessage_target[get_user_lang($user["id"])]['mail_the_site_team']}
EOD;
sent_mail($user["email"], $SITENAME, $SITEEMAIL, change_email_encode(get_user_lang($user["id"]), $title), change_email_encode(get_user_lang($user["id"]), str_replace("<br />", "<br />", nl2br($body))), "sendmessage", false, false, '', get_email_encode(get_user_lang($user["id"])));
}
}
$delete = $_POST["delete"];
if ($origmsg) {
if ($delete == "yes") {
// Make sure receiver of $origmsg is current user
$res = sql_query("SELECT * FROM messages WHERE id={$origmsg}") or sqlerr(__FILE__, __LINE__);
if (mysql_num_rows($res) == 1) {
$arr = mysql_fetch_assoc($res);
if ($arr["receiver"] != $CURUSER["id"]) {
stderr("w00t", "This shouldn't happen.");
}
if ($arr["saved"] == "no") {
sql_query("DELETE FROM messages WHERE id={$origmsg}") or sqlerr(__FILE__, __LINE__);
} elseif ($arr["saved"] == "yes") {