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
[MOD] Points GB for the Uploader [TTv3]
Controls ·  Search New posts · Mark unread

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

2019-07-12 13:27:44
Hi

Credit reviens a war02
Update : spiritblue and the community
SQL: Yes
Important to know : You need to install before the Seed Bonus mod [TTv3] here

mod allows to give seedbonus points to upload for encouragement of the good work done.

*Always make a backup before making the change.

SQL:

ALTER TABLE `torrents` ADD `points` INT( 10 ) NOT NULL default '0';
CREATE TABLE `coins` (
`id` int(10) unsigned NOT NULL auto_increment,
`userid` int(10) unsigned NOT NULL default '0',
`torrentid` int(10) unsigned NOT NULL default '0',
`points` int(10) unsigned NOT NULL default '0',
PRIMARY KEY (`id`)
) ;


Create a file named corners.php :

<?php
require "backend/functions.php";
dbconn();
loggedinonly();

$id = 0 + $_GET["id"];
$points = 0 + $_GET["points"];
if (!is_valid_id($id) || !is_valid_id($points))
die();

$pointscangive = array("10","20","50","100");
if (!in_array($points, $pointscangive))
stderr("Error","You can't give that amount of points!!!");

$sdsa = SQL_Query_exec("SELECT 1 FROM coins WHERE torrentid=".sqlesc($id)." AND userid =" .sqlesc($CURUSER["id"]));
$asdd = mysqli_fetch_array($sdsa);
if ($asdd)
show_error_msg("Error","You already gave points to this torrent.");

$res = SQL_Query_exec("SELECT owner FROM torrents WHERE id = ".sqlesc($id));
$row = mysqli_fetch_assoc($res) or stderr("Error","Torrent was not found");
$userid = $row["owner"];

if ($userid == $CURUSER["id"])
show_error_msg("Error","You can't give your self points!");

if ($CURUSER["seedbonus"] < $points)
show_error_msg("Error","You dont have enough points");

SQL_Query_exec("INSERT INTO coins (userid, torrentid, points) VALUES (".sqlesc($CURUSER["id"]).", ".sqlesc($id).", ".sqlesc($points).")");
SQL_Query_exec("UPDATE users SET seedbonus=seedbonus+".$points." WHERE id=".sqlesc($userid));
SQL_Query_exec("UPDATE users SET seedbonus=seedbonus-".$points." WHERE id=".sqlesc($CURUSER["id"]));
SQL_Query_exec("UPDATE torrents SET points=points+".$points." WHERE id=".sqlesc($id));


header("Refresh: 3;url=torrents-details.php?id=$id");
show_error_msg("Success", "Successfully gave points to this torrent.<br/>Redirection...", 1);
?>


In torrents-details.php add or you like it :

// Add points to torrent
$blasd = SQL_Query_exec("SELECT points FROM coins WHERE torrentid=$id AND userid=".$CURUSER["id"]);
$sdsa = mysqli_fetch_assoc($blasd) or $sdsa["points"] = 0;
tr("Points: ","<b>In total ".$row["points"]." Points given to this torrent of which ".$sdsa["points"]." from you.
By clicking on the coins you can give points to the uploader of this torrent.</b>
<a href=coins.php?id=$id&points=10><img src=images/point/10points.png border=0></a>  <a href=coins.php?id=$id&points=20><img src=images/point/20points.png border=0></a>  <a href=coins.php?id=$id&points=50><img src=images/point/50points.png border=0></a>  <a href=coins.php?id=$id&points=100><img src=images/point/100points.png border=0></a>", 1);
// End Add points to torrent


Search :
torrents.filename,


Add after :
torrents.points,


In functions.php find :
SQL_Query_exec("DELETE FROM torrents WHERE id = $id"); 


Add after :
SQL_Query_exec("DELETE FROM coins WHERE torrentid = $id");



~ Add the file corners.php to the root of the site
~ In folder images you will create a folder of the point name and add the images inside
img.zip
Download
Capture.qq.PNG
Capture.qq.PNG

Last edited by spiritblue on 2022-01-19 22:19:12
2020-04-01 16:24:53
Hello it doesn't work when you click on the pieces you get a blank page with this...  >>>>   File not found.

Bonjour ça ne marche pas quand vous cliquez sur les pièces vous obtenez une page blanche avec ce...   >>>>   File not found.
2020-04-01 17:15:08
thank you and everything's working fine now :p
2020-04-01 19:10:22
"niki, post: 68271, member: 20338":

thank you and everything's working fine now :p

cool !, what was your mistake? ¿
2022-01-19 21:24:56
thank you  works very very cool🥰
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