Login
Username: Password:
Remember me

[Sign Up] / [Recover Password]

Theme / Language

Popular
New Torrents
new name
Size: 18.40 MB
Most active
new name
S: 74 L: 3
New Posters
VIP Only Torrents [TTv3]
Controls ·  Search New posts · Mark unread

You are in: Forum / Forum / Torrent Trader / v3 Mods in Progress

2019-10-10 15:03:48
Ive posted in progress but i have this installed on live site once i know i havent missed anything ill move to complete. Remember to backup.


[color=rgb(251, 160, 38)]SQL :[/color]
alter table `torrents` add vip enum('yes','no') NOT NULL default 'no';


[color=rgb(251, 160, 38)]In torrents-upload.php search :[/color]
$descr = $_POST["descr"];


Add above :
$vip = ($_POST["vip"]);


find start of line
$ret = SQL_Query_exec("INSERT INTO torrents (filename, owner, name,.....


Add inline after "name, " :
vip,


On same line find :
".sqlesc($descr).",


Add after :
'".$vip."',


Search :
if ($site_config['ANONYMOUSUPLOAD'] && $site_config["MEMBERSONLY"] ){ ?>


Add above : ( your group class might be different )
if (get_user_class() > 4)
print ("<tr><td align='right'>VIP: </td><td align=left><input type='checkbox' name='vip' " .
(($row["vip"] == "yes") ? " checked='checked' " : "" ) . " value='yes'>Check this box if you want the torrent or only for VIP.</td></tr>");


[color=rgb(251, 160, 38)]In torrents-details.php seacrh :[/color]
torrents.freeleech,


Add after :
torrents.vip,


Search :
//DECIDE IF TORRENT EXISTS
if (!$row || ($row["banned"] == "yes" && $CURUSER["edit_torrents"] == "no"))
   show_error_msg(T_("ERROR"), T_("TORRENT_NOT_FOUND"), 1);


Add after :

$vips = $row["vip"];
if ($vip == "yes") {
$vip = "<b>Yes</b>";
} else {
$vip = "<b>No</b>";
}


Search :
print ("<b>".T_("LEECHERS").": </b><font color='#ff0000'>" .  number_format($row["leechers"]) . "</font><br />");


Add after :
if ($row["external"]!='yes' && $row["vip"]== yes){
       print ("<b>Torrent VIP: </b><font color='orange'>Torrent reserved for VIP</font><br><br>");
   }


[color=rgb(251, 160, 38)]Search in torrents-edit.php :[/color]
$updateset[] = "freeleech = '".$_POST["freeleech"]."'";


Add after :
$updateset[] = "vip = '" . ($_POST["vip"] ? "yes" : "no") . "'";


Search:

if ($row["external"] != "yes" && $CURUSER["edit_torrents"] == "yes"){
   echo "<tr><td class='table_col1' align='right'><b>".T_("FREE_LEECH").": </b></td><td class='table_col2'><input type=\"checkbox\" name=\"freeleech\"" . (($row["freeleech"] == "1") ? " checked=\"checked\"" : "" ) . " value=\"1\" />".T_("FREE_LEECH_MSG")."<br /></td></tr>";
}


Add after :

if ($row["external"] != "yes" && $CURUSER["edit_torrents"] == "yes"){
   echo "<tr><td class='table_col1' align='right'><b>VIP:</b></td><td class='table_col2'><input name=vip type='checkbox'" . (($row["vip"] == "yes") ? " checked='checked'" : "" ) . " value='yes' /> Check the box to make the torrent VIP only.";
}


[color=rgb(251, 160, 38)]In torrents.php search : (same for index.php / torrents-search.php & torrents-today.php)[/color]
torrents.announce,


Add after :
torrents.vip,


[color=rgb(251, 160, 38)]In download.php search :[/color]
$fn = "$torrent_dir/$id.torrent";


Add after : (
$res = SQL_Query_exec("SELECT filename, vip FROM torrents WHERE id = $id");
$arr = mysqli_fetch_assoc($res);
$name = $arr['filename'];
$vip = $arr['vip'];

if ($vip == "yes" && $CURUSER["class"]<4 ){
   show_error_msg("Error","<b>You can not download, you have to be VIP</b>",1);
}


[color=rgb(251, 160, 38)]In backend/functions.php search :[/color]
if ($row["freeleech"] == 1)
                   $dispname .= " <img src='images/free.gif' border='0' alt='' />";


Add after :
if ($row["vip"] == "yes")
                   $dispname .= " <img src='images/vip.gif' border='0' alt='' />";


Put the image "vip.gif" in your images folder at the root of your site.

little extra you dont need this but a index block for vip torrents
[color=rgb(251, 160, 38)]in config.php add[/color]
$site_config['VIPTORRENT'] = true;        //Enable vip torrents


[color=rgb(251, 160, 38)]in index.php add[/color]
// VIP Torrents
if ($site_config['VIPTORRENT']){
include("/vip-torrents.php");
}


add vip-torrents.php to root

Any errors and you can check code here
[URL unfurl="true"]https://github.com/M-jay84/TTv3/tree/master/upload[/url]
vip.gif
vip.gif
vip-torrents.zip
Download
2019-10-10 15:12:13
Thanks for sharing, I'll set it up and come back and tell you some news.
2019-10-10 16:27:42
Thanks you ! (y)
2019-10-10 16:44:26
Thank you, it works perfectly, but since my function file is modified to have the torrent page in the image, I can't find the location or put the code for the image in the torrents

can you give me help to place the code so that the image is visible in the torrent page
functions.rar
Download
2019-10-11 10:52:40
hello, when you upload a torrent and check the box vip and freeceech and then validate there is an error message

Database Error. Please report this to an administrator.

and when I delete the codes of the vip and freeleech function from the upload.php file the torrent validates itself without any problem without the error message, here is the error message in SQL admin Error

Database Error in torrents-upload.php on line 201: Incorrect integer value: 'hh' for column `wwwtigersdl_phpbb`.`torrents`.`owner` at row 1. Query was: INSERT INTO torrents (filename, vip, owner, name, descr, image1, image2, category, added, info_hash, size, numfiles, save_as, announce, external, nfo, torrentlang, anon, last_action) VALUES



and here is the code of line 201 of the file upload.php;

$ret = SQL_Query_exec("INSERT INTO torrents (filename, vip, owner, name, descr, image1, image2, category, added, info_hash, size, numfiles, save_as, announce, external, nfo, torrentlang, anon, last_action) VALUES (".sqlesc($fname).", '".$CURUSER['id']."', ".sqlesc($name).", ".sqlesc($descr).", '".$vip."', '".$inames[0]."', '".$inames[1]."', '".$catid."', '" . get_date_time() . "', '".$infohash."', '".$torrentsize."', '".$filecounts."', ".sqlesc($fname).", '".$announce."', '".$external."', '".$nfo."', '".$langid."','$anon', '".get_date_time()."')");
2019-10-11 14:17:43
Try changing on line 201 vip, owner, name, descr,
To owner, name, descr, vip,

can you post screenshot of torrent page, did you edit torrents.php or just the functions.php (torrenttable function)
2019-10-11 16:51:22
it's only when you upload a torrent that there's this error message, Database Error. Please report this to an administrator.

but when I delete the vip code on the torrent.upload.php file it works fine
torrents-upload.rar
Download
2019-10-11 20:59:37
try change on torrents-upload.php
    $ret = SQL_Query_exec("INSERT INTO torrents (filename, vip, owner, name, descr, image1, image2, category, added, info_hash, size, numfiles, save_as, announce, external, nfo, torrentlang, anon, last_action) VALUES (".sqlesc($fname).", '".$CURUSER['id']."', ".sqlesc($name).", ".sqlesc($descr).", '".$vip."', '".$inames[0]."', '".$inames[1]."', '".$catid."', '" . get_date_time() . "', '".$infohash."', '".$torrentsize."', '".$filecounts."', ".sqlesc($fname).", '".$announce."', '".$external."', '".$nfo."', '".$langid."','$anon', '".get_date_time()."')");


to
$ret = SQL_Query_exec("INSERT INTO torrents (filename, owner, name, descr, vip, image1, image2, category, added, info_hash, size, numfiles, save_as, announce, external, nfo, torrentlang, anon, last_action) VALUES (".sqlesc($fname).", '".$CURUSER['id']."', ".sqlesc($name).", ".sqlesc($descr).", '".$vip."', '".$inames[0]."', '".$inames[1]."', '".$catid."', '" . get_date_time() . "', '".$infohash."', '".$torrentsize."', '".$filecount."', ".sqlesc($fname).", '".$announce."', '".$external."', '".$nfo."', '".$langid."','$anon', '".get_date_time()."')");
2019-10-12 00:23:21
a big thank you for your m-jay help but when I make this change I have this error code :rolleyes:


Error
     
Invalid ID.
Users online

No users online

Search



Statistics

    Torrents

  • Tracking: 3
  • Todays torrents: 0
  • Seeders: 0
  • Leechers: 0
  • Peers: 0
  • Downloaded: 89.96 GB
  • Uploaded: 9.86 GB

  • Members

  • We have: 838
  • New today: 0
  • Guest today: 9

  • Online

  • Total online: 9
  • Members: 0
  • Guests online: 9
  • Comments: 3
  • Messages: 1,728