本文整理汇总了PHP中send_pm函数的典型用法代码示例。如果您正苦于以下问题:PHP send_pm函数的具体用法?PHP send_pm怎么用?PHP send_pm使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了send_pm函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: mysqli_query
if ($action == 'solve') {
$pid = $_GET["pid"];
if ($solve = 'ignored') {
mysqli_query($GLOBALS["___mysqli_ston"], "UPDATE {$TABLE_PREFIX}helpdesk SET solved='ignored', solved_by={$CURUSER['uid']}, solved_date = UNIX_TIMESTAMP() WHERE id={$pid}");
}
}
if ($msg_answer != "" && $id != 0) {
$zap_usr = mysqli_query($GLOBALS["___mysqli_ston"], "SELECT username FROM {$TABLE_PREFIX}users WHERE id = {$addedbyid}");
$wyn_usr = mysqli_fetch_array($zap_usr);
$addedby_name = $wyn_usr["username"];
$ans_usr = mysqli_query($GLOBALS["___mysqli_ston"], "SELECT username FROM {$TABLE_PREFIX}users WHERE id = {$CURUSER['uid']}");
$wan_usr = mysqli_fetch_array($ans_usr);
$sendby_name = $wan_usr["username"];
$msg = sqlesc("[color=red][b]From the {$SITENAME} HELPDESK [/b][/color]\n\n[quote=" . $addedby_name . "]" . $msg_problem . "[/quote]\n" . $msg_answer . "\n\nregards {$SITENAME} staff member {$sendby_name}");
mysqli_query($GLOBALS["___mysqli_ston"], "UPDATE {$TABLE_PREFIX}helpdesk SET solved='yes', solved_by={$CURUSER['uid']}, solved_date = UNIX_TIMESTAMP(), msg_answer = " . sqlesc($msg_answer) . " WHERE id={$id}");
send_pm($CURUSER[uid], $addedbyid, sqlesc('Helpdesk'), $msg);
}
if ($msg_problem != "" && $title != "") {
do_sqlquery("INSERT INTO {$TABLE_PREFIX}helpdesk (title, msg_problem, added, added_by) VALUES (" . sqlesc($title) . ", " . sqlesc($msg_problem) . ", UNIX_TIMESTAMP(), {$CURUSER['uid']})", true);
err_msg("Help desk", "Message sent! Await for reply.");
block_end();
stdfoot();
die;
}
if (!$CURUSER || $CURUSER["id_level"] >= 6) {
$st_usr = mysqli_query($GLOBALS["___mysqli_ston"], "SELECT username FROM {$TABLE_PREFIX}users WHERE id = {$CURUSER['uid']}");
$sta_usr = mysqli_fetch_array($st_usr);
$staff_name = $sta_usr["username"];
$countt = get_result("SELECT * FROM {$TABLE_PREFIX}helpdesk WHERE solved='no'");
$count = count($countt);
print "<center><a href=index.php?page=modules&module=helpdesk&action=problems><h1><br><font color=steelblue>welcome staff member " . $staff_name . " there are </font><font color=red>" . $count . " </font><font color=steelblue>unanswered questions waiting</font></h1></a></center>";
示例2: trim
$genre = trim($_POST['genre']);
if (is_array($activedays) and count($activedays) and 5 < strlen($activetime) and 2 < strlen($genre)) {
$selectedadays = array();
foreach ($activedays as $ad) {
if ($availabledays[$ad]) {
$selectedadays[] = $availabledays[$ad];
continue;
}
}
if (count($selectedadays)) {
$activedays = implode(',', $selectedadays);
do_sqlquery('INSERT INTO ' . $TABLE_PREFIX . 'shoutcastdj VALUES (NULL, \'' . $CURUSER['uid'] . '\', \'0\', ' . sqlesc($activedays) . ', ' . sqlesc($activetime) . ', ' . sqlesc($genre) . ')', true);
$id = is_null($___mysqli_res = mysqli_insert_id($GLOBALS["___mysqli_ston"])) ? false : $___mysqli_res;
$query = do_sqlquery('SELECT u.id FROM ' . $TABLE_PREFIX . 'users u LEFT JOIN ' . $TABLE_PREFIX . 'users_level g ON u.id_level=g.id WHERE delete_users=\'yes\'', true);
while ($si = mysqli_fetch_assoc($query)) {
send_pm(0, $si[id], sqlesc($language['subject']), sqlesc('' . $language['msg'] . ' ' . $CURUSER['username'] . ' ' . $language['msgg'] . ' [url]' . $BASEURL . '/index.php?page=dj&do=list&id=' . $id . '[/url]'));
}
success_msg($language['SUCCESS'], $language['thanks']);
stdfoot(true, false);
die;
} else {
stderr($language['ERROR'], $language['blank']);
}
} else {
stderr($language['ERROR'], $language['blank']);
}
}
$availabledays = explode(',', $language['days']);
$days = '';
$i = 0;
while ($i < 7) {
示例3: bTemplate
}
if ($CURUSER["can_upload"] == "no") {
// do nothing
} else {
$reqfilledtpl = new bTemplate();
$reqfilledtpl->set("language", $language);
$reqfilledtpl->set("rf0", "<table align='center' width=550 class=lista><tr><td class=lista align=center width=100%>");
$filledurl = $_GET["filledurl"];
$requestid = $_GET["requestid"];
$filldate = date('Y-m-d H:i:s');
$res = mysql_query("SELECT users.username, requests.userid, requests.request FROM {$TABLE_PREFIX}requests requests inner join {$TABLE_PREFIX}users users on requests.userid = users.id where requests.id = {$requestid}") or sqlerr();
$arr = mysql_fetch_assoc($res);
$res2 = mysql_query("SELECT username FROM {$TABLE_PREFIX}users where id =" . $CURUSER[uid]) or sqlerr();
$arr2 = mysql_fetch_assoc($res2);
$msg = "" . REQUEST . ": [url={$BASEURL}/index.php?page=reqdetails&id=" . $requestid . "][b]" . $arr[request] . "[/b][/url], is filled by [url={$BASEURL}/index.php?page=userdetails&id=" . $CURUSER[uid] . "][b]" . $arr2[username] . "[/b][/url].\r\n\r\nThe torrent can be downloaded from the following link:\r\n[url=" . $filledurl . "][b]" . $filledurl . "[/b][/url]\r\n\r\nDo not forget to thank the uploader.\r\nIf for some reason this is not what you want, please reset this by clicking [url={$BASEURL}/index.php?page=reqreset&requestid=" . $requestid . "][b]HERE![/b][/url].\r\n\r\n[b]DO NOT[/b] click the link unless you are absolutly sure you want to reset the request.";
$subject = "Your torrent request is filled !";
mysql_query("UPDATE {$TABLE_PREFIX}requests SET filled = '{$filledurl}', fulfilled= '{$filldate}', filledby = {$CURUSER['uid']} WHERE id = {$requestid}") or sqlerr();
if ($btit_settings["req_rwon"] == true) {
if ($btit_settings["req_sbmb"] == true) {
mysql_query("UPDATE {$TABLE_PREFIX}users SET uploaded = uploaded + {$btit_settings['req_mb']} WHERE id={$CURUSER['uid']}");
}
if ($btit_settings["req_sbmb"] == false) {
mysql_query("UPDATE {$TABLE_PREFIX}users SET seedbonus = seedbonus + {$btit_settings['req_sb']} WHERE id={$CURUSER['uid']}");
}
}
send_pm($CURUSER[uid], $arr[userid], sqlesc($subject), sqlesc($msg));
$reqfilledtpl->set("rf1", "<table class=lista align=center width=550 cellspacing=2 cellpadding=0>\n");
$reqfilledtpl->set("rf2", "<br><BR><div align=left>Request " . $arr[request] . " has now been successfuly filled here: <a href={$filledurl}>{$filledurl}</a>. User <a href=index.php?page=account-details&id={$arr['userid']}><b>{$arr['username']}</b></a> has recieved a PM about this upload. <br>\r\n<br><b>Is this is an accident?</b><br><br>No worries, only <a href=index.php?page=reqreset&requestid={$requestid}><b>CLICK HERE</b></a> to reset this request.<br><b>WARNING</b> do not click this unless you realy want to reset the request !<br><BR></div>");
$reqfilledtpl->set("rf3", "<BR><BR>Thanks for filling out this request :)<br><br>Go back to<a href=index.php?page=viewrequests><b> View Requests</b></a>");
$reqfilledtpl->set("rf4", "</td></tr></table></table>");
}
示例4: check_upload
function check_upload($tmp_name = "", $name = "")
{
global $btit_settings, $language, $CURUSER;
/*
Return values
1 = $tmp_name empty
2 = $name empty
3 = $tmp_name doesn't exist
4 = At least one of the banned triggers were matched
5 = All good
*/
if ($tmp_name == "") {
return 1;
}
if ($name == "") {
return 2;
}
if (file_exists($tmp_name)) {
$handle = fopen($tmp_name, "r");
$haystack = " " . fread($handle, filesize($tmp_name));
fclose($handle);
$needles = isset($btit_settings["secsui_quarantine_search_terms"]) && !empty($btit_settings["secsui_quarantine_search_terms"]) ? explode(",", $btit_settings["secsui_quarantine_search_terms"]) : array();
$found = "no";
if (is_array($needles) && !empty($needles)) {
foreach ($needles as $needle) {
if ($found == "no" && strpos($haystack, $needle)) {
$found = "yes";
}
}
}
if ($found == "yes") {
$quarantined_name = "";
if (is_dir($btit_settings["secsui_quarantine_dir"])) {
if (is_writable($btit_settings["secsui_quarantine_dir"])) {
$quarantined_name = $btit_settings["secsui_quarantine_dir"] . "/hack_attempt_" . $CURUSER["uid"] . "-" . time() . "-" . $name;
move_uploaded_file($tmp_name, $quarantined_name);
} else {
send_pm(0, $btit_settings["secsui_quarantine_pm"], sqlesc($language["QUAR_ERR"]), sqlesc($language["QUAR_DIR_PROBLEM_1"] . " " . (!empty($btit_settings["secsui_quarantine_dir"]) ? "([b]" . $btit_settings["secsui_quarantine_dir"] . "[/b]) " : "") . $language["QUAR_DIR_PROBLEM_3"]));
@unlink($tmp_name);
}
} else {
send_pm(0, $btit_settings["secsui_quarantine_pm"], sqlesc($language["QUAR_ERR"]), sqlesc($language["QUAR_DIR_PROBLEM_1"] . " " . (!empty($btit_settings["secsui_quarantine_dir"]) ? "([b]" . $btit_settings["secsui_quarantine_dir"] . "[/b]) " : "") . $language["QUAR_DIR_PROBLEM_2"]));
@unlink($tmp_name);
}
send_pm(0, $btit_settings["secsui_quarantine_pm"], sqlesc($language["QUAR_PM_SUBJ"]), sqlesc("[url=" . $BASEURL . "/index.php?page=userdetails&id=" . $CURUSER["uid"] . "]" . $CURUSER["username"] . "[/url] " . $language["QUAR_PM_MSG_1"] . ":" . "\n\n[b]" . (isset($quarantined_name) && !empty($quarantined_name) ? $quarantined_name : "[color=red]" . $language["QUAR_UNABLE"] . "[/color]") . "[/b]\n\n" . $language["QUAR_PM_MSG_2"] . " [b]" . getip() . "[/b]\n\n" . ":yikes:"));
return 4;
} else {
return 5;
}
} else {
return 3;
}
}
示例5: foreach
$admintpl->set("search_value", $diff);
// it's final step, users get new group and pm are send
if ($changeug == "Work" && isset($_POST["uyedegis"])) {
$dis = "";
if ($grupdegis == "evet") {
$dis .= "<div align=\"center\">";
foreach ($_POST["uyedegis"] as $uyedegis => $degeri) {
do_sqlquery("UPDATE {$TABLE_PREFIX}users SET id_level='" . $kullan1 . "' WHERE id='" . $degeri . "'");
$dis .= "User <b>" . $degeri . "</b> ID LEVEL has changed to <b>" . $kullan1 . "</b><br />";
}
$dis .= "</div>";
}
if ($mesajat == "evet") {
$dis .= "<div align=\"center\">";
foreach ($_POST["uyedegis"] as $uyedegis => $degeri) {
send_pm($gonderen, $degeri, $baslik, $mesajmetni);
$dis .= "PM send to User <b>" . $degeri . "</b><br />";
}
$dis .= "</div>";
}
$admintpl->set("show_tasks", $dis);
$admintpl->set("language", $language);
$admintpl->set("final_result", true, true);
$admintpl->set("display_result", false, true);
}
if ($readyto == "Go") {
$mdiff = $_POST["diff"] * $s[$_POST["type"]];
$admintpl->set("search_diff_title", "Search for difference >" . makesize($mdiff) . " and User Group = " . ($kullan == 0 ? "ALL" : $kullan));
$admintpl->set("final_result", false, true);
$admintpl->set("display_result", true, true);
$admintpl->set("pm_bbcode", textbbcode("act", "mesajmetni", ""));
示例6: mysqli_real_escape_string
$torrenturl = mysqli_real_escape_string($DBDT, $_POST["torrenturl"]);
$type = mysqli_real_escape_string($DBDT, $_POST["type"]);
if ($expecttitle == "" || $cat == 0 || $descr == "") {
stderr($language["ERROR"], $language["ERR_MISSING_DATA"]);
stdfoot();
die;
}
$expect = sqlesc($expecttitle);
$descr = sqlesc($descr);
$date = sqlesc($date);
$cat = sqlesc($cat);
$upl = sqlesc($uploaded);
$torurl = sqlesc($torrenturl);
$tpe = sqlesc($type);
mysqli_query($GLOBALS["___mysqli_ston"], "UPDATE {$TABLE_PREFIX}expected SET expect_offer={$tpe}, cat={$cat}, expect={$expect}, descr={$descr}, date={$date}, uploaded={$upl}, torrenturl={$torurl} WHERE id={$id}");
//pm
if ($type == 'yes' and $uploaded == 'yes') {
$ms = sqlesc("Some time ago, you voted for the torrent: " . $expecttitle . "\n\n\nWe like to lett you know it is uploaded and you can get it here :\n\n\n[url]" . $torrenturl . "[/url]\n\n\n[color=red][b]THIS IS AN AUTOMATIC SYSTEM MESSAGE PLEASE DON,T REPLY[/b][/color]");
$res = mysqli_query($GLOBALS["___mysqli_ston"], "select userid from {$TABLE_PREFIX}addedexpected where expectid = " . $id) or die(is_object($GLOBALS["___mysqli_ston"]) ? mysqli_error($GLOBALS["___mysqli_ston"]) : (($___mysqli_res = mysqli_connect_error()) ? $___mysqli_res : false));
while ($row = mysqli_fetch_array($res)) {
$kk = $row["userid"];
send_pm(0, $kk, sqlesc('Voted offer is uploaded'), $ms);
}
}
//pm end
header("Refresh: 0; url=index.php?page=viewexpected");
} else {
stderr($language["ERROR"], $language["ERR_NOT_AUTH"]);
stdfoot();
die;
}
示例7: do_sqlquery
if($FORUMLINK=="smf")
{
do_sqlquery("INSERT INTO {$db_prefix}personal_messages (ID_MEMBER_FROM, fromName, msgtime, subject, body) VALUES (".$CURUSER["smf_fid"].", '".$CURUSER["username"]."', UNIX_TIMESTAMP(), $subject, $msg)",true);
$pm_id=mysql_insert_id();
do_sqlquery("INSERT INTO {$db_prefix}pm_recipients (ID_PM, ID_MEMBER) VALUES ($pm_id, $rec)");
do_sqlquery("UPDATE {$db_prefix}members SET instantMessages=instantMessages+1, unreadMessages=unreadMessages+1 WHERE ID_MEMBER=$rec");
}
else
do_sqlquery("INSERT INTO {$TABLE_PREFIX}messages (sender, receiver, added, subject, msg) VALUES ($send,$rec,UNIX_TIMESTAMP(),$subject,$msg)") or die(mysql_error());
*/
$hmm = mysql_query("SELECT * FROM {$TABLE_PREFIX}ignore WHERE ignore_id = '{$uid}' AND user_id = '{$rec}' ");
if (mysql_num_rows($hmm)) {
redirect("index.php?page=usercp&uid=" . $uid . "&do=ign");
} else {
// replaced by send_pm function
send_pm($CURUSER['uid'], $rec, $subject, $msg);
}
// beta
send_mail($CURUSER['email'], $subject, $msg);
// beta
redirect("index.php?page=usercp&uid=" . $uid . "&do=pm&action=list");
exit;
}
}
break;
case 'deleteall':
if ($FORUMLINK == "smf") {
redirect("index.php?page=forum&action=pm" . ($_GET["type"] == "out" ? ";f=outbox" : ""));
}
// MODIFIED DELETE ALL VERSION BY gAnDo
if (isset($_GET["type"])) {
示例8: do_sqlquery
echo $SITENAME;
?>
Online Quiz , Welcome <?php
echo $CURUSER["username"];
?>
</div>
<br />
<form name="quiz" method="post" action="index.php?page=modules&module=quiz">
<?php
if ($_POST["do"] == "finish") {
$rans = $_POST["rans"];
$tq = $_POST["tq"];
$seedbon = $btit_settings["quizbon"];
if ($tq == $rans and $btit_settings["quizp"] == true) {
do_sqlquery("UPDATE `{$TABLE_PREFIX}users` SET `seedbonus`=seedbonus+'" . $seedbon . "' WHERE `id`=" . $CURUSER["uid"] . "", true);
send_pm(0, $user, sqlesc('You have a 100% score for the Quiz!'), sqlesc("You have a 100% score for our Quiz!\n\n Congratulations , you did recieve " . $seedbon . " seedbonus points !!\n\n [color=red]This is a automatic system message , so DO NOT reply ![/color]"));
}
$end = $_POST["end"];
$startposition = $_POST["startposition"];
echo "<table cellpadding='5px' align='center' style='border:1px solid silver' width='80%'\nbgcolor='green'>";
echo "<tr><td>Total Question Attempt</td><td>", $tq, "</td><tr>";
echo "<tr><td>Correct Answer</td><td>", $rans, "</td></tr>";
echo "<tr><td>Wrong Answer</td><td>", $tq - $rans, "</td></tr>";
echo "<tr><td>Correct Answer Percentage</td><td>", $rans / $tq * 100, "%</td></tr>";
echo "<tr><td>Wrong Answer Percenntage</td><td>", ($tq - $rans) / $tq * 100, "%</td></tr>";
echo "</table><br><br>";
$query = "select * from {$TABLE_PREFIX}quiz where qid<='{$end}' and qid>='{$startposition}'";
echo "<table cellpadding='5px' align='center' style='border:1px\nsolid silver'>";
echo "<tr><th colspan='4' id='heading'>Online Quiz Test\nQuestion</td></tr>";
$result = mysqli_query($GLOBALS["___mysqli_ston"], $query);
while ($row = mysqli_fetch_array($result)) {
示例9: dbcount
$new_logs = dbcount("(log_id)", DB_FAILED_LOGINS, "datestamp > '" . (int) $settings['cronjob_hour'] . "'");
if ($new_logs) {
$result = dbquery("SELECT COUNT(fl.log_id) AS tries, fl.user_id, fl.datestamp, MIN(fl.datestamp) AS mindate, MAX(fl.datestamp) AS maxdate,\r\n\t\t\ttu.user_language\r\n\t\t\tFROM " . DB_FAILED_LOGINS . " fl\r\n\t\t\tLEFT JOIN " . DB_USERS . " tu ON fl.user_id=tu.user_id\r\n\t\t\tWHERE datestamp > '" . (int) $settings['cronjob_hour'] . "'\r\n\t\t\tGROUP BY user_id");
$reinc = false;
while ($data = dbarray($result)) {
if ($data['user_language'] != "" && $data['user_language'] != $settings['locale'] && file_exists(LOCALE . $data['user_language'] . "/global.php")) {
include LOCALE . $data['user_language'] . "/global.php";
$reinc = true;
}
$message = sprintf($locale['flogins_101'], $data['tries']);
if ($data['tries'] == 1) {
$message .= sprintf($locale['flogins_102'], showdate($settings['longdate'], $data['datestamp']));
} else {
$message .= sprintf($locale['flogins_103'], showdate($settings['longdate'], $data['mindate']), showdate($settings['longdate'], $data['maxdate']));
}
send_pm($data['user_id'], "0", $locale['flogins_100'], $message, "0");
}
if ($reinc) {
include LOCALE . LOCALESET . "global.php";
}
}
$result = dbquery("UPDATE " . DB_SETTINGS . " SET settings_value='" . (int) $time_now . "' WHERE settings_name='cronjob_hour'");
}
// Cron Job (24 HOUR)
if ($settings['cronjob_day'] < time() - 86400) {
$new_time = time();
$result = dbquery("DELETE FROM " . DB_THREAD_NOTIFY . " WHERE notify_datestamp < '" . (time() - 1209600) . "'");
$result = dbquery("DELETE FROM " . DB_NEW_USERS . " WHERE user_datestamp < '" . (time() - 86400) . "'");
// Check if there are any suspended users, and un-suspend them if the suspend-time is over
$usr_inactive = dbcount("(user_id)", DB_USERS, "user_status='3' AND user_actiontime!='0' AND user_actiontime < '" . time() . "'");
if ($usr_inactive) {
示例10: execute_thread_moderation
//.........这里部分代码省略.........
if ($thread_options['approvethread'] == 'approve') {
$this->approve_threads($tids, $thread['fid']);
} elseif ($thread_options['approvethread'] == 'unapprove') {
$this->unapprove_threads($tids, $thread['fid']);
} elseif ($thread_options['approvethread'] == 'toggle') {
$this->toggle_thread_visibility($tids, $thread['fid']);
}
if ($thread_options['softdeletethread'] == 'softdelete') {
$this->soft_delete_threads($tids);
} elseif ($thread_options['softdeletethread'] == 'restore') {
$this->restore_threads($tids);
} elseif ($thread_options['softdeletethread'] == 'toggle') {
$this->toggle_thread_softdelete($tids);
}
if ($thread_options['openthread'] == 'open') {
$this->open_threads($tids);
} elseif ($thread_options['openthread'] == 'close') {
$this->close_threads($tids);
} elseif ($thread_options['openthread'] == 'toggle') {
$this->toggle_thread_status($tids);
}
if ($thread_options['stickthread'] == 'stick') {
$this->stick_threads($tids);
} elseif ($thread_options['stickthread'] == 'unstick') {
$this->unstick_threads($tids);
} elseif ($thread_options['stickthread'] == 'toggle') {
$this->toggle_thread_importance($tids);
}
if ($thread_options['threadprefix'] != '-1') {
$this->apply_thread_prefix($tids, $thread_options['threadprefix']);
// Update thread prefix
}
if (my_strtolower(trim($thread_options['newsubject'])) != '{subject}') {
$this->change_thread_subject($tids, $thread_options['newsubject']);
}
if (!empty($thread_options['addreply'])) {
$tid_list = implode(',', $tids);
$query = $db->simple_select("threads", 'uid, fid, subject, tid, firstpost, closed', "tid IN ({$tid_list}) AND closed NOT LIKE 'moved|%'");
require_once MYBB_ROOT . "inc/datahandlers/post.php";
// Loop threads adding a reply to each one
while ($thread = $db->fetch_array($query)) {
$posthandler = new PostDataHandler("insert");
if (empty($thread_options['replysubject'])) {
$new_subject = 'RE: ' . $thread['subject'];
} else {
$new_subject = str_ireplace('{username}', $mybb->user['username'], $thread_options['replysubject']);
$new_subject = str_ireplace('{subject}', $thread['subject'], $new_subject);
}
// Set the post data that came from the input to the $post array.
$post = array("tid" => $thread['tid'], "replyto" => $thread['firstpost'], "fid" => $thread['fid'], "subject" => $new_subject, "uid" => $mybb->user['uid'], "username" => $mybb->user['username'], "message" => $thread_options['addreply'], "ipaddress" => $db->escape_binary(my_inet_pton(get_ip())));
// Set up the post options from the input.
$post['options'] = array("signature" => 1, "emailnotify" => 0, "disablesmilies" => 0);
if ($thread['closed'] == 1) {
// Keep this thread closed
$post['modoptions']['closethread'] = 1;
}
$posthandler->set_data($post);
if ($posthandler->validate_post($post)) {
$posthandler->insert_post($post);
}
}
}
if ($thread_options['movethread'] > 0 && $thread_options['movethread'] != $thread['fid']) {
if ($thread_options['movethreadredirect'] == 1) {
$time = TIME_NOW + $thread_options['movethreadredirectexpire'] * 86400;
foreach ($tids as $tid) {
$this->move_thread($tid, $thread_options['movethread'], 'redirect', $time);
}
} else {
$this->move_threads($tids, $thread_options['movethread']);
}
}
if ($thread_options['copythread'] > 0 || $thread_options['copythread'] == -2) {
if ($thread_options['copythread'] == -2) {
$thread_options['copythread'] = $thread['fid'];
}
foreach ($tids as $tid) {
$new_tid = $this->move_thread($tid, $thread_options['copythread'], 'copy');
}
}
if (!empty($thread_options['recountrebuild'])) {
require_once MYBB_ROOT . '/inc/functions_rebuild.php';
foreach ($tids as $tid) {
rebuild_thread_counters($tid);
}
}
}
// Do we have a PM subject and PM message?
if (isset($thread_options['pm_subject']) && $thread_options['pm_subject'] != '' && isset($thread_options['pm_message']) && $thread_options['pm_message'] != '') {
$tid_list = implode(',', $tids);
// For each thread, we send a PM to the author
$query = $db->simple_select("threads", 'uid', "tid IN ({$tid_list})");
while ($uid = $db->fetch_field($query, 'uid')) {
// Let's send our PM
$pm = array('subject' => $thread_options['pm_subject'], 'message' => $thread_options['pm_message'], 'touid' => $uid);
send_pm($pm, $mybb->user['uid'], 1);
}
}
return true;
}
示例11: AND
$tables = $TABLE_PREFIX . 'users u';
if ($ratio) {
$where .= ' AND ((u.uploaded)/(u.downloaded=0))' . $pick;
}
}
# get data
$pm_users = get_result('SELECT u.id, u.username FROM ' . $tables . ' ' . $where, true);
$i = 0;
# revamp data
foreach ($pm_users as $cur) {
if (!$pm_sender && $cur['id'] == $CURUSER['uid']) {
continue;
}
$i++;
if ($pm) {
send_pm($sender, $cur['id'], $subject, $msg);
}
if ($list_users) {
$l_users[] = '<a href="' . $BASEURL . '/index.php?page=userdetails&id=' . $cur['id'] . '">' . $cur['username'] . '</a>';
}
}
# set output vars
$block_title = $language['MASS_SENT'];
$masspm_post = true;
$masspm['subject'] = $original_subject;
$masspm['body'] = format_comment($original_msg);
$masspm['info'] = '<b>' . $i . '</b> ' . $language['USERS_FOUND'] . ' ' . $rank_details . ' ' . $ratio_d . ' !! ' . (!$pm ? ' [ DEBUG MODE ] ' : '') . '<br /><br />' . $language['USERS_PMED'] . '<br />' . implode(' - ', $l_users);
break;
}
}
case 'write':
示例12: warn_user
function warn_user($UserID, $Duration, $Reason) {
global $LoggedUser, $DB, $Cache, $Time;
$DB->query("SELECT Warned FROM users_info WHERE UserID=".$UserID." AND Warned <> '0000-00-00 00:00:00'");
if($DB->record_count() > 0) {
//User was already warned, appending new warning to old.
list($OldDate) = $DB->next_record();
$NewExpDate = date('Y-m-d H:i:s', strtotime($OldDate) + $Duration);
send_pm($UserID, 0, db_string("You have received multiple warnings."), db_string("When you received your latest warning (Set to expire on ".date("Y-m-d", (time() + $Duration))."), you already had a different warning (Set to expire on ".date("Y-m-d", strtotime($OldDate)).").\n\n Due to this collision, your warning status will now expire at ".$NewExpDate."."));
$AdminComment = date("Y-m-d").' - Warning (Clash) extended to expire at '.$NewExpDate.' by '.$LoggedUser['Username']."\nReason: $Reason\n";
$DB->query('UPDATE users_info SET
Warned=\''.db_string($NewExpDate).'\',
WarnedTimes=WarnedTimes+1,
AdminComment=CONCAT(\''.db_string($AdminComment).'\',AdminComment)
WHERE UserID=\''.db_string($UserID).'\'');
} else {
//Not changing, user was not already warned
$WarnTime = time_plus($Duration);
$Cache->begin_transaction('user_info_'.$UserID);
$Cache->update_row(false, array('Warned' => $WarnTime));
$Cache->commit_transaction(0);
$AdminComment = "\n".date("Y-m-d").' - Warned until '.$WarnTime.' by '.$LoggedUser['Username']."\nReason: $Reason\n";
$DB->query('UPDATE users_info SET
Warned=\''.db_string($WarnTime).'\',
WarnedTimes=WarnedTimes+1,
AdminComment=CONCAT(\''.db_string($AdminComment).'\',AdminComment)
WHERE UserID=\''.db_string($UserID).'\'');
}
}
示例13: do_sanity
function do_sanity($ts = 0)
{
// Lets try upping the max_execution_time and memory_limit if we can (Code from Pet/FM)
if (@ini_get("max_execution_time") < 300) {
@ini_set("max_execution_time", 300);
}
if (trim(@ini_get("memory_limit"), "M") < 128) {
@ini_set("memory_limit", "128M");
}
global $clean_interval, $BASEURL, $btit_settings, $XBTT_USE, $db_prefix, $autopruneusers, $email_on_prune, $days_members, $days_not_comfirm, $days_to_email, $PRIVATE_ANNOUNCE, $TORRENTSDIR, $CURRENTPATH, $LIVESTATS, $LOG_HISTORY, $TABLE_PREFIX, $DOXPATH, $DBDT;
$THIS_BASEPATH = dirname(__FILE__);
$days = 14;
$time = time() - $days * 86400;
mysqli_query($GLOBALS["___mysqli_ston"], "DELETE FROM {$TABLE_PREFIX}bugs WHERE status != 'na' AND added < {$time}") or sqlerr(__FILE__, __LINE__);
//delete bots after 48 hours
mysqli_query($GLOBALS["___mysqli_ston"], "DELETE FROM {$TABLE_PREFIX}bots WHERE visit < (NOW() - INTERVAL 2880 MINUTE)");
//end bots
//delete last up/downloads after 48 hours
mysqli_query($GLOBALS["___mysqli_ston"], "DELETE FROM {$TABLE_PREFIX}downloads WHERE date < (NOW() - INTERVAL 2880 MINUTE)");
//end last up/downloads
//show images in shoutbox
if ($btit_settings["endtch"] == TRUE) {
$shout = mysqli_query($GLOBALS["___mysqli_ston"], "SELECT * FROM {$TABLE_PREFIX}chat ORDER BY id DESC LIMIT 1");
$shoutrow = mysqli_fetch_assoc($shout);
$fp = $btit_settings["fix_chat"];
if ($shoutrow["count"] >= $btit_settings["don_chat"]) {
if ($btit_settings["ran_chat"] == TRUE) {
do_sqlquery("INSERT INTO {$TABLE_PREFIX}chat (uid, time, name, text) VALUES (0," . time() . ", 'System','[img]{$BASEURL}/images/shouts/shout.php[/img]')");
} else {
do_sqlquery("INSERT INTO {$TABLE_PREFIX}chat (uid, time, name, text) VALUES (0," . time() . ", 'System','[img]{$BASEURL}/images/shouts/" . $fp . "[/img]')");
}
}
}
//show images in shoutbox end
//happy hour
$happy_r = mysqli_query($GLOBALS["___mysqli_ston"], "SELECT UNIX_TIMESTAMP(value_s) AS happy , value_i AS happys from {$TABLE_PREFIX}avps where arg='happyhour'") or sqlerr(__FILE__, __LINE__);
$happy_a = mysqli_fetch_array($happy_r);
$curDate = time();
$happyTime = $happy_a["happy"] + 3600;
if ($happy_a["happys"] == 0) {
$happyHour = happyHour();
mysqli_query($GLOBALS["___mysqli_ston"], "UPDATE {$TABLE_PREFIX}avps set value_s=" . sqlesc($happyHour) . ", value_i='1' WHERE arg='happyhour' LIMIT 1 ") or sqlerr(__FILE__, __LINE__);
} elseif ($happy_a["happys"] == 1 && $curDate > $happyTime) {
mysqli_query($GLOBALS["___mysqli_ston"], "UPDATE {$TABLE_PREFIX}avps set value_i='0' WHERE arg='happyhour' LIMIT 1 ");
}
$switch = do_sqlquery("SELECT * FROM `{$TABLE_PREFIX}files` WHERE `external`='no'", true);
$switch_happy = mysqli_fetch_array($switch);
if ($switch_happy["happy_hour"] == "yes") {
if (ishappyHour("check") && $happyTime > "0:00") {
do_sqlquery("ALTER TABLE `{$TABLE_PREFIX}files` CHANGE `happy` `happy` ENUM( 'yes', 'no' ) NULL DEFAULT 'yes'") or sqlerr();
do_sqlquery("UPDATE `{$TABLE_PREFIX}files` SET `happy`='yes' WHERE `external`='no'", true);
} else {
do_sqlquery("ALTER TABLE `{$TABLE_PREFIX}files` CHANGE `happy` `happy` ENUM( 'yes', 'no' ) NULL DEFAULT 'no'") or sqlerr();
do_sqlquery("UPDATE `{$TABLE_PREFIX}files` SET `happy`='no' WHERE `external`='no'", true);
}
}
// happy hour
// featured
if ($btit_settings["auto_feat"] == TRUE) {
$feat = mysqli_query($GLOBALS["___mysqli_ston"], "SELECT info_hash , leechers , image from {$TABLE_PREFIX}files where image!='' ORDER BY leechers DESC limit 1");
$resfeat = mysqli_fetch_array($feat);
do_sqlquery("INSERT INTO {$TABLE_PREFIX}featured (fid,torrent_id) VALUES ('','{$resfeat['info_hash']}')");
}
//featured
//sb
if ($XBTT_USE) {
$ressb = do_sqlquery("SELECT uid FROM xbt_files_users as u INNER JOIN xbt_files as x ON u.fid=x.fid WHERE u.left = '0' AND x.flags='0' AND u.active='1'");
if (mysqli_num_rows($ressb) > 0) {
while ($arrsb = mysqli_fetch_assoc($ressb)) {
$x = $arrsb["uid"];
quickQuery("UPDATE `{$TABLE_PREFIX}users` SET `seedbonus`=`seedbonus`+'" . number_format(($ts > 0 ? time() - $ts : $clean_interval) / 3600 * $GLOBALS["bonus"], 6, ".", "") . "' WHERE `id` = '{$x}'");
}
}
} else {
$ressb = do_sqlquery("SELECT pid FROM {$TABLE_PREFIX}peers WHERE status = 'seeder'");
if (mysqli_num_rows($ressb) > 0) {
while ($arrsb = mysqli_fetch_assoc($ressb)) {
$x = $arrsb['pid'];
quickQuery("UPDATE `{$TABLE_PREFIX}users` SET `seedbonus`=`seedbonus`+'" . number_format(($ts > 0 ? time() - $ts : $clean_interval) / 3600 * $GLOBALS["bonus"], 6, ".", "") . "' WHERE `pid`= '{$x}'");
}
}
}
//sb
//warn
$query = do_sqlquery("SELECT * FROM `{$TABLE_PREFIX}users` WHERE warn='yes'");
while ($conf = mysqli_fetch_assoc($query)) {
if (mysqli_num_rows($query) > 0) {
$expire_dat = $conf['warnadded'];
$expire2 = strtotime($expire_dat);
$nown = strtotime("now");
if ($nown >= $expire2) {
$subj = sqlesc("Your Warning time is expired !!");
$msg = sqlesc("You are not longer Warned , please be carefull to not make the same mistake again !!");
send_pm(0, $conf[id], $subj, $msg);
mysqli_query($GLOBALS["___mysqli_ston"], "UPDATE {$TABLE_PREFIX}users SET warn='no' WHERE id='{$conf['id']}'") or sqlerr();
}
}
}
//warn
//remove boot after expiration
//.........这里部分代码省略.........
示例14: send_pm
}
}
if ($DisableIRC != $Cur['DisableIRC'] && check_perms('users_disable_any')) {
$UpdateSet[] = "DisableIRC='{$DisableIRC}'";
$EditSummary[] = "IRC status changed";
$HeavyUpdates['DisableIRC'] = $DisableIRC;
if (!empty($UserReason)) {
send_pm($UserID, 0, db_string('Your IRC privileges have been disabled'), db_string("Your IRC privileges have been disabled. The reason given was: {$UserReason}. If you would like to discuss this please join " . BOT_DISABLED_CHAN . " on our IRC network. Instructions can be found [url=http://" . NONSSL_SITE_URL . "/wiki.php?action=article&name=IRC+-+How+to+join]here[/url]. This loss of privileges does not affect the ability to join and talk to staff in #what.cd-disabled."));
}
}
if ($DisableRequests != $Cur['DisableRequests'] && check_perms('users_disable_any')) {
$UpdateSet[] = "DisableRequests='{$DisableRequests}'";
$EditSummary[] = "request status changed";
$HeavyUpdates['DisableRequests'] = $DisableRequests;
if (!empty($UserReason)) {
send_pm($UserID, 0, db_string('Your request privileges have been disabled'), db_string("Your request privileges have been disabled. The reason given was: {$UserReason}. If you would like to discuss this please join " . BOT_DISABLED_CHAN . " on our IRC network. Instructions can be found [url=http://" . NONSSL_SITE_URL . "/wiki.php?action=article&name=IRC+-+How+to+join]here[/url]. This loss of privileges does not affect the ability to join and talk to staff in #what.cd-disabled."));
}
}
if ($EnableUser != $Cur['Enabled'] && check_perms('users_disable_users')) {
$EnableStr = 'account ' . translateUserStatus($Cur['Enabled']) . '->' . translateUserStatus($EnableUser);
if ($EnableUser == '2') {
disable_users($UserID, '', 1);
} elseif ($EnableUser == '1') {
$Cache->increment('stats_user_count');
update_tracker('add_user', array('id' => $UserID, 'passkey' => $Cur['torrent_pass']));
if ($Cur['Downloaded'] == 0 || $Cur['Uploaded'] / $Cur['Downloaded'] >= $Cur['RequiredRatio']) {
$UpdateSet[] = "i.RatioWatchEnds='0000-00-00 00:00:00'";
$CanLeech = 1;
$UpdateSet[] = "m.can_leech='1'";
$UpdateSet[] = "i.RatioWatchDownload='0'";
} else {
示例15: if
}
if($Recipient == 'Uploader') {
$ToID = $_POST['uploaderid'];
if($Report) {
$Message = "You uploaded the above torrent, it has been reported for the reason: ".$ReportType['title'].":\n\"".$_POST['report_reason']."\"\n\n".$Message;
} else {
$Message = "I am PMing you as you are the uploader of the above torrent.\n\n".$Message;
}
} else if($Recipient == 'Reporter') {
$ToID = $_POST['reporterid'];
$Message = "You reported the above torrent for the reason ".$ReportType['title'].":\n\"".$_POST['report_reason']."\"\n\n".$Message;
} else {
$Err = "Something went horribly wrong";
}
$Subject = $_POST['raw_name'];
if(!is_number($ToID)) {
$Err = "Haxx occuring, non number present";
}
if($ToID == $LoggedUser['ID']) {
$Err = "That's you!";
}
if(isset($Err)) {
echo $Err;
} else {
send_pm($ToID, $LoggedUser['ID'], db_string($Subject), db_string($Message));
}