// common functions require_once 'inc/functions/functions.common.php'; // to-user $to_user = tfb_getRequestVar('to_user'); if (empty($to_user) or empty($cfg["user"])) { // the user probably hit this page direct @header("location: index.php?iid=index"); exit; } // message $message = tfb_getRequestVar('message'); if (!empty($message)) { $to_all_r = tfb_getRequestVar('to_all'); $force_read_r = tfb_getRequestVar('force_read'); $message = check_html($message, "nohtml"); SaveMessage($to_user, $cfg["user"], htmlentities($message), empty($to_all_r) ? 0 : 1, !empty($force_read_r) && $cfg['isAdmin'] ? 1 : 0); @header("location: index.php?iid=readmsg"); exit; } // rmid if (isset($_REQUEST['rmid'])) { $rmid = tfb_getRequestVar('rmid'); if (!empty($rmid)) { list($from_user, $message, $ip, $time) = GetMessage($rmid); $message = $cfg['_DATE'] . ": " . date($cfg['_DATETIMEFORMAT'], $time) . "\n" . $from_user . " " . $cfg['_WROTE'] . ":\n\n" . $message; $message = ">" . str_replace("\n", "\n>", $message); $message = "\n\n\n" . $message; } } // init template-instance tmplInitializeInstance($cfg["theme"], "page.message.tmpl");
/** * PM a user * * @param $user, $message * @return $string */ function _pm($sender, $recipient, $message) { global $cfg; // require_once "inc/functions/functions.common.message.php"; check_html($message, "nohtml"); SaveMessage($recipient, $sender, $message); }
function ProcessNewMessage() { /*///////////////////////////////////////////////////////////// Author: Plottery Corp. Created: v1.0.0 - 2010-12-14 Revisions: None Purpose: Sends a new message Returns: Nothing */ ///////////////////////////////////////////////////////////// global $LanguageID; global $UserID; $Strings = GSA('1604,1614'); if (isset($_POST['MsgF']) && isset($_POST['MsgS']) && isset($_POST['MsgM']) && isset($_POST['MsgE'])) { if (strlen(trim($_POST['MsgM'])) < 0) { ReturnResponse(false, Pacify($Strings[1604]), 'errmsg nomrgb mrgts din', "Foc('MsgM');", 'CtcMsg'); } if (is_numeric($_POST['MsgF']) && is_numeric($_POST['MsgS'])) { $From = $_POST['MsgE']; if ($UserID > 0) { $From .= ' (User ' . $UserID . ')'; } if (SaveMessage(MessageUser, $From, GS((int) $_POST['MsgF']) . ':' . GS((int) $_POST['MsgS']), $_POST['MsgM'])) { SendMail('User ' . $UserID . PHP_EOL . PHP_EOL . Fix($_POST['MsgM']), Fix(GS((int) $_POST['MsgF']) . ':' . GS((int) $_POST['MsgS'])), '*****@*****.**', Fix($_POST['MsgE'])); ReturnResponse(true, '', '', 'PopC(\'' . Pacify(Pacify($Strings[1614]), true) . '\');'); } } } ReturnResponse(false, '', '', "PopErr();"); }
} else { print_r($returnArr); } $supportedCompression = array('zip', 'rar', 'gz', 'bzip', 'tbz', 'tgz', 'tar'); foreach ($returnArr['files'] as $fileentry) { $filename = $fileentry['name']; debug("The filename is {$filename}\n"); $ext = end(explode('.', $filename)); debug("The extension is {$ext}\n"); if (in_array($ext, $supportedCompression)) { debug("{$filename} is a supported archive\n"); $owner = getTransmissionTransferOwner($tHash); debug("The owner is {$owner}\n"); $message = "Torrent {$tName} was finished and unzipping of file {$filename} has started."; //SaveMessage($to_user, $cfg["user"], htmlentities($message), (empty($to_all_r)) ? 0 : 1, (!empty($force_read_r) && $cfg['isAdmin']) ? 1 : 0); SaveMessage($owner, $owner, htmlentities($message), 0, 0); // start uncompressing the file if ($ext === "rar") { unrarFile($returnArr['downloadDir'], $filename, $returnArr['name']); } if ($ext === "zip") { unzipFile($returnArr['downloadDir'], $filename, $returnArr['name']); } if ($ext === "gz") { print "Not yet implemented"; } } } debug("\nEnd of script"); exit; // unrar file
$message = getRequestVar('message'); if (!empty($message)) { $to_all = getRequestVar('to_all'); if (!empty($to_all)) { $to_all = 1; } else { $to_all = 0; } $force_read = getRequestVar('force_read'); if (!empty($force_read) && IsAdmin()) { $force_read = 1; } else { $force_read = 0; } $message = check_html($message, "nohtml"); SaveMessage($to_user, $cfg['user'], htmlentities($message), $to_all, $force_read); header("location: readmsg.php"); } else { $rmid = getRequestVar('rmid'); if (!empty($rmid)) { list($from_user, $message, $ip, $time) = GetMessage($rmid); $message = _DATE . ": " . date(_DATETIMEFORMAT, $time) . "\n" . $from_user . " " . _WROTE . ":\n\n" . $message; $message = ">" . str_replace("\n", "\n>", $message); $message = "\n\n\n" . $message; } DisplayHead(_SENDMESSAGETITLE); ?> <form name="theForm" method="post" action="message.php"> <table border="0" cellpadding="3" cellspacing="2" width="100%"> <tr>
$message = getRequestVar('message'); if (!empty($message)) { $to_all = getRequestVar('to_all'); if (!empty($to_all)) { $to_all = 1; } else { $to_all = 0; } $force_read = getRequestVar('force_read'); if (!empty($force_read) && IsAdmin()) { $force_read = 1; } else { $force_read = 0; } $message = check_html($message, "nohtml"); SaveMessage($to_user, $cfg['user'], $message, $to_all, $force_read); header("location: readmsg.php"); } else { $rmid = getRequestVar('rmid'); if (!empty($rmid)) { list($from_user, $message, $ip, $time) = GetMessage($rmid); $message = _DATE . ": " . date(_DATETIMEFORMAT, $time) . "\n" . $from_user . " " . _WROTE . ":\n\n" . $message; $message = ">" . str_replace("\n", "\n>", $message); $message = "\n\n\n" . $message; } DisplayHead(_SENDMESSAGETITLE); ?> <form name="theForm" method="post" action="message.php"> <table border="0" cellpadding="3" cellspacing="2" width="100%"> <tr>