Bravo List

Bravo List (http://www.bvlist.com/index.php)
-   Mods & Themes (http://www.bvlist.com/forumdisplay.php?f=109)
-   -   Anonymous Uploader (http://www.bvlist.com/showthread.php?t=4919)

\n";
 if ($una["username"])
 $s .= "\n";
 else
 $s .= "\n";
Replace with:

Code:

// user/ip/port
// check if anyone has this ip
($unr = mysql_query("SELECT id, username, privacy, warned, donor FROM users WHERE id=$e[userid] ORDER BY last_access DESC LIMIT 1")) or die;
$una = mysql_fetch_array($unr);
if ($una["privacy"] == "strong") continue;
++$num;

$highlight = $CURUSER["id"] == $una["id"] ? " bgcolor=#BBAF9B" : "";
$s .= "\n";
//$s .= "
\n";
if ($una["username"]) {

if (get_user_class() >= UC_MODERATOR || $torrent['anonymous'] != 'yes' || $e['userid'] != $torrent['owner']) {
// $s .= "
\n";
$s .= "
\n";
}
}
else
$s .= "
\n";
Find the big query, and add anonymous,
inline, like:

Code:

torrents.anonymous, categories.name AS cat_name, users.username
Now find:

Code:

$keepget = "";
if($row['anonymous'] == 'yes') {

if (get_user_class() < UC_UPLOADER)
$uprow = "Anonymous";
else
$uprow = "Anonymous ($row[username])";
}
else {
$uprow = (isset($row["username"]) ? ("" . htmlspecialchars($row["username"]) . "") : "(unknown)");
}
if ($owned)

In bittorrent.php find:

Code:

if ($variant == "index")
 print("
\n");
And replace that with:

Code:

if ($variant == "index") {
if ($row["anonymous"] == "yes") {
 print("
\n");
 }
else {
 print("
\n");
 }
}

Now, in edit.php, beneath:

Code:

tr("Visible", " Visible on main page
Rendevous 4th May 2010 12:11

Anonymous Uploader
 
This is the complete anonymous uploading mod.
In upload.php uploader can choose to hide their name.

Code:

ALTER TABLE `torrents` ADD `anonymous` ENUM( 'yes', 'no' ) DEFAULT 'no' NOT NULL;
In upload.php add:

Code:

tr("Show uploader", "Don't show my username in 'Uploaded By' field in browse.", 1);
In takeupload.php find:

Code:

$f = $_FILES["file"];
$fname = unesc($f["name"]);
if (empty($fname))
 bark("Empty filename!");

Change to:

Code:

$f = $_FILES["file"];
$fname = unesc($f["name"]);
if (empty($fname))
 bark("Empty filename!");
if ($_POST['uplver'] == 'yes') {
$anonymous = "yes";
$anon = "Anonymous";
}
else {
$anonymous = "no";
$anon = $CURUSER["username"];
}

Find:

Code:

$ret = mysql_query("INSERT INTO torrents (search_text, filename, owner, visible,
And add anonymous inline, like:

Code:

$ret = mysql_query("INSERT INTO torrents (search_text, filename, owner, visible, anonymous, info_hash, name,
Do the same for:

Code:

implode(",", array_map("sqlesc", array(searchfield("$shortfname $dname $torrent"), $fname, $CURUSER["id"], "no",
So it looks like this:

Code:

implode(",", array_map("sqlesc", array(searchfield("$shortfname $dname $torrent"), $fname, $CURUSER["id"], "no", $anonymous, $infohash,
browse.php

Find:

Code:

torrents.filename,torrents.owner,IF(torrents.nfo <> '', 1, 0) as nfoav," .
Replace that with:

Code:

torrents.filename,torrents.anonymous,torrents.owner,IF(torrents.nfo <> '', 1, 0) as nfoav," .
In details.php find:

Code:

// user/ip/port
 // check if anyone has this ip
 ($unr = mysql_query("SELECT username, privacy FROM users WHERE id=$e[userid] ORDER BY last_access DESC LIMIT 1")) or die;
 $una = mysql_fetch_array($unr);
 if ($una["privacy"] == "strong") continue;
 $s .= "
$una[username]" . ($mod ? $e["ip"] : preg_replace('/\.\d+$/', ".xxx", $e["ip"])) . "
$una[username]$una[username]" . ($una["donor"] == "yes" ? "Donor" : "") . ($una["enabled"] == "no" ? "\"This" : ($una["warned"] == "yes" ? "\"Warned\"" : ""));
}
elseif (get_user_class() >= UC_MODERATOR || $torrent['anonymous'] = 'yes') {
$s .= "
Anonymous(unknown) " . (isset($row["username"]) ? ("" . htmlspecialchars($row["username"]) . "") : "(unknown)") . " Anonymous" . (isset($row["username"]) ? ("" . htmlspecialchars($row["username"]) . "") : "(unknown)") . "
Note that the torrent will automatically become visible when there's a seeder, and will become automatically invisible (dead) when there has been no seeder for a while. Use this switch to speed the process up manually. Also note that invisible (dead) torrents can still be viewed or searched for, it's just not the default.
", 1);
Add this:

Code:

tr("Anonymous uploader", " Check this box to hide the uploader of the torrent", 1);
In takeedit.php, over:

Code:

$updateset[] = "name = " . sqlesc($name);
Add:

Code:

$updateset[] = "anonymous = '" . ($_POST["anonymous"] ? "yes" : "no") . "'";
Thanks to Wilba and Pirata from Tbdev:drink:

All times are GMT +2. The time now is 18:30.

Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2024, vBulletin Solutions Inc.