Hi all!
This here an 100% release!!!!!
Mysql:
DROP TABLE IF EXISTS `bonus`;
CREATE TABLE `bonus` (
`id` int(5) NOT NULL auto_increment,
`bonusname` varchar(50) NOT NULL default '',
`points` decimal(4,1) NOT NULL default '000.0',
`description` text NOT NULL,
`art` varchar(10) NOT NULL default 'traffic',
`menge` bigint(20) unsigned NOT NULL default '0',
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=11;
INSERT INTO `bonus` VALUES (1, '1.0GB Uploaded', 75.0, 'If you reach the points for this case, you can exchange these points on the fly into traffic, we take off the points and you receive the traffic.', 'traffic', 1073741824);
INSERT INTO `bonus` VALUES (2, '2.5GB Uploaded', 150.0, 'If you reach the points for this case, you can exchange these points on the fly into traffic, we take off the points and you receive the traffic.', 'traffic', 2684354560);
INSERT INTO `bonus` VALUES (3, '5GB Uploaded', 250.0, 'If you reach the points for this case, you can exchange these points on the fly into traffic, we take off the points and you receive the traffic.', 'traffic', 5368709120);
INSERT INTO `bonus` VALUES (7, '3 Invites', 20.0, 'Trade your points in for invites to the site.', 'invite', 3);
INSERT INTO `bonus` VALUES (6, '1 Invite', 10.0, 'Trade your points in for invites to the site.', 'invite', 3);
INSERT INTO `bonus` VALUES (8, '10 Invites', 50.0, 'Trade your points in for invites to the site.', 'invite', 3);
INSERT INTO `bonus` VALUES (9, '15 Invites', 75.0, 'Trade your points in for invites to the site.', 'invite', 3);
INSERT INTO `bonus` VALUES (10, '25 Invites', 100.0, 'Trade your points in for invites to the site.', 'invite', 3);
INSERT INTO `bonus` VALUES (4, '10GB Uploaded', 400.0, 'If you reach the points for this case, you can exchange these points on the fly into traffic, we take off the points and you receive the traffic.', 'traffic', 10737418240);
INSERT INTO `bonus` VALUES (5, '25GB Uploaded', 1000.0, 'If you reach the points for this case, you can exchange these points on the fly into traffic, we take off the points and you receive the traffic.', 'traffic', 26843545600);
Find in cleanup.php:
/// edited and adapted by MasterRoot
/// www.maniatorrent.org
/////////////////////////////////////////////////////
$res = mysql_query("SELECT DISTINCT userid FROM peers WHERE seeder = 'yes'") or sqlerr(__FILE__, __LINE__);
if (mysql_num_rows($res) > 0)
{
while ($arr = mysql_fetch_assoc($res))
{
$work = mysql_query("select count(*) from peers WHERE seeder ='yes' AND userid = $arr[userid]");
$row_count = mysql_result($work,0,"count(*)");
$speedu = mysql_query("SELECT sum(((p.uploaded - p.uploadoffset )) / (unix_timestamp(p.last_action) - unix_timestamp(p.started))) AS speed FROM peers p INNER JOIN users u ON p.userid=u.id WHERE u.id=$arr[userid]");
if($speeduu > "100.00")
$bonuspay="0.750"; //// if over 100kbs = 3 per hr
elseif($speeduu > "75.00")
$bonuspay="0.500"; //// if over 75 but less than 100 = 2.0 per hr
elseif($speeduu > "50.00")
$bonuspay="0.375"; //// if over 50kbs but under 75kbs = 1.5 per hr
elseif($speeduu > "30.00")
$bonuspay="0.250"; /// if over 30kbs but under 50 kbs = 1.0 an hr
elseif($speeduu > "15.00")
$bonuspay="0.1875"; //// if over 15 kbs but less than 30kbs = .75 per hr
elseif($speeduu > "1.00")
$bonuspay="0.125"; //// if over 1kbs but less than 15kbs = .5 per hr
elseif($speeduu < "1.00")
$bonuspay="0.0225"; //// less than kb/s = 1/4 per hr
mysql_query("UPDATE users SET seedbonus = seedbonus+$bonuspay*$row_count WHERE id = $arr[userid]") or sqlerr(__FILE__, __LINE__);
}
}
/////////End Update Seederbonus by speed/////////
/// MOD from TBDEV - dottor
/// edited and adapted by MasterRoot
/// www.maniatorrent.org
/////////////////////////////////////////////////////
Create mybonus.php:
// Bonus Mod by TvRecall.org
// Bonus Mod Updated by devin
// Version 0.3
// Updated 01/05/2006
// under GPL-License
///////////////////////////////////////////////////////
require_once('backend/functions.php');
dbconn(false);
loggedinonly();
if ($action == "exchange") {
$userid = $CURUSER["id"];
$option = (int)$_POST["option"];
$art = $_POST["art"];
$modcomment = $CURUSER['modcomment'];
$upload = $CURUSER['uploaded'];
$res = mysql_query("SELECT * FROM bonus WHERE id='$option'");
$row = mysql_fetch_assoc($res);
if (!$row)
show_error_msg("Error", "Invalid request.", 1);
$up = $row['menge'];
$invites = $CURUSER['invites'];
$inv = $row['menge'];
$points = $row['points'];
if($CURUSER['seedbonus'] >= $points) {
if($art == "traffic") {
$modcomment = gmdate("Y-m-d") . " - User has traded " .$points. " Points for traffic.\n " .$modcomment;
mysql_query("UPDATE users SET uploaded = uploaded+$up, seedbonus = seedbonus-$points, modcomment = '$modcomment' WHERE id = '$userid'") or die(mysql_error());
show_error_msg("Success", "Account updated.");
} elseif($art == "invite") {
$modcomment = gmdate("Y-m-d") . " - User has traded " .$points. " Points for invites.\n " .$modcomment;
mysql_query("UPDATE users SET modcomment = '$modcomment', invites = invites+$inv, seedbonus = seedbonus-$points WHERE id = '$userid'") or die(mysql_error());
show_error_msg("Success", "Account updated.");
}
else {
show_error_msg("Error", "No valid type");
}
} else {
show_error_msg("Error", "Not enough points to trade...");
}
}
stdhead($CURUSER['username'] . "'s Bonus");
$bonus = $CURUSER['seedbonus'];
$userid = $CURUSER['id'];
begin_frame("Seeder Bonus Exchange");
print("<table align=center width=600 border=\"1\" cellspacing=\"0\" cellpadding=\"5\">\n");
Print("<tr><td class=tabletitle width=600>Seeder Bonus</td></tr></table>");
print("<table class=tableb align=center width=600 border=\"1\" cellspacing=\"0\" cellpadding=\"5\">\n");
?>
<tr><td align=center>Here you can exchange your Seeder-Bonus (currently: <?echo "$bonus";?>).
<br>
(If the button's deactivated, you do not have enough to trade.)
<br>
<?php
print("<table border=1 cellspacing=0 cellpadding=5 width=500><tr>".
"<td class=tabletitle align=left>Option</td>".
"<td class=tabletitle align=left>What's this about?</td>".
"<td class=tabletitle align=left>Points</td>".
"<td class=tabletitle align=left>Trade</td>".
"</tr>");
$res = mysql_query("SELECT * from bonus order by id");
while ($gets = mysql_fetch_assoc($res))
{
print("<tr class=tableb><td>".$gets["id"]."</td><td align='left'><b>".$gets["bonusname"]."</b><br>".$gets["description"]."</td><td align='right'>".$gets["points"]."</td>");
print("<form action=mybonus.php?action=exchange method=post>\n");
print("<input type=\"hidden\" name=\"option\" value=\"".$gets["id"]."\">\n");
print("<input type=\"hidden\" name=\"art\" value=\"".$gets["art"]."\">\n");
if($bonus >= $gets["points"]) {
print("<td><input type=submit name=submit value=\"Exchange!\"></td></form>");
} else {
print("<td><input type=submit name=submit value=\"Exchange!\" disabled></td></form>");
}
}
print("</table><br><br><br>");
?>
<blockquote><p align=left><b>How do I get points?</b><br>
You receive 0.5 points for every hour the system registers you as being a seeder.
</p></blockquote>
</td></tr>
<tr><td><a href=account.php>Back to your profile</a></td></tr>
</table>
<?php
end_frame();
stdfoot();
?>
blocks/login_block.php
After
EnjoY!
wolfnet
This here an 100% release!!!!!
Mysql:
ALTER TABLE `users` ADD `seedbonus` DECIMAL( 10, 1 ) NOT NULL;DROP TABLE IF EXISTS `bonus`;
CREATE TABLE `bonus` (
`id` int(5) NOT NULL auto_increment,
`bonusname` varchar(50) NOT NULL default '',
`points` decimal(4,1) NOT NULL default '000.0',
`description` text NOT NULL,
`art` varchar(10) NOT NULL default 'traffic',
`menge` bigint(20) unsigned NOT NULL default '0',
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=11;
INSERT INTO `bonus` VALUES (1, '1.0GB Uploaded', 75.0, 'If you reach the points for this case, you can exchange these points on the fly into traffic, we take off the points and you receive the traffic.', 'traffic', 1073741824);
INSERT INTO `bonus` VALUES (2, '2.5GB Uploaded', 150.0, 'If you reach the points for this case, you can exchange these points on the fly into traffic, we take off the points and you receive the traffic.', 'traffic', 2684354560);
INSERT INTO `bonus` VALUES (3, '5GB Uploaded', 250.0, 'If you reach the points for this case, you can exchange these points on the fly into traffic, we take off the points and you receive the traffic.', 'traffic', 5368709120);
INSERT INTO `bonus` VALUES (7, '3 Invites', 20.0, 'Trade your points in for invites to the site.', 'invite', 3);
INSERT INTO `bonus` VALUES (6, '1 Invite', 10.0, 'Trade your points in for invites to the site.', 'invite', 3);
INSERT INTO `bonus` VALUES (8, '10 Invites', 50.0, 'Trade your points in for invites to the site.', 'invite', 3);
INSERT INTO `bonus` VALUES (9, '15 Invites', 75.0, 'Trade your points in for invites to the site.', 'invite', 3);
INSERT INTO `bonus` VALUES (10, '25 Invites', 100.0, 'Trade your points in for invites to the site.', 'invite', 3);
INSERT INTO `bonus` VALUES (4, '10GB Uploaded', 400.0, 'If you reach the points for this case, you can exchange these points on the fly into traffic, we take off the points and you receive the traffic.', 'traffic', 10737418240);
INSERT INTO `bonus` VALUES (5, '25GB Uploaded', 1000.0, 'If you reach the points for this case, you can exchange these points on the fly into traffic, we take off the points and you receive the traffic.', 'traffic', 26843545600);
Find in cleanup.php:
/////////Update Seederbonus by speed//////////// MOD from TBDEV - dottor/// edited and adapted by MasterRoot
/// www.maniatorrent.org
/////////////////////////////////////////////////////
$res = mysql_query("SELECT DISTINCT userid FROM peers WHERE seeder = 'yes'") or sqlerr(__FILE__, __LINE__);
if (mysql_num_rows($res) > 0)
{
while ($arr = mysql_fetch_assoc($res))
{
$work = mysql_query("select count(*) from peers WHERE seeder ='yes' AND userid = $arr[userid]");
$row_count = mysql_result($work,0,"count(*)");
$speedu = mysql_query("SELECT sum(((p.uploaded - p.uploadoffset )) / (unix_timestamp(p.last_action) - unix_timestamp(p.started))) AS speed FROM peers p INNER JOIN users u ON p.userid=u.id WHERE u.id=$arr[userid]");
if($speeduu > "100.00")
$bonuspay="0.750"; //// if over 100kbs = 3 per hr
elseif($speeduu > "75.00")
$bonuspay="0.500"; //// if over 75 but less than 100 = 2.0 per hr
elseif($speeduu > "50.00")
$bonuspay="0.375"; //// if over 50kbs but under 75kbs = 1.5 per hr
elseif($speeduu > "30.00")
$bonuspay="0.250"; /// if over 30kbs but under 50 kbs = 1.0 an hr
elseif($speeduu > "15.00")
$bonuspay="0.1875"; //// if over 15 kbs but less than 30kbs = .75 per hr
elseif($speeduu > "1.00")
$bonuspay="0.125"; //// if over 1kbs but less than 15kbs = .5 per hr
elseif($speeduu < "1.00")
$bonuspay="0.0225"; //// less than kb/s = 1/4 per hr
mysql_query("UPDATE users SET seedbonus = seedbonus+$bonuspay*$row_count WHERE id = $arr[userid]") or sqlerr(__FILE__, __LINE__);
}
}
/////////End Update Seederbonus by speed/////////
/// MOD from TBDEV - dottor
/// edited and adapted by MasterRoot
/// www.maniatorrent.org
/////////////////////////////////////////////////////
Create mybonus.php:
<?php////////////////////////////////////////////////////////// Bonus Mod by TvRecall.org
// Bonus Mod Updated by devin
// Version 0.3
// Updated 01/05/2006
// under GPL-License
///////////////////////////////////////////////////////
require_once('backend/functions.php');
dbconn(false);
loggedinonly();
if ($action == "exchange") {
$userid = $CURUSER["id"];
$option = (int)$_POST["option"];
$art = $_POST["art"];
$modcomment = $CURUSER['modcomment'];
$upload = $CURUSER['uploaded'];
$res = mysql_query("SELECT * FROM bonus WHERE id='$option'");
$row = mysql_fetch_assoc($res);
if (!$row)
show_error_msg("Error", "Invalid request.", 1);
$up = $row['menge'];
$invites = $CURUSER['invites'];
$inv = $row['menge'];
$points = $row['points'];
if($CURUSER['seedbonus'] >= $points) {
if($art == "traffic") {
$modcomment = gmdate("Y-m-d") . " - User has traded " .$points. " Points for traffic.\n " .$modcomment;
mysql_query("UPDATE users SET uploaded = uploaded+$up, seedbonus = seedbonus-$points, modcomment = '$modcomment' WHERE id = '$userid'") or die(mysql_error());
show_error_msg("Success", "Account updated.");
} elseif($art == "invite") {
$modcomment = gmdate("Y-m-d") . " - User has traded " .$points. " Points for invites.\n " .$modcomment;
mysql_query("UPDATE users SET modcomment = '$modcomment', invites = invites+$inv, seedbonus = seedbonus-$points WHERE id = '$userid'") or die(mysql_error());
show_error_msg("Success", "Account updated.");
}
else {
show_error_msg("Error", "No valid type");
}
} else {
show_error_msg("Error", "Not enough points to trade...");
}
}
stdhead($CURUSER['username'] . "'s Bonus");
$bonus = $CURUSER['seedbonus'];
$userid = $CURUSER['id'];
begin_frame("Seeder Bonus Exchange");
print("<table align=center width=600 border=\"1\" cellspacing=\"0\" cellpadding=\"5\">\n");
Print("<tr><td class=tabletitle width=600>Seeder Bonus</td></tr></table>");
print("<table class=tableb align=center width=600 border=\"1\" cellspacing=\"0\" cellpadding=\"5\">\n");
?>
<tr><td align=center>Here you can exchange your Seeder-Bonus (currently: <?echo "$bonus";?>).
<br>
(If the button's deactivated, you do not have enough to trade.)
<br>
<?php
print("<table border=1 cellspacing=0 cellpadding=5 width=500><tr>".
"<td class=tabletitle align=left>Option</td>".
"<td class=tabletitle align=left>What's this about?</td>".
"<td class=tabletitle align=left>Points</td>".
"<td class=tabletitle align=left>Trade</td>".
"</tr>");
$res = mysql_query("SELECT * from bonus order by id");
while ($gets = mysql_fetch_assoc($res))
{
print("<tr class=tableb><td>".$gets["id"]."</td><td align='left'><b>".$gets["bonusname"]."</b><br>".$gets["description"]."</td><td align='right'>".$gets["points"]."</td>");
print("<form action=mybonus.php?action=exchange method=post>\n");
print("<input type=\"hidden\" name=\"option\" value=\"".$gets["id"]."\">\n");
print("<input type=\"hidden\" name=\"art\" value=\"".$gets["art"]."\">\n");
if($bonus >= $gets["points"]) {
print("<td><input type=submit name=submit value=\"Exchange!\"></td></form>");
} else {
print("<td><input type=submit name=submit value=\"Exchange!\" disabled></td></form>");
}
}
print("</table><br><br><br>");
?>
<blockquote><p align=left><b>How do I get points?</b><br>
You receive 0.5 points for every hour the system registers you as being a seeder.
</p></blockquote>
</td></tr>
<tr><td><a href=account.php>Back to your profile</a></td></tr>
</table>
<?php
end_frame();
stdfoot();
?>
blocks/login_block.php
After
$privacylevel = $CURUSER["privacy"];Add$seedbonus = $CURUSER["seedbonus"];print ("<center><img width=80 height=80 src=$avatar></center><br>" . DOWNLOADED . ": $userdownloaded<br>" . UPLOADED . ": $useruploaded<BR>" . ACCOUNT_PRIVACY_LV . ": $privacylevel<BR>". RATIO .": $userratio");
Replace with
print ("<center><img width=80 height=80 src=$avatar></center><br>" . DOWNLOADED . ": $userdownloaded<br>" . UPLOADED . ": $useruploaded<BR>" . ACCOUNT_PRIVACY_LV . ": $privacylevel<BR>". RATIO .": $userratio<BR>Seeding Bonus: <a href='mybonus.php'>$seedbonus</a>");
Find in account.php:
<?print("<a href=account.php?action=mytorrents><b>My Torrents</b></a>");?>
|
ADD after:
<?print("<a href=mybonus.php><b>Seeding Bonus</b></a>");?>
|EnjoY!
wolfnet