Members   Search      Help    Register    Login    Home
Home » Support Forums for PMBT 2.X » Feature Request for 2.X » Upload approval
Upload approval [message #3278] Fri, 04 December 2009 17:51 Go to next message
Voreios is currently offline Voreios  Finland
Messages: 75
Registered: October 2009
Seeder
Hi, I would like to give users the right to upload but I would also like to check and approve new uploads before they appear in public. Is this possible to be done somehow ? Thanks.
Re: Upload approval [message #3282 is a reply to message #3278] Sat, 05 December 2009 09:45 Go to previous messageGo to next message
joeroberts is currently offline joeroberts  United States
Messages: 1971
Registered: June 2006
Location: U.S.A
Releaser
Da HacKer
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
aproved =  'yes'  AND 

before eachthere is 4
banned = 'no' AND 


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

  1. need_torrentaproved
  2. can_see_unapr
  3. can_aprove


now add the below image to images file
http://t3.gstatic.com/images?q=tbn:JxzPea42k3fUJM:http://www.aamissiondepot.com/res/images/lock.png



http://a.imageshack.us/img831/5562/mybikes.png
Re: Upload approval [message #3285 is a reply to message #3282] Sat, 05 December 2009 10:57 Go to previous messageGo to next message
Voreios is currently offline Voreios  Finland
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 #3287 is a reply to message #3285] Sat, 05 December 2009 11:45 Go to previous messageGo to next message
joeroberts is currently offline joeroberts  United States
Messages: 1971
Registered: June 2006
Location: U.S.A
Releaser
Da HacKer
replace
        $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;

with

        $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;


http://a.imageshack.us/img831/5562/mybikes.png
Re: Upload approval [message #3288 is a reply to message #3287] Sat, 05 December 2009 11:52 Go to previous messageGo to next message
Voreios is currently offline Voreios  Finland
Messages: 75
Registered: October 2009
Seeder
Seems to work but how I can make all current torrents approved ? They are all unapproved by default now.
Re: Upload approval [message #3289 is a reply to message #3288] Sat, 05 December 2009 11:58 Go to previous messageGo to next message
joeroberts is currently offline joeroberts  United States
Messages: 1971
Registered: June 2006
Location: U.S.A
Releaser
Da HacKer
UPDATE `torrent_torrents` SET `aproved` = 'yes' 


http://a.imageshack.us/img831/5562/mybikes.png
Re: Upload approval [message #3290 is a reply to message #3289] Sat, 05 December 2009 12:21 Go to previous messageGo to next message
Voreios is currently offline Voreios  Finland
Messages: 75
Registered: October 2009
Seeder
This fixed it, now last thing is that the image and the description doesn't show if torrent is unapproved. Seems you can't select Banned "no" and Approved "no" at the same time.

[Updated on: Sat, 05 December 2009 12:23]

Report message to a moderator

Re: Upload approval [message #3292 is a reply to message #3290] Sat, 05 December 2009 12:36 Go to previous messageGo to next message
joeroberts is currently offline joeroberts  United States
Messages: 1971
Registered: June 2006
Location: U.S.A
Releaser
Da HacKer
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


http://a.imageshack.us/img831/5562/mybikes.png

[Updated on: Sat, 05 December 2009 12:37]

Report message to a moderator

Re: Upload approval [message #3297 is a reply to message #3292] Sat, 05 December 2009 12:50 Go to previous messageGo to next message
Voreios is currently offline Voreios  Finland
Messages: 75
Registered: October 2009
Seeder
Thanks, that worked Smile

*No it didn't, now when I choose "approved" it always stays "unapproved" Crying or Very Sad

[Updated on: Sat, 05 December 2009 12:53]

Report message to a moderator

Re: Upload approval [message #3299 is a reply to message #3297] Sat, 05 December 2009 12:56 Go to previous messageGo to next message
Voreios is currently offline Voreios  Finland
Messages: 75
Registered: October 2009
Seeder
Didn't work, please check my edited post before.
Re: Upload approval [message #3300 is a reply to message #3299] Sat, 05 December 2009 13:05 Go to previous messageGo to next message
joeroberts is currently offline joeroberts  United States
Messages: 1971
Registered: June 2006
Location: U.S.A
Releaser
Da HacKer
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."';";


http://a.imageshack.us/img831/5562/mybikes.png
Re: Upload approval [message #3302 is a reply to message #3297] Sat, 05 December 2009 13:11 Go to previous messageGo to next message
Voreios is currently offline Voreios  Finland
Messages: 75
Registered: October 2009
Seeder
Now it's always Aproved "no" but the torrent is always approved Confused
Re: Upload approval [message #3303 is a reply to message #3302] Sat, 05 December 2009 13:29 Go to previous messageGo to next message
joeroberts is currently offline joeroberts  United States
Messages: 1971
Registered: June 2006
Location: U.S.A
Releaser
Da HacKer
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";
		}


http://a.imageshack.us/img831/5562/mybikes.png

[Updated on: Sat, 05 December 2009 13:31]

Report message to a moderator

Re: Upload approval [message #3306 is a reply to message #3303] Sat, 05 December 2009 13:35 Go to previous messageGo to next message
Voreios is currently offline Voreios  Finland
Messages: 75
Registered: October 2009
Seeder
It works now, many thanks Smile
Re: Upload approval [message #3316 is a reply to message #3306] Sun, 06 December 2009 13:54 Go to previous messageGo to next message
Daffy is currently offline Daffy  United Kingdom
Messages: 359
Registered: October 2009
Location: uk
Releaser

gone thru this, not working for me. seems those who need approval can still upload and be viewable to download. if i select no approval to torrents nothing changes. Sad

Re: Upload approval [message #3323 is a reply to message #3278] Mon, 07 December 2009 18:53 Go to previous messageGo to next message
Daffy is currently offline Daffy  United Kingdom
Messages: 359
Registered: October 2009
Location: uk
Releaser

thanks joe, how does one hide non approved from latest X on index page.

Re: Upload approval [message #4422 is a reply to message #3278] Sun, 11 July 2010 14:50 Go to previous messageGo to next message
Daffy is currently offline Daffy  France
Messages: 359
Registered: October 2009
Location: uk
Releaser

i tried re adding this yesterday and gotten erros in torrent.php so had to remove the code from torrents.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;



also the user, who uploaded can see the torrent displayed on index page,its hidden ok on torrents.php page


[Updated on: Sun, 11 July 2010 14:56]

Report message to a moderator

Re: Upload approval [message #4424 is a reply to message #4422] Sun, 11 July 2010 14:55 Go to previous messageGo to next message
joeroberts is currently offline joeroberts  United States
Messages: 1971
Registered: June 2006
Location: U.S.A
Releaser
Da HacKer
the uploader should be able to see it so if something happens he can easly redownload it.
what was the error you got?


http://a.imageshack.us/img831/5562/mybikes.png
Re: Upload approval [message #4425 is a reply to message #4424] Sun, 11 July 2010 14:58 Go to previous messageGo to next message
Daffy is currently offline Daffy  France
Messages: 359
Registered: October 2009
Location: uk
Releaser

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



Re: Upload approval [message #4426 is a reply to message #4425] Sun, 11 July 2010 15:12 Go to previous messageGo to next message
joeroberts is currently offline joeroberts  United States
Messages: 1971
Registered: June 2006
Location: U.S.A
Releaser
Da HacKer
can you show me your edit.php with modd added?

http://a.imageshack.us/img831/5562/mybikes.png
Re: Upload approval [message #4427 is a reply to message #4426] Sun, 11 July 2010 15:17 Go to previous messageGo to next message
Daffy is currently offline Daffy  France
Messages: 359
Registered: October 2009
Location: uk
Releaser

No Message Body
  • Attachment: edit.php
    (Size: 21.72KB, Downloaded 56 times)


Re: Upload approval [message #4428 is a reply to message #4427] Sun, 11 July 2010 15:24 Go to previous messageGo to next message
joeroberts is currently offline joeroberts  United States
Messages: 1971
Registered: June 2006
Location: U.S.A
Releaser
Da HacKer
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."';";


http://a.imageshack.us/img831/5562/mybikes.png
Re: Upload approval [message #4429 is a reply to message #4428] Sun, 11 July 2010 15:35 Go to previous messageGo to next message
Daffy is currently offline Daffy  France
Messages: 359
Registered: October 2009
Location: uk
Releaser

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


Re: Upload approval [message #4430 is a reply to message #4429] Sun, 11 July 2010 18:29 Go to previous messageGo to next message
joeroberts is currently offline joeroberts  United States
Messages: 1971
Registered: June 2006
Location: U.S.A
Releaser
Da HacKer
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;


http://a.imageshack.us/img831/5562/mybikes.png

[Updated on: Sun, 11 July 2010 18:42]

Report message to a moderator

Re: Upload approval [message #4431 is a reply to message #4430] Sun, 11 July 2010 18:34 Go to previous message
Daffy is currently offline Daffy  France
Messages: 359
Registered: October 2009
Location: uk
Releaser

No Message Body
  • Attachment: torrents.php
    (Size: 7.43KB, Downloaded 49 times)


[Updated on: Sun, 11 July 2010 18:40]

Report message to a moderator

Previous Topic:Top 5 Downloads
Next Topic:Date of the upload ?
Goto Forum:
  


Current Time: Wed Feb 08 05:57:38 GMT 2012

Total time taken to generate the page: 0.00974 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software