Bravo List

Bravo List (http://www.bvlist.com/index.php)
-   TBDev (http://www.bvlist.com/forumdisplay.php?f=20)
-   -   Bonus points for uploader (http://www.bvlist.com/showthread.php?t=11874)

elvira 30th November 2018 13:45

Bonus points for uploader
 
1 Attachment(s)
Here we go special thanks @dokty

SQL add

PHP Code:

DROP TABLE IF EXISTS `coins`;
CREATE TABLE `coins` (
  `
idint(10unsigned NOT NULL auto_increment,
  `
useridint(10unsigned NOT NULL default '0',
  `
torrentidint(10unsigned NOT NULL default '0',
  `
pointsint(10unsigned NOT NULL default '0',
  
PRIMARY KEY  (`id`)
TYPE=MyISAM


and this


PHP Code:

ALTER TABLE `torrentsADD `pointsint(10NOT NULL default '0' 

in detalis.php add


PHP Code:

torrents.points 

and this somewhere

PHP Code:

    $blasd sql_query("SELECT points FROM coins WHERE torrentid=".sqlesc($id)." AND userid=" .sqlesc($CURUSER["id"])) or sqlerr(__FILE____LINE__);
    
$sdsa mysql_fetch_assoc($blasd) or $sdsa["points"] = 0;
    
tr("Points""<b>In total " intval($row["points"]) . " Points given to this torrent of which " intval($sdsa["points"]) . " from you.By clicking on the coins you can give points to the uploader of this torrent.</b>
    <a href='
$BASEURL/coin.php?id=$id&points=10'>
    <img src='pic/10coin.jpg' alt='10 Points' title='10 Points' border='0' /></a>
    &nbsp;&nbsp;<a href='
$BASEURL/coin.php?id=$id&points=20'>
    <img src='pic/20coin.jpg' alt='20 Points' title='20 Points' border='0' /></a>
    &nbsp;&nbsp;<a href='
$BASEURL/coin.php?id=$id&points=50'>
    <img src='pic/50coin.jpg' alt='50 Points' title='50 Points' border='0' /></a>
    &nbsp;&nbsp;<a href='
$BASEURL/coin.php?id=$id&points=100'>
    <img src='pic/100coin.jpg' alt='100 Points' title='100 Points' border='0' /></a>
    &nbsp;&nbsp;<a href='
$BASEURL/coin.php?id=$id&points=200'>
    <img src='pic/200coin.gif' alt='200 Points' title='200 Points' border='0' /></a>
    &nbsp;&nbsp;<a href='
$BASEURL/coin.php?id=$id&points=500'>
    <img src='pic/500coin.gif' alt='500 Points' title='500 Points' border='0' /></a>
    &nbsp;&nbsp;<a href='
$BASEURL/coin.php?id=$id&points=1000'>
    <img src='pic/1000coin.gif' alt='1000 Points' title='1000 Points' border='0' /></a>"
1); 

now make a file called coin.php

PHP Code:

<?php
require_once("include/bittorrent.php");
gzip();
$action $_GET["action"];
dbconn(false);
loggedinorreturn();
maxsysop ();
parked();

// / Mod by dokty - tbdev.net

$id     intval($_GET["id"]);
$points intval($_GET["points"]);
if (!
is_valid_id($id) || !is_valid_id($points))
    die();

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

$sdsa sql_query("SELECT 1 FROM coins WHERE torrentid=" sqlesc($id) . " AND userid =" sqlesc($CURUSER["id"])) or sqlerr(__FILE____LINE__);
$asdd mysql_fetch_array($sdsa);
if (
$asdd)
    
stderr("Error""You already gave points to this torrent.");

$res sql_query("SELECT owner,name FROM torrents WHERE id = " sqlesc($id)) or sqlerr(__FILE____LINE__);
$row mysql_fetch_assoc($res) or stderr("Error""Torrent was not found");
$userid intval($row["owner"]);

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

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

sql_query("INSERT INTO coins (userid, torrentid, points) VALUES (" sqlesc($CURUSER["id"]) . ", " sqlesc($id) . ", " sqlesc($points) . ")") or sqlerr(__FILE____LINE__);
sql_query("UPDATE users SET seedbonus=seedbonus+" sqlesc($points) . " WHERE id=" sqlesc($userid)) or sqlerr(__FILE____LINE__);
sql_query("UPDATE users SET seedbonus=seedbonus-" sqlesc($points) . " WHERE id=" sqlesc($CURUSER["id"])) or sqlerr(__FILE____LINE__);
sql_query("UPDATE torrents SET points=points+" sqlesc($points) . " WHERE id=" sqlesc($id)) or sqlerr(__FILE____LINE__);
$msg sqlesc("You have been given " $points " points by " $CURUSER["username"] . " for torrent [url=$BASEURL/details.php?id=" $id "]" htmlspecialchars($row["name"]) . "[/url].");
sql_query("INSERT INTO messages (sender, receiver, msg, added, subject) VALUES(0, " sqlesc($userid) . ", $msg, " sqlesc(time()) . ", 'You have been given a gift')") or sqlerr(__FILE____LINE__);
stderr("Done""Successfully gave points to this torrent.");

?>


Napon 30th November 2018 14:20

Now is this for 09 if it is you need to change alot in it lol
As this only works on the 08

elvira 30th November 2018 16:10

its for 08

guldhammer 30th May 2019 22:05

Quote:

in detalis.php add


PHP Code:
, torrents.points
Add it WHERE in details.php??

elvira 30th May 2019 23:33

where start line

Quote:

$res = sql_query("SELECT torrents.seeders,

Napon 30th May 2019 23:35

At the top of detalis.php add where the big sql_query is

, torrents.points


Code:

$blasd = sql_query("SELECT points FROM coins WHERE torrentid=".sqlesc($id)." AND userid=" .sqlesc($CURUSER["id"])) or sqlerr(__FILE__, __LINE__);    $sdsa = mysql_fetch_assoc($blasd) or $sdsa["points"] = 0;    tr("Points", "In total " . intval($row["points"]) . " Points given to this torrent of which " . intval($sdsa["points"]) . " from you.By clicking on the coins you can give points to the uploader of this torrent.        10 Points          20 Points          50 Points          100 Points          200 Points          500 Points          1000 Points", 1);

guldhammer 1st June 2019 22:58

and where to put this??
Quote:

$blasd = sql_query("SELECT points FROM coins WHERE torrentid=".sqlesc($id)." AND userid=" .sqlesc($CURUSER["id"])) or sqlerr(__FILE__, __LINE__);
$sdsa = mysql_fetch_assoc($blasd) or $sdsa["points"] = 0;
tr("Points", "In total " . intval($row["points"]) . " Points given to this torrent of which " . intval($sdsa["points"]) . " from you.

By clicking on the coins you can give points to the uploader of this torrent.




10 Points

  
20 Points

  
50 Points

  
100 Points

  
200 Points

  
500 Points

  
1000 Points
", 1);

Stortebeker 7th July 2019 01:13

Quote:

Originally Posted by guldhammer (Post 53802)
and where to put this??

tr("Downloads as", $row["save_as"]);

Under this will be directly after download.


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

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