Home » Support Forums for PMBT 2.X » Feature Request for 2.X » Upload approval
|
| Re: Upload approval [message #3282 is a reply to message #3278] |
Sat, 05 December 2009 09:45   |
|
ok here is what I got
first run this sql
ALTER TABLE `torrent_torrents` ADD `aproved` ENUM( 'yes', 'no' ) NOT NULL DEFAULT 'no'
Now open upload/taketorrent.php
find
$torrentfields[] = "last_action";
$torrentvalues[] = "NOW()";
and add after
if(checkaccess("need_torrentaproved"))$aproved ="no";
else
$aproved = "yes";
$torrentfields[] = "aproved";
$torrentvalues[] = "'".$aproved."'";
Now open search.php
find
$banwhere = "banned = 'no' AND";
$passwhere = " password IS NULL AND";
if ($user->moderator) $banwhere = "";
if ($user->premium) $passwhere = "";
and add after
$aproved = "aproved = 'yes' AND";
if(!checkaccess("can_see_unapr"))$banwhere = $banwhere." ".$aproved;
now open backend.php
and add
before eachthere is 4
Now open torrents.php
find
$passwhere = " AND ".$db_prefix."_torrents.password IS NULL ";
$viswhere = "visible = 'yes' AND banned = 'no'";
if ($user->moderator) $viswhere = "1";
if ($user->premium) $passwhere = "";
and replace with
$passwhere = " AND ".$db_prefix."_torrents.password IS NULL ";
$viswhere = "visible = 'yes' AND banned = 'no'";
if ($user->moderator) $viswhere = "";
if ($user->premium) $passwhere = "";
$aproved = "aproved = 'yes' AND";
if(!checkaccess("can_see_unapr"))$viswhere = $viswhere." ".$aproved;
Now open edit.php
find
if (!isset($op)) $op="edit";
if (!isset($banned)) $banned= "no";
and add after
if (!isset($aproved)) $aproved= "no";
now find
$errmsg = Array();
$sql = "SELECT info_hash, owner FROM ".$db_prefix."_torrents WHERE id = '".$id."';";
$res = $db->sql_query($sql);
list ($info_hash, $original_owner) = $db->sql_fetchrow($res);
$infohash_hex = preg_replace_callback('/./s', "hex_esc", str_pad($torrent["info_hash"],20));
$db->sql_freeresult($res);
and add after
if (checkaccess("can_aprove")) $aproved = ", aproved = '".$aproved."'";
now find
if ($user->moderator){
echo "<tr><td><p>"._btbanned."</p></td><td><p><input type=\"radio\" name=\"banned\"" . ($row["banned"] == "yes" ? " checked" : "") . " value=\"yes\">Yes<input type=\"radio\" name=\"banned\"" . ($row["banned"] == "no" ? " checked" : "") . " value=\"no\">No</p>\n</td></tr>\n";
}
and add after
if (checkaccess("can_aprove")){
echo "<tr><td><p>Aproved</p></td><td><p><input type=\"radio\" name=\"aproved\"" . ($row["aproved"] == "yes" ? " checked" : "") . " value=\"yes\">Yes<input type=\"radio\" name=\"banned\"" . ($row["banned"] == "no" ? " checked" : "") . " value=\"no\">No</p>\n</td></tr>\n";
}
Now open include/bittorrent.php
find
if($row["nuked"] == "yes") {help(pic ("nuked.gif","",null),"This File Has Been Nuked. Wich meens It may have parts missing Sound is off time or some other troubles so download at your own risk"); $imgs++; }
if ($row["evidence"] != 0) { echo pic("sticky.gif",null,_btalt_sticky); $imgs++; }
and add before
if($row["aproved"] == "no") {help(pic ("lock.png","",null),"This File Has Been Not been aproved"); $imgs++; }
now go to admin level controle and add the following and edit as needed
- need_torrentaproved
- can_see_unapr
- can_aprove
now add the below image to images file

|
|
|
| Re: Upload approval [message #3285 is a reply to message #3282] |
Sat, 05 December 2009 10:57   |
Voreios  Messages: 75 Registered: October 2009 |
Seeder |
|
|
Error with torrents.php, as a user you get this:
Error Executing SQL Query SELECT torrent_torrents.*, IF(torrent_torrents.numratings < '1', NULL, ROUND(torrent_torrents.ratingsum / torrent_torrents.numratings, 1)) AS rating, torrent_categories.name AS cat_name, torrent_categories.image AS cat_pic, U.username, IF(U.name IS NULL, U.username, U.name) as user_name, U.level as user_level FROM torrent_torrents LEFT JOIN torrent_categories ON category = torrent_categories.id LEFT JOIN torrent_users U ON torrent_torrents.owner = U.id WHERE visible = 'yes' AND banned = 'no' aproved = 'yes' AND AND torrent_torrents.password IS NULL ORDER BY torrent_torrents.evidence DESC, torrent_torrents.added DESC LIMIT 0,30;
Error ID: 1064
Error Message: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'aproved = 'yes' AND AND torrent_torrents.password IS NULL ORDER BY torrent_torr' at line 1
[Updated on: Sat, 05 December 2009 11:36] Report message to a moderator
|
|
| | | | |
| Re: Upload approval [message #3292 is a reply to message #3290] |
Sat, 05 December 2009 12:36   |
|
change
if (checkaccess("can_aprove")){
echo "<tr><td><p>Aproved</p></td><td><p><input type=\"radio\" name=\"aproved\"" . ($row["aproved"] == "yes" ? " checked" : "") . " value=\"yes\">Yes<input type=\"radio\" name=\"banned\"" . ($row["banned"] == "no" ? " checked" : "") . " value=\"no\">No</p>\n</td></tr>\n";
}
to
if (checkaccess("can_aprove")){
echo "<tr><td><p>Aproved</p></td><td><p><input type=\"radio\" name=\"aproved\"" . ($row["aproved"] == "yes" ? " checked" : "") . " value=\"yes\">Yes<input type=\"radio\" name=\"aproved\"" . ($row["banned"] == "no" ? " checked" : "") . " value=\"no\">No</p>\n</td></tr>\n";
}
as for image try adding it to your themes pics folder
[Updated on: Sat, 05 December 2009 12:37] Report message to a moderator
|
|
| | |
| Re: Upload approval [message #3300 is a reply to message #3299] |
Sat, 05 December 2009 13:05   |
|
sorry in edit.php change
$sql = "UPDATE ".$db_prefix."_torrents SET name = '".$namex."', exeem = '".$exeem."', descr = '".$descr."', category = '".$torrent_category."', ownertype = '".$ownertype."', owner = '".$owner."', password = ".$password.", banned = '".$banned."', nuked = '".$nuked."', ratiobuild = '".$build."', nukereason='".$nukereason."', evidence = '".$evidence."' WHERE id = '".$id."';";
to
$sql = "UPDATE ".$db_prefix."_torrents SET name = '".$namex."', exeem = '".$exeem."', descr = '".$descr."', category = '".$torrent_category."', ownertype = '".$ownertype."', owner = '".$owner."', password = ".$password.", banned = '".$banned."', nuked = '".$nuked."', ratiobuild = '".$build."', nukereason='".$nukereason."'".$aproved.", evidence = '".$evidence."' WHERE id = '".$id."';";
|
|
| |
| Re: Upload approval [message #3303 is a reply to message #3302] |
Sat, 05 December 2009 13:29   |
|
ok one last time
change
if (checkaccess("can_aprove")){
echo "<tr><td><p>Aproved</p></td><td><p><input type=\"radio\" name=\"aproved\"" . ($row["aproved"] == "yes" ? " checked" : "") . " value=\"yes\">Yes<input type=\"radio\" name=\"banned\"" . ($row["banned"] == "no" ? " checked" : "") . " value=\"no\">No</p>\n</td></tr>\n";
}
to
if (checkaccess("can_aprove")){
echo "<tr><td><p>Aproved</p></td><td><p><input type=\"radio\" name=\"aproved\"" . ($row["aproved"] == "yes" ? " checked" : "") . " value=\"yes\">Yes<input type=\"radio\" name=\"aproved\"" . ($row["aproved"] == "no" ? " checked" : "") . " value=\"no\">No</p>\n</td></tr>\n";
}
[Updated on: Sat, 05 December 2009 13:31] Report message to a moderator
|
|
| | | | | |
| Re: Upload approval [message #4425 is a reply to message #4424] |
Sun, 11 July 2010 14:58   |
|
after adding imdb part for editing.. lower than staff users get this error when submitting after editing.
Error Executing SQL Query UPDATE torrent_torrents SET name = 'TEST DO NOT DOWNLOAD', exeem = '', descr = ' :cowboy: ', category = '1', ownertype = '0', owner = '14498', password = NULL, banned = 'no', nuked = '', ratiobuild = '', nukereason=''no, evidence = '0', imdb = '' WHERE id = '8285';
Error ID: 1064
Error Message: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'no, evidence = '0', imdb = '' WHERE id = '8285'' at line 1


For cheap, fast, reliable webhosting, please click here on my affiliate link!
|
|
| | |
| Re: Upload approval [message #4428 is a reply to message #4427] |
Sun, 11 July 2010 15:24   |
|
change line 139 to
if (checkaccess("can_aprove")) $aprovedsql = ", aproved = '".$aproved."'";
else $aprovedsql = '';
and line 200 to
$sql = "UPDATE ".$db_prefix."_torrents SET name = '".$namex."', exeem = '".$exeem."', descr = '".$descr."', category = '".$torrent_category."', ownertype = '".$ownertype."', owner = '".$owner."', password = ".$password.", banned = '".$banned."', nuked = '".$nuked."', ratiobuild = '".$build."', nukereason='".$nukereason."'".$aprovedsql.", evidence = '".$evidence."', imdb = '".$imdblink."' WHERE id = '".$id."';";
|
|
|
| Re: Upload approval [message #4429 is a reply to message #4428] |
Sun, 11 July 2010 15:35   |
|
seems ok now, just this part in torrent.php
$passwhere = " AND ".$db_prefix."_torrents.password IS NULL ";
$viswhere = "visible = 'yes' AND banned = 'no'";
if ($user->moderator) $viswhere = "";
if ($user->premium) $passwhere = "";
$aproved = "AND aproved = 'yes'";
if(!checkaccess("can_see_unapr"))$viswhere = $viswhere." ".$aproved;
error
Error Executing SQL Query SELECT torrent_torrents.*, IF(torrent_torrents.numratings < '1', NULL, ROUND(torrent_torrents.ratingsum / torrent_torrents.numratings, 1)) AS rating, torrent_categories.name AS cat_name, torrent_categories.image AS cat_pic, U.username, IF(U.name IS NULL, U.username, U.name) as user_name, U.level as user_level, U.can_do as can_do FROM torrent_torrents LEFT JOIN torrent_categories ON category = torrent_categories.id LEFT JOIN torrent_users U ON torrent_torrents.owner = U.id WHERE ORDER BY torrent_torrents.evidence DESC, torrent_torrents.added DESC LIMIT 0,15;
Error ID: 1064
Error Message: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ORDER BY torrent_torrents.evidence DESC, torrent_torrents.added DESC LIMIT 0,15' at line 1


For cheap, fast, reliable webhosting, please click here on my affiliate link!
|
|
|
| Re: Upload approval [message #4430 is a reply to message #4429] |
Sun, 11 July 2010 18:29   |
|
change
$passwhere = " AND ".$db_prefix."_torrents.password IS NULL ";
$viswhere = "visible = 'yes' AND banned = 'no'";
if ($user->moderator) $viswhere = "";
if ($user->premium) $passwhere = "";
$aproved = "AND aproved = 'yes'";
if(!checkaccess("can_see_unapr"))$viswhere = $viswhere." ".$aproved;
to
$passwhere = " AND ".$db_prefix."_torrents.password IS NULL ";
$viswhere = "visible = 'yes' AND banned = 'no'";
if ($user->moderator) $viswhere = "1";
if ($user->premium) $passwhere = "";
if(!checkaccess("can_see_unapr")) $aproved = "AND aproved = 'yes'";
else
$aproved = "";
$viswhere = $viswhere.$aproved;
[Updated on: Sun, 11 July 2010 18:42] Report message to a moderator
|
|
| |
Goto Forum:
Current Time: Wed Feb 08 05:57:38 GMT 2012
Total time taken to generate the page: 0.00974 seconds
|