"Movie-Torrentz, post: 87111":thanks for the replyWhen a user downloads a torrent, it shows the description in the torrent with the message shown above, try clicking show torrent info on utorrent to see message..
foreach (array("torrents.name", "torrents.description") as $sss)
$where = where ($_SERVER["SCRIPT_FILENAME"], $row["id"], 0);
SQL_Query_exec("UPDATE users SET last_access='" . get_date_time() . "', ip=".sqlesc($ip).", page=".sqlesc($where)." WHERE id=" . $row["id"]);
function where ($scriptname = "index", $userid, $update=1){
if (!is_valid_id($userid))
die;
$where = str_replace($_SERVER["DOCUMENT_ROOT"], null, $_SERVER["SCRIPT_FILENAME"]);
if (preg_match("/account-details/i", $scriptname))
$where = "Browsing Account Details...";
elseif (preg_match("/account/i", $scriptname))
$where = "Browsing User Control Panel...";
elseif (preg_match("/forums/i", $scriptname))
$where = "Browsing Forums...";
elseif (preg_match("/index/i", $scriptname))
$where = "Browsing Homepage...";
else
$where = "Unknown Location...";
if ($update) {
$query = sprintf("UPDATE users SET page=".sqlesc($where)." WHERE id ='%s'", mysql_real_escape_string($userid));
$result = SQL_Query_exec($query);
}
return $where;
}
function where22($scriptname = "index", $userid, $update = 1, $title)
{
if (!is_valid_id($userid))
die;
if (preg_match("/torrents-details/i", $scriptname)) {
if (is_valid_id($_GET['id'])) {
$res = SQL_Query_exec("SELECT `name` FROM `torrents` WHERE `id` = '" . $_GET['id'] . "'");
$row = mysql_fetch_assoc($res);
}
$where = "Browsing Torrents Details (" . ($row ? $row['name'] : "ID: $_GET[id]") . ")...";
} elseif (preg_match("/torrents.php/i", $scriptname)) {
$where = "Browsing Torrents";
} elseif (preg_match("/staff.php/i", $scriptname)) {
$where = "Staff Page";
} elseif (preg_match("/download.php/i", $scriptname)) {
if (is_valid_id($_GET['id'])) {
$res = SQL_Query_exec("SELECT `name` FROM `torrents` WHERE `id` = '" . $_GET['id'] . "'");
$row = mysql_fetch_assoc($res);
}
$where = "Downloading Torrent (" . ($row ? $row['name'] : "ID: $_GET[id]") . ")...";
} elseif (preg_match("/download_rss.php/i", $scriptname)) {
if (is_valid_id($_GET['id'])) {
$res = SQL_Query_exec("SELECT `name` FROM `torrents` WHERE `id` = '" . $_GET['id'] . "'");
$row = mysql_fetch_assoc($res);
}
$where = "Rss Downloading (" . ($row ? $row['name'] : "ID: $_GET[id]") . ")...";
} elseif (preg_match("/account-details/i", $scriptname)) {
if (is_valid_id($_GET['id'])) {
$res = SQL_Query_exec("SELECT `username` FROM `users` WHERE `id` = '" . $_GET['id'] . "'");
$row = mysql_fetch_assoc($res);
}
$where = "Browsing Account Details (" . ($row ? $row['username'] : "ID: $_GET[id]") . ")...";
} elseif (preg_match("/torrents-upload/i", $scriptname)) {
$where = "Uploading Torrent..";
} elseif (preg_match("/account/i", $scriptname)) {
$where = "Browsing User Control Panel";
} elseif (preg_match("/torrents-edit.php/i", $scriptname)) {
if (is_valid_id($_GET['id'])) {
$res = SQL_Query_exec("SELECT `name` FROM `torrents` WHERE `id` = '" . $_GET['id'] . "'");
$row = mysql_fetch_assoc($res);
}
$where = "Edited An Torrent (" . ($row ? $row['name'] : "ID: $_GET[id]") . ")...";
} elseif (preg_match("/torrents-search/i", $scriptname)) {
$where = "Searching Torrents";
} elseif (preg_match("/forums/i", $scriptname)) {
$forumid = $_GET[topicid];
if ($forumid > 0) {
$res_forumid = SQL_Query_exec("SELECT subject FROM forum_topics WHERE id=$forumid");
$row_forumid = mysql_fetch_row($res_forumid);
$forumname = $row_forumid[0];
$smallname3 = substr(htmlspecialchars($forumname), 0, 40);
$where = "Browsing Forums (Topic: $smallname3)";
} else {
$where = "Browsing Forums";
}
} elseif (preg_match("/index/i", $scriptname)) {
$where = "Browsing Homepage";
} else {
if ($title)
$where = $title;
else
$where = str_replace($_SERVER["DOCUMENT_ROOT"], null, $_SERVER["SCRIPT_FILENAME"]);
}
if ($update) {
$ip = getip();
$query = sprintf("UPDATE users SET last_access=" . sqlesc(get_date_time()) . ", ip=" . sqlesc($ip) . ", page=" . sqlesc($where) . " WHERE id ='%s'", mysql_real_escape_string($userid));
$result = SQL_Query_exec($query);
}
return $where;
}
"mostvotedplaya, post: 86905":ihave the where functionupdate the where function in backend/functions.php
function where ($scriptname = "index", $userid, $update=1){
if (!is_valid_id($userid))
die;
if (preg_match("/torrents-details/i", $scriptname))
$where = "Browsing Torrents Details (ID: $_GET[id])...";
elseif (preg_match("/torrents.php/i", $scriptname))
$where = "Browsing Torrents...";
elseif (preg_match("/account-details/i", $scriptname))
$where = "Browsing Account Details (ID: $_GET[id])...";
elseif (preg_match("/torrents-upload/i", $scriptname))
$where = "Uploading Torrent..";
elseif (preg_match("/account/i", $scriptname))
$where = "Browsing User Control Panel...";
elseif (preg_match("/torrents-search/i", $scriptname))
$where = "Searching Torrents...";
elseif (preg_match("/forums/i", $scriptname))
$where = "Browsing Forums...";
elseif (preg_match("/index/i", $scriptname))
$where = "Browsing Homepage...";
else
$where = "Unknown Location...";
if ($update) {
$query = sprintf("UPDATE users SET page=".sqlesc($where)." WHERE id ='%s'", mysql_real_escape_string($userid));
$result = SQL_Query_exec($query);
}
return $where;
}
SQL_Query_exec("INSERT INTO users (added, last_access, secret, username, password, status, email) VALUES(NOW(), NOW(), $secret, $username, $passhash, 'confirmed', $email)");
#======================================================================#
# Add Users
#======================================================================#
if ($action == "adduser") {
if ($CURUSER["class"] < "7"){
show_error_msg("Error","Sorry you do not have the rights to view this page!",1);
}
if ($_SERVER["REQUEST_METHOD"] == "POST")
{
if ($_POST["username"] == "" || $_POST["password"] == "" || $_POST["email"] == "")
show_error_msg("Error", "Missing form data.");
if ($_POST["password"] != $_POST["password2"])
show_error_msg("Error", "Passwords mismatch.");
$username = sqlesc($_POST["username"]);
$password = $_POST["password"];
$email = sqlesc($_POST["email"]);
$secret = mksecret();
$passhash = sqlesc(md5($password));
$secret = sqlesc($secret);
SQL_Query_exec("INSERT INTO users (added, last_access, secret, username, password, status, email) VALUES(NOW(), NOW(), $secret, $username, $passhash, 'confirmed', $email)");
$res = SQL_Query_exec("SELECT id FROM users WHERE username=$username");
$arr = mysql_fetch_row($res);
if (!$arr)
show_error_msg("Erro", "Unable to create the account. The user name is possibly already taken.");
header("Location: account-details.php?id=$arr[0]");[/b]
die;
}
stdhead("Add user");
navmenu();
begin_frame();
?>
<div align=center>
<h1>Add user</h1>
<form method=post action=admincp.php?action=adduser>
<table border=1 cellspacing=0 cellpadding=5>
<tr><td class=rowhead>Username</td><td><input type=text name=username size=40></td></tr>
<tr><td class=rowhead>Password</td><td><input type=password name=password size=40></td></tr>
<tr><td class=rowhead>Re-type password</td><td><input type=password name=password2 size=40></td></tr>
<tr><td class=rowhead>E-mail</td><td><input type=text name=email size=40></td></tr>
<tr><td colspan=2 align=center><input type=submit value="Okay" class=btn></td></tr>
</table>
</form>
</div>
<?
end_frame();
stdfoot();
}
#======================================================================#
# END Add Users
#======================================================================#
EDIT:i change the $passhash = sqlesc(md5($password));
[b] with the
$passhash = sqlesc(sha1($password)); and its ok now
//take comment add
if ($_GET["takecomment"] == 'yes'){
$commentbody = $_POST['body'];
if (!$commentbody)
show_error_msg("Error","You did not enter anything!",1);
Below, add:
//PM NOTIF
$res = SQL_Query_exec("SELECT name, owner FROM torrents WHERE id = $id");
$arr = mysql_fetch_array($res);
if($CURUSER['id'] != $arr["owner"]) {
$msg = "You have received a comment on your torrent
."/torrents-details.php?id=$id]" . $arr[name] . "";
SQL_Query_exec("INSERT INTO messages (poster, sender, receiver, msg, added,subject) VALUES('0','0', " . $arr['owner'] . ", " .
sqlesc($msg) . ", '" . get_date_time() . "','New comment!')");
}
//PM NOTIF
[/code] "mostvotedplaya, post: 80300":when download a torrent i take a message: To download you must thank the user. How to back to torrent from this ....something Back and click this to back in Thanks in torrent details.Something that as attach file. I hope you understand mein download.php for 2.07+ change
to
$res = SQL_Query_exec("SELECT filename, banned, external, announce FROM torrents WHERE id =".intval($id));
$res = SQL_Query_exec("SELECT filename, banned, external, announce, thanks, owner FROM torrents WHERE id =".intval($id));
Above
$name = $row['filename'];
Add
if ($CURUSER["id"] != $row["owner"] && !in_array($CURUSER["username"], explode(',', $row["thanks"])))
show_error_msg("Error", "To download you must thank the user.", 1);
Try That ^
$site_config['autoclean_interval'] = '3600';
$site_config['max_dead_torrent_time'] = '21600';/