Bravo List
Register
Go Back   > Bravo List > Source Code > Archived Trackers > Torrent Strike > Mods & Themes
Reply
  #1  
Old 14th April 2011, 01:17
nicukent's Avatar
nicukent nicukent is offline
Senior Member
 
Join Date: Sep 2009
P2P
Posts: 40
Smile Seedbonus, New Version
Here is what I use use both the sql table and the mybonus.php
It has been fixed for any cheats I could find.

Mine is modified and fixed. You will need to change some of it for your site.
I increased the number of bonus points that can be cached in.
Also at the bottom where is says what they can get points for and amounts will need to be changed for your site.
-------------------------------------------------------------------------
Sql:

PHP Code:
--
    -- 
Table structure for table `bonus`
    --

    
CREATE TABLE IF NOT EXISTS `bonus` (
      `
idint(5NOT NULL auto_increment,
      `
bonusnamevarchar(50NOT NULL default '',
      `
pointsdecimal(8,1NOT NULL default '0.0',
      `
descriptiontext NOT NULL,
      `
artvarchar(10NOT NULL default 'traffic',
      `
mengebigint(20unsigned NOT NULL default '0',
      
PRIMARY KEY  (`id`)
    ) 
ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=11;

    --
    -- 
Dumping data for table `bonus`
    --

    
INSERT INTO `bonus` (`id`, `bonusname`, `points`, `description`, `art`, `menge`) VALUES
     
(1'1.0GB Uploaded'50.0'With enough bonus points acquired, you  are able to exchange them for an Upload Credit. The points are then  removed from your Bonus Bank and the credit is added to your total  uploaded amount.''traffic'1073741824),
    (
2'2.5GB Uploaded',  100.0'With enough bonus points acquired, you are able to exchange them  for an Upload Credit. The points are then removed from your Bonus Bank  and the credit is added to your total uploaded amount.''traffic',  2684354560),
    (
3'5GB Uploaded'175.0'With enough bonus points  acquired, you are able to exchange them for an Upload Credit. The  points are then removed from your Bonus Bank and the credit is added to  your total uploaded amount.''traffic'5368709120),
    (
8'3  Invites'100.0'With enough bonus points acquired, you are able to  exchange them for a few invites. The points are then removed from your  Bonus Bank and the invitations are added to your invites amount.',  'invite'3),
    (
9'Custom Title!'50.0'For only 50.0 Karma  Bonus Points you can buy yourself a custom title. the only restrictions  are no foul or offensive language or userclass can be entered. The  points are then removed from your Bonus Bank and your special title is  changed to the title of your choice''title'1),
    (
4'10GB  Uploaded'300.0'With enough bonus points acquired, you are able to  exchange them for an Upload Credit. The points are then removed from  your Bonus Bank and the credit is added to your total uploaded amount.',  'traffic'10737418240),
    (
10'Give A Karma Gift'100.0'Well  perhaps you don''t need the upload credit, but you know somebody that  could use the Karma boost! You are now able to give your Karma credits  as  a gift! The points are then removed from your Bonus Bank and  added  to the account of a user of your choice!\r\n\r\nAnd they recieve a PM  with all the info as well as who it came from...''gift_1',  1073741824),
    (
5'25GB Uploaded'1000.0'With enough bonus  points acquired, you are able to exchange them for an Upload Credit. The  points are then removed from your Bonus Bank and the credit is added to  your total uploaded amount.''traffic'26843545600),
    (
6'50GB  Uploaded'1750.0'With enough bonus points acquired, you are able to  exchange them for an Upload Credit. The points are then removed from  your Bonus Bank and the credit is added to your total uploaded amount.',  'traffic'5368709120),
    (
7'100GB Uploaded'3000.0'With  enough bonus points acquired, you are able to exchange them for an  Upload Credit. The points are then removed from your Bonus Bank and the  credit is added to your total uploaded amount.''traffic',  107374182400); 

mybonus.php:

PHP Code:
<?php

    
/******************************************************
    Total credit to TvRecall for writing this fine mod in the first place,
    the mod has since been altered with code and input by:
    devinkray - cddvdheaven - DRRRR - vlahdr - sherl0k - okiee - lords - XiaNYdE
    dopeydwerg - WRK - Fantomax - porthos - dokty - Sir_SnuggleBunny - wicked
    *******************************************************/

    
require_once('include/bittorrent.php');
    
// disable any caching by the browser
    
header('Expires: Mon, 14 Oct 2002 05:00:00 GMT');              // Date in the past
    
header('Last-Modified: ' gmdate("D, d M Y H:i:s") . ' GMT'); // always modified
    
header('Cache-Control: no-store, no-cache, must-revalidate');  // HTTP 1.1
    
header('Cache-Control: post-check=0, pre-check=0'false);
    
header('Pragma: no-cache');                                    // HTTP 1.0

    
dbconn(false);

    
$action $_GET['action'];

    
loggedinorreturn();

    
stdhead($CURUSER['username'] . "'s Bonus Page");
    
begin_frame("$SITENAME Bonus Point system:");
    
$bonus htmlspecialchars($CURUSER['seedbonus'], 1);

    
$userid 0+$CURUSER['id'];

    if(
$bonus != htmlspecialchars($CURUSER['seedbonus'], 1)) {
    echo 
"bad idea...";
    die;
    }
    if (!
$action) {
    print(
"<table align=center width=100% border=\"0\" cellspacing=\"0\" cellpadding=\"5\">\n");
    
//Print("<tr><td class=main colspan=4 align=center><h1>$SITENAME Karma Bonus Point system:</h1></td></tr>\n");
    
?>
     <tr><td align=center colspan=4>Exchange your <a  class=altlink href=mybonus.php>Karma Bonus Points</a> [ current  <?echo "$bonus";?> ] for goodies!
    <br><br>
    [ If no buttons appear, you have not earned enough bonus points to trade. ]
    <br><br>
    <?
    $dt 
sqlesc(gmdate("M-d-Y"));
    echo
"$dt";
    print(
"<tr><td align=left>Option</td>".
    
"<td class=colhead align=left>Description</td>".
    
"<td class=colhead align=center>Points</td>".
    
"<td class=colhead align=center>Trade</td>".
    
"</tr>");

    
$res mysql_query("SELECT * from bonus WHERE id=id ORDER BY id ASC");

    while (
$gets mysql_fetch_assoc($res))
    {

     
$otheroption "<table width=100%><tr><td  class=$class><b>Username:</b><input type=text  name=username size=20 maxlength=24></td><td class=$class>  <b>to be given: </b><select name=bonusgift>  <option value=100.0> 100.0</option> <option  value=200.0> 200.0</option> <option value=300.0>  300.0</option> <option value=400.0>  400.0</option><option value=500.0>  500.0</option></select> Karma  points!</td></tr></table>";
    
$otheroption_title "<input type=text name=title size=30 maxlength=30>";

    
//if($CURUSER['seedbonus'] <= 90000.0) {
    
print("<form action=mybonus.php?action=exchange method=post>\n");
    if (
$gets["id"]==9)
     print(
"<tr><td class=$class  align=center><b>".$gets["id"]."</b></td><td  align='left'  class=$class><h1>".$gets["bonusname"]."</h1>".$gets["description"]."<br><br>Enter  the <b>Special Title</b> you would like to have  $otheroption_title click Exchange! </td><td align='center'  class=$class>".$gets["points"]."</td>");
    else
    if (
$gets["id"]==10)
     print(
"<tr><td class=$class  align=center><b>".$gets["id"]."</b></td><td  align='left'  class=$class><h1>".$gets["bonusname"]."</h1>".$gets["description"]."<br><br>Enter  the <b>username</b> of the person you would like to send  karma to, and select how many points you want to send and click  Exchange!<br>$otheroption</td><td align='center'  class=$class>min.<br>".$gets["points"]."<br>max.<br>500</td>");
    else
     print(
"<tr><td class=$class  align=center><b>".$gets["id"]."</b></td><td  align='left'  class=$class><h1>".$gets["bonusname"]."</h1>".$gets["description"]."</td><td  align='center' class=$class>".$gets["points"]."</td>");

    print(
"<input type=\"hidden\" name=\"bonus\" value=\"".$bonus."\">\n");
    print(
"<input type=\"hidden\" name=\"userid\" value=\"".$userid."\">\n");
    print(
"<input type=\"hidden\" name=\"points\" value=\"".$gets["points"]."\">\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"]) {
    if (
$gets["id"]==10)
     print(
"<td class=$class><input class=button type=submit  name=submit value=\"Karma Gift!\"></form></td>");
    else
     print(
"<td class=$class><input class=button type=submit  name=submit value=\"Exchange!\"></form></td>");
    } else {
    print(
"<td class=$class align=center><b>more points needed</b></form></td>");
    }
    
//}
    
}
    
/*
    if($CURUSER['seedbonus'] > 90000.0) {
    print("<form action=mybonus.php?action=exchange method=post>\n");
    print("<input type=\"hidden\" name=\"bonus\" value=\"".$bonus."\">\n");
    print("<input type=\"hidden\" name=\"userid\" value=\"".$userid."\">\n");
    print("<input type=\"hidden\" name=\"points\" value=\"".$gets["points"]."\">\n");
    print("<input type=\"hidden\" name=\"option\" value=\"".$gets["id"]."\">\n");
    print("<input type=\"hidden\" name=\"art\" value=\"gift_1\">\n");
     print("<tr><td class=$class align=center><img  src=pic/smilies/karma.gif alt=good_karma></td><td  align='left' class=$class><b>Wow! That's a lot of Karma  Points!!!</b><br>your only option now is to share the love!  <img src=pic/smilies/friends.gif alt=\"smilie\"><br>With a  Karma rating of over 1000.0 you can not use the regular trade options...  in fact, you must share the love if you want to do anything at  all!<br><br>Use this option to send another user some Karma  points... Select how many points you want to send and click  <b>Karma Gift!</b><br>$otheroption</td><td  align='center'  class=$class>100<br>to<br>500</td>");
     print("<td class=$class valign=bottom><input class=button  type=submit name=submit value=\"Karma  Gift!\"></form></td>");
    }
    */
    
print("</table><br><br><br>");
    
end_frame();
    
begin_frame();
    
?>

    <table width=100%>
     <tr><td class=colhead><h1>What the hell are these  Karma Bonus points, and how do I get  them?</h1></td></tr>
    <tr><td>
    For every hour that you seed a torrent, you are awarded with 2.5 Karma Bonus Points... <br>
    If you save up enough of them, you can trade them in for goodies like bonus GB(s) to your upload<br> stats,
    getting more invites, or doing the real Karma booster... give them to another user!<br>
    and yes! this is awarded on a per torrent basis even if there are no leechers on the Torrent you are seeding! <br>
    <h1>Other things that will get you karma points:</h1>
    <ul>
    <li>uploading a new torrent = 15 points</li>
    <li>filling a request = 10 points</li>
    <li>filling a re-seed request = 5 points</li>
    <li>comment on torrent = 3 points</li>
    <li>making a post = 3 point</li>
    <li>starting a topic = 3 points</li>
    <li>idling in irc = 2 points per hour</li>
    <li>saying thanks = 2 points</li>
    <li>voting on poll = 1 point</li>

    </ul>
    <h1>Some things that will cost you karma points:</h1>
    <ul>
    <li>trading for invites</li>
    <li>trading for upload credit</li>
    <li>trading for a custom title</li>
    <li>giving a gift of karma points to another user</li>
    <li>asking for a re-seed</li>
    <li>making a request</li>
    <li>deleting a post</li>
    <li>deleteing torrent comment</li>
    </ul>
    <p>But keep in mind that everything that can get you can also be lost, <br>
    ie:if you up a torrent then delete it, you will gain and then lose 10 points, <br>
    making a post and having it deleted will do the same
    <br><br>
    ... and there are other hidden bonus points all over the site.<br><br>
    Yet another way to help out your ratio! </p>

    <p>*please note, staff can give or take away points for breaking the rules, or doing good for the community.</p>
    </td></tr></table>
    <p align="center"><a class=altlink href=my.php>back to your profile</a></p>
    <?
    
}
    if (
$action == "exchange") {

    
$userid $_POST["userid"];
    
$option $_POST["option"];
    
$points $_POST["points"];
    
$bonus $_POST["bonus"];
    
$art $_POST["art"];
    
//===custom title
    
$title htmlentities($_POST["title"]);
    
$title sqlesc($title);
    
//==gift for peeps with no more options
    
$usernamegift $_POST["username"];
    
$res mysql_query("SELECT id,seedbonus FROM users WHERE username=" sqlesc($usernamegift));
    
$arr mysql_fetch_assoc($res);
    
$useridgift $arr['id'];
    
$userseedbonus $arr['seedbonus'];
    
$usernamegift sqlesc($usernamegift);
    
$seedbonus=htmlspecialchars($bonus-$points,1);

    
$bonuscomment $CURUSER['bonuscomment'];
    
$upload $CURUSER['uploaded'];
    
$bpoints $CURUSER['seedbonus'];
    
$res mysql_query("SELECT * FROM bonus WHERE id='$option'");
    
$bytes mysql_fetch_assoc($res);
    
$invites $CURUSER['invites'];
    
$inv $invites+$bytes['menge'];

    if(
$bpoints >= $points) {
    
//=== trade for upload
    
if($art == "traffic") {
    
$bonus$CURUSER['seedbonus'];
    if(
$bonus $points){
    die;
    }
    
$up $upload $bytes['menge'];
    
$bonuscomment gmdate("Y-m-d") . " - " .$points" Points for upload bonus.\n " .$bonuscomment;
     
mysql_query("UPDATE users SET uploaded = $upload + $bytes[menge],  seedbonus = '$seedbonus', bonuscomment = '$bonuscomment' WHERE id =  '$userid'") or sqlerr(__FILE____LINE__);
    print(
"<table  width=100%><tr><td class=colhead align=left  colspan=2><h1>Success!</h1></td></tr>");
     print(
"<tr><td align=left><img  src=pic/smilies/karma.gif alt=good_karma></td><td  align=left><b>Congratulations! </b>$CURUSER[username] you  have just increased your upload amount! <img  src=pic/smilies/w00t.gif  alt=\"w00t\"><br><br><br><br> click to go  back to your <a class=altlink href=mybonus.php>Bonus  Points</a>  page.<br><br></td></tr></table>");
    }
    
/*
    //=== trade for one month VIP status ***note "SET class = '3'" change "3" to whatever your VIP class number is
    elseif($art == "class") {
    $vip_until = get_date_time(gmtime() + 28*86400);
    $bonuscomment = gmdate("Y-m-d") . " - " .$points. " Points for 1 month VIP Status.\n " .$bonuscomment;
     mysql_query("UPDATE users SET class = '3', vip_added = 'yes',  vip_until = '$vip_until', seedbonus = '$seedbonus' WHERE id =  '$userid'") or sqlerr(__FILE__, __LINE__);
    print("<table  width=100%><tr><td class=colhead align=left  colspan=2><h1>Success!</h1></td></tr>");
     print("<tr><td align=left><img  src=pic/smilies/karma.gif alt=good_karma></td><td  align=left><b>Congratulations! </b>$CURUSER[username] you  have got yourself VIP Status for one month! <img  src=pic/smilies/w00t.gif alt=\"w00t\"><br><br> Click to  go back to your <a class=altlink href=mybonus.php>Karma  Points</a>  page.<br><br></td></tr></table>");
    }
    */
    //=== trade for invites
    
elseif($art == "invite") {
    
$bonuscomment gmdate("Y-m-d") . " - " .$points" Points for invites.\n " .$bonuscomment;
     
mysql_query("UPDATE users SET invites = '$inv', seedbonus =  '$seedbonus' WHERE id = '$userid'") or sqlerr(__FILE____LINE__);
     print(
"<table width=100%><tr><td class=colhead  align=left  colspan=2><h1>Success!</h1></td></tr>");
     print(
"<tr><td align=left><img  src=pic/smilies/karma.gif alt=good_karma></td><td  align=left><b>Congratulations! </b>$CURUSER[username] you  have got your self 3 new invites! <img src=pic/w00t.gif  alt=\"w00t\"><br><br> click to go back to your <a  class=altlink href=mybonus.php>Bonus Points</a>  page.<br><br></td></tr></table>");
    }
    
//=== trade for special title
    /**** the $words array are words that you DO NOT want the user to have... use to filter "bad words" & user class...
    the user class is just for show, but what the hell tongue.gif Add more or edit to your liking.
    *note if they try to use a restricted word, they will recieve the special title "I just wasted my karma" *****/
    
elseif($art == "title") {
     
$words = array("****""shit""Moderator""Administrator""Admin",  "pussy""Sysop""****""nigger""VIP""Super User""Power User");
    
$title str_replace($words"I just wasted my karma"$title);
    
//if ($words)
    //$title = "I just wasted my karma";
     
$bonuscomment gmdate("Y-m-d") . " - " .$points" Points for custom  title. old title was $CURUSER[title] new title is $title\n "  .$bonuscomment;
    
mysql_query("UPDATE users SET title = $title, seedbonus = '$seedbonus' WHERE id = '$userid'") or sqlerr(__FILE____LINE__);
     print(
"<table width=100%><tr><td class=colhead  align=left  colspan=2><h1>Success!</h1></td></tr>");
     print(
"<tr><td align=left><img  src=pic/smilies/karma.gif alt=good_karma></td><td  align=left><b>Congratulations! </b>$CURUSER[username] you  are now known as $title! <img src=pic/w00t.gif  alt=\"w00t\"><br><br> click to go back to your <a  class=altlink href=mybonus.php>Bonus Points</a>  page.<br><br></td></tr></table>");
    }
    elseif(
$art == "gift_1") {
    
//=== trade for giving the gift of karma
    
$points $_POST["bonusgift"];
    
$bonus$CURUSER['seedbonus'];
    if(
$bonus >= $points){
    
$pointshtmlspecialchars($points,1);
    
$bonuscomment gmdate("Y-m-d") . " - " .$points" Points as gift to $_POST[username] .\n " .$bonuscomment;
    
$seedbonus=$bonus-$points;
    
$giftbonus1=$userseedbonus+$points;
    if (
$userid==$useridgift){
     print(
"<table width=100%><tr><td class=colhead  align=left  colspan=2><h1>Huh?</h1></td></tr>");
     print(
"<tr><td align=left><img src=pic/smilies/dwarf.gif  alt=good_karma></td><td align=left><b>Not so fast  there Mr. fancy pants!</b><br>$CURUSER[username]... you can  not spread the love to yourself...<br>If you want to spread the  love, pick another user! <br><br> click to go back to your  <a class=altlink href=mybonus.php>Bonus Points</a>  page.<br><br></td></tr></table>");
    die;
    }
    if (!
$useridgift){
     print(
"<table width=100%><tr><td class=colhead  align=left  colspan=2><h1>Error</h1></td></tr>");
     print(
"<tr><td align=left><img src=pic/smilies/dwarf.gif  alt=good_karma></td><td align=left><b>Sorry  $CURUSER[username]...</b><br> No User with that username  <br><br> click to go back to your <a class=altlink  href=mybonus.php>Bonus Points</a>  page.<br><br></td></tr></table>");
    die;
    }

     
mysql_query("UPDATE users SET seedbonus = '$seedbonus', bonuscomment =  '$bonuscomment' WHERE id = '$userid'") or sqlerr(__FILE____LINE__);
    
mysql_query("UPDATE users SET seedbonus = '$giftbonus1' WHERE id = '$useridgift'");

    
//===send message
    
$subject sqlesc("Someone gave you a gift"); //=== comment out this line if you do not have subject in your PM system
    
$added sqlesc(get_date_time());
    
$msg sqlesc("You have been given a gift of $points Bonus points by ".$CURUSER['username']);
     
mysql_query("INSERT INTO messages (sender, subject, receiver, msg,  added) VALUES(0, $subject$useridgift$msg$added)") or  sqlerr(__FILE____LINE__);
    
//mysql_query("INSERT INTO messages  (sender, receiver, msg, added) VALUES(0, $useridgift, $msg, $added)") or  sqlerr(__FILE__, __LINE__); //=== use this line if you do not have  subject in your PM system and comment out the above query.
    
$usernamegift unesc($_POST["username"]);
     print(
"<table width=100%><tr><td class=colhead  align=left  colspan=2><h1>Success!</h1></td></tr>");
     print(
"<tr><td align=left><img  src=pic/smilies/karma.gif alt=good_karma></td><td  align=left><b>Congratulations! $CURUSER[username] </b>you  have spread the love well.<br><br><b><a  class=altlink  href=userdetails.php?id=$useridgift>$usernamegift</a></b>  will be pleased with your kindness!<br><br>This is the  message that was sent to <a class=altlink  href=userdetails.php?id=$useridgift>$usernamegift</a>:<br><br><b>$subject</b><br>  <p>$msg</p>");
    print(
"<br>You may also send  <a class=altlink  href=userdetails.php?id=$useridgift>$usernamegift</a> a message  by clicking <a class=altlink  href=sendmessage.php?receiver=$useridgift>HERE</a> or go back  to your <a class=altlink href=mybonus.php>Bonus Points</a>  page.<br><br></td></tr></table>");
    }
    else{
     print(
"<table width=100%><tr><td class=colhead  align=left  colspan=2><h1>OUPS!</h1></td></tr>");
     print(
"<tr><td align=left><img src=pic/smilies/cry.gif  alt=oups></td><td align=left><b>Sorry  </b>$CURUSER[username] you don't have enough Bonus points!");
     print(
"<br> go back to your <a class=altlink  href=mybonus.php>Bonus Points</a>  page.<br><br></td></tr></table>");
    }
    }
    }
    }
    
end_frame();
    
stdfoot();

    
?>
and this sql:

PHP Code:
ALTER TABLE `usersADD `bonuscommenttext
Done!

Please Do Not "PM" Me For Personal Support!

Reply With Quote
The Following User Says Thank You to nicukent For This Useful Post:
wMan (13th May 2011)
  #2  
Old 31st January 2012, 14:11
cosmyn09's Avatar
cosmyn09 cosmyn09 is offline
Member
 
Join Date: Feb 2010
P2P
Posts: 9
Default
Quote:
Originally Posted by nicukent View Post
Here is what I use use both the sql table and the mybonus.php
It has been fixed for any cheats I could find.


Do not go for nothing, but put them so no point in uploading this to
new torrent = 15 points
filling the request = 10 points
request to re-seed filling = 5 points
Comment on torrent = 3 points
making the post = 3 point
Starting a topic = 3 points
idling in irc = 2 points per hour
Saying thanks = 2 points
online voting poll = 1 point
please help me
Reply With Quote
  #3  
Old 18th February 2012, 01:05
techys's Avatar
techys techys is offline
Member
 
Join Date: Feb 2012
P2P
Posts: 12
Default EM
What change i shall do so the users get 4 points each hour and not 2.5 ?

Bump: how i can give 10 points to the user for each torrent upload ?
Reply With Quote
  #4  
Old 4th June 2012, 13:06
BEST's Avatar
BEST BEST is offline
Senior Member
 
Join Date: Aug 2009
Germany
Posts: 78
Default
Please also post what times fully in the cleanup will need it for TBDEV Source
Reply With Quote
  #5  
Old 2nd November 2012, 00:41
wMan's Avatar
wMan wMan is offline
Banned
 
Join Date: Feb 2008
P2P
Posts: 1,433
Thumbs down
Quote:
Originally Posted by nicukent View Post
Here is what I use use both the sql table and the mybonus.php
It has been fixed for any cheats I could find.

Mine is modified and fixed. You will need to change some of it for your site.
I increased the number of bonus points that can be cached in.
Also at the bottom where is says what they can get points for and amounts will need to be changed for your site.
-------------------------------------------------------------------------
Sql:

PHP Code:
--
    -- 
Table structure for table `bonus`
    --

    
CREATE TABLE IF NOT EXISTS `bonus` (
      `
idint(5NOT NULL auto_increment,
      `
bonusnamevarchar(50NOT NULL default '',
      `
pointsdecimal(8,1NOT NULL default '0.0',
      `
descriptiontext NOT NULL,
      `
artvarchar(10NOT NULL default 'traffic',
      `
mengebigint(20unsigned NOT NULL default '0',
      
PRIMARY KEY  (`id`)
    ) 
ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=11;

    --
    -- 
Dumping data for table `bonus`
    --

    
INSERT INTO `bonus` (`id`, `bonusname`, `points`, `description`, `art`, `menge`) VALUES
     
(1'1.0GB Uploaded'50.0'With enough bonus points acquired, you  are able to exchange them for an Upload Credit. The points are then  removed from your Bonus Bank and the credit is added to your total  uploaded amount.''traffic'1073741824),
    (
2'2.5GB Uploaded',  100.0'With enough bonus points acquired, you are able to exchange them  for an Upload Credit. The points are then removed from your Bonus Bank  and the credit is added to your total uploaded amount.''traffic',  2684354560),
    (
3'5GB Uploaded'175.0'With enough bonus points  acquired, you are able to exchange them for an Upload Credit. The  points are then removed from your Bonus Bank and the credit is added to  your total uploaded amount.''traffic'5368709120),
    (
8'3  Invites'100.0'With enough bonus points acquired, you are able to  exchange them for a few invites. The points are then removed from your  Bonus Bank and the invitations are added to your invites amount.',  'invite'3),
    (
9'Custom Title!'50.0'For only 50.0 Karma  Bonus Points you can buy yourself a custom title. the only restrictions  are no foul or offensive language or userclass can be entered. The  points are then removed from your Bonus Bank and your special title is  changed to the title of your choice''title'1),
    (
4'10GB  Uploaded'300.0'With enough bonus points acquired, you are able to  exchange them for an Upload Credit. The points are then removed from  your Bonus Bank and the credit is added to your total uploaded amount.',  'traffic'10737418240),
    (
10'Give A Karma Gift'100.0'Well  perhaps you don''t need the upload credit, but you know somebody that  could use the Karma boost! You are now able to give your Karma credits  as  a gift! The points are then removed from your Bonus Bank and  added  to the account of a user of your choice!\r\n\r\nAnd they recieve a PM  with all the info as well as who it came from...''gift_1',  1073741824),
    (
5'25GB Uploaded'1000.0'With enough bonus  points acquired, you are able to exchange them for an Upload Credit. The  points are then removed from your Bonus Bank and the credit is added to  your total uploaded amount.''traffic'26843545600),
    (
6'50GB  Uploaded'1750.0'With enough bonus points acquired, you are able to  exchange them for an Upload Credit. The points are then removed from  your Bonus Bank and the credit is added to your total uploaded amount.',  'traffic'5368709120),
    (
7'100GB Uploaded'3000.0'With  enough bonus points acquired, you are able to exchange them for an  Upload Credit. The points are then removed from your Bonus Bank and the  credit is added to your total uploaded amount.''traffic',  107374182400); 
mybonus.php:

PHP Code:
<?php

    
/******************************************************
    Total credit to TvRecall for writing this fine mod in the first place,
    the mod has since been altered with code and input by:
    devinkray - cddvdheaven - DRRRR - vlahdr - sherl0k - okiee - lords - XiaNYdE
    dopeydwerg - WRK - Fantomax - porthos - dokty - Sir_SnuggleBunny - wicked
    *******************************************************/

    
require_once('include/bittorrent.php');
    
// disable any caching by the browser
    
header('Expires: Mon, 14 Oct 2002 05:00:00 GMT');              // Date in the past
    
header('Last-Modified: ' gmdate("D, d M Y H:i:s") . ' GMT'); // always modified
    
header('Cache-Control: no-store, no-cache, must-revalidate');  // HTTP 1.1
    
header('Cache-Control: post-check=0, pre-check=0'false);
    
header('Pragma: no-cache');                                    // HTTP 1.0

    
dbconn(false);

    
$action $_GET['action'];

    
loggedinorreturn();

    
stdhead($CURUSER['username'] . "'s Bonus Page");
    
begin_frame("$SITENAME Bonus Point system:");
    
$bonus htmlspecialchars($CURUSER['seedbonus'], 1);

    
$userid 0+$CURUSER['id'];

    if(
$bonus != htmlspecialchars($CURUSER['seedbonus'], 1)) {
    echo 
"bad idea...";
    die;
    }
    if (!
$action) {
    print(
"<table align=center width=100% border=\"0\" cellspacing=\"0\" cellpadding=\"5\">\n");
    
//Print("<tr><td class=main colspan=4 align=center><h1>$SITENAME Karma Bonus Point system:</h1></td></tr>\n");
    
?>
     <tr><td align=center colspan=4>Exchange your <a  class=altlink href=mybonus.php>Karma Bonus Points</a> [ current  <?echo "$bonus";?> ] for goodies!
    <br><br>
    [ If no buttons appear, you have not earned enough bonus points to trade. ]
    <br><br>
    <?
    $dt 
sqlesc(gmdate("M-d-Y"));
    echo
"$dt";
    print(
"<tr><td align=left>Option</td>".
    
"<td class=colhead align=left>Description</td>".
    
"<td class=colhead align=center>Points</td>".
    
"<td class=colhead align=center>Trade</td>".
    
"</tr>");

    
$res mysql_query("SELECT * from bonus WHERE id=id ORDER BY id ASC");

    while (
$gets mysql_fetch_assoc($res))
    {

     
$otheroption "<table width=100%><tr><td  class=$class><b>Username:</b><input type=text  name=username size=20 maxlength=24></td><td class=$class>  <b>to be given: </b><select name=bonusgift>  <option value=100.0> 100.0</option> <option  value=200.0> 200.0</option> <option value=300.0>  300.0</option> <option value=400.0>  400.0</option><option value=500.0>  500.0</option></select> Karma  points!</td></tr></table>";
    
$otheroption_title "<input type=text name=title size=30 maxlength=30>";

    
//if($CURUSER['seedbonus'] <= 90000.0) {
    
print("<form action=mybonus.php?action=exchange method=post>\n");
    if (
$gets["id"]==9)
     print(
"<tr><td class=$class  align=center><b>".$gets["id"]."</b></td><td  align='left'  class=$class><h1>".$gets["bonusname"]."</h1>".$gets["description"]."<br><br>Enter  the <b>Special Title</b> you would like to have  $otheroption_title click Exchange! </td><td align='center'  class=$class>".$gets["points"]."</td>");
    else
    if (
$gets["id"]==10)
     print(
"<tr><td class=$class  align=center><b>".$gets["id"]."</b></td><td  align='left'  class=$class><h1>".$gets["bonusname"]."</h1>".$gets["description"]."<br><br>Enter  the <b>username</b> of the person you would like to send  karma to, and select how many points you want to send and click  Exchange!<br>$otheroption</td><td align='center'  class=$class>min.<br>".$gets["points"]."<br>max.<br>500</td>");
    else
     print(
"<tr><td class=$class  align=center><b>".$gets["id"]."</b></td><td  align='left'  class=$class><h1>".$gets["bonusname"]."</h1>".$gets["description"]."</td><td  align='center' class=$class>".$gets["points"]."</td>");

    print(
"<input type=\"hidden\" name=\"bonus\" value=\"".$bonus."\">\n");
    print(
"<input type=\"hidden\" name=\"userid\" value=\"".$userid."\">\n");
    print(
"<input type=\"hidden\" name=\"points\" value=\"".$gets["points"]."\">\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"]) {
    if (
$gets["id"]==10)
     print(
"<td class=$class><input class=button type=submit  name=submit value=\"Karma Gift!\"></form></td>");
    else
     print(
"<td class=$class><input class=button type=submit  name=submit value=\"Exchange!\"></form></td>");
    } else {
    print(
"<td class=$class align=center><b>more points needed</b></form></td>");
    }
    
//}
    
}
    
/*
    if($CURUSER['seedbonus'] > 90000.0) {
    print("<form action=mybonus.php?action=exchange method=post>\n");
    print("<input type=\"hidden\" name=\"bonus\" value=\"".$bonus."\">\n");
    print("<input type=\"hidden\" name=\"userid\" value=\"".$userid."\">\n");
    print("<input type=\"hidden\" name=\"points\" value=\"".$gets["points"]."\">\n");
    print("<input type=\"hidden\" name=\"option\" value=\"".$gets["id"]."\">\n");
    print("<input type=\"hidden\" name=\"art\" value=\"gift_1\">\n");
     print("<tr><td class=$class align=center><img  src=pic/smilies/karma.gif alt=good_karma></td><td  align='left' class=$class><b>Wow! That's a lot of Karma  Points!!!</b><br>your only option now is to share the love!  <img src=pic/smilies/friends.gif alt=\"smilie\"><br>With a  Karma rating of over 1000.0 you can not use the regular trade options...  in fact, you must share the love if you want to do anything at  all!<br><br>Use this option to send another user some Karma  points... Select how many points you want to send and click  <b>Karma Gift!</b><br>$otheroption</td><td  align='center'  class=$class>100<br>to<br>500</td>");
     print("<td class=$class valign=bottom><input class=button  type=submit name=submit value=\"Karma  Gift!\"></form></td>");
    }
    */
    
print("</table><br><br><br>");
    
end_frame();
    
begin_frame();
    
?>

    <table width=100%>
     <tr><td class=colhead><h1>What the hell are these  Karma Bonus points, and how do I get  them?</h1></td></tr>
    <tr><td>
    For every hour that you seed a torrent, you are awarded with 2.5 Karma Bonus Points... <br>
    If you save up enough of them, you can trade them in for goodies like bonus GB(s) to your upload<br> stats,
    getting more invites, or doing the real Karma booster... give them to another user!<br>
    and yes! this is awarded on a per torrent basis even if there are no leechers on the Torrent you are seeding! <br>
    <h1>Other things that will get you karma points:</h1>
    <ul>
    <li>uploading a new torrent = 15 points</li>
    <li>filling a request = 10 points</li>
    <li>filling a re-seed request = 5 points</li>
    <li>comment on torrent = 3 points</li>
    <li>making a post = 3 point</li>
    <li>starting a topic = 3 points</li>
    <li>idling in irc = 2 points per hour</li>
    <li>saying thanks = 2 points</li>
    <li>voting on poll = 1 point</li>

    </ul>
    <h1>Some things that will cost you karma points:</h1>
    <ul>
    <li>trading for invites</li>
    <li>trading for upload credit</li>
    <li>trading for a custom title</li>
    <li>giving a gift of karma points to another user</li>
    <li>asking for a re-seed</li>
    <li>making a request</li>
    <li>deleting a post</li>
    <li>deleteing torrent comment</li>
    </ul>
    <p>But keep in mind that everything that can get you can also be lost, <br>
    ie:if you up a torrent then delete it, you will gain and then lose 10 points, <br>
    making a post and having it deleted will do the same
    <br><br>
    ... and there are other hidden bonus points all over the site.<br><br>
    Yet another way to help out your ratio! </p>

    <p>*please note, staff can give or take away points for breaking the rules, or doing good for the community.</p>
    </td></tr></table>
    <p align="center"><a class=altlink href=my.php>back to your profile</a></p>
    <?
    
}
    if (
$action == "exchange") {

    
$userid $_POST["userid"];
    
$option $_POST["option"];
    
$points $_POST["points"];
    
$bonus $_POST["bonus"];
    
$art $_POST["art"];
    
//===custom title
    
$title htmlentities($_POST["title"]);
    
$title sqlesc($title);
    
//==gift for peeps with no more options
    
$usernamegift $_POST["username"];
    
$res mysql_query("SELECT id,seedbonus FROM users WHERE username=" sqlesc($usernamegift));
    
$arr mysql_fetch_assoc($res);
    
$useridgift $arr['id'];
    
$userseedbonus $arr['seedbonus'];
    
$usernamegift sqlesc($usernamegift);
    
$seedbonus=htmlspecialchars($bonus-$points,1);

    
$bonuscomment $CURUSER['bonuscomment'];
    
$upload $CURUSER['uploaded'];
    
$bpoints $CURUSER['seedbonus'];
    
$res mysql_query("SELECT * FROM bonus WHERE id='$option'");
    
$bytes mysql_fetch_assoc($res);
    
$invites $CURUSER['invites'];
    
$inv $invites+$bytes['menge'];

    if(
$bpoints >= $points) {
    
//=== trade for upload
    
if($art == "traffic") {
    
$bonus$CURUSER['seedbonus'];
    if(
$bonus $points){
    die;
    }
    
$up $upload $bytes['menge'];
    
$bonuscomment gmdate("Y-m-d") . " - " .$points" Points for upload bonus.\n " .$bonuscomment;
     
mysql_query("UPDATE users SET uploaded = $upload + $bytes[menge],  seedbonus = '$seedbonus', bonuscomment = '$bonuscomment' WHERE id =  '$userid'") or sqlerr(__FILE____LINE__);
    print(
"<table  width=100%><tr><td class=colhead align=left  colspan=2><h1>Success!</h1></td></tr>");
     print(
"<tr><td align=left><img  src=pic/smilies/karma.gif alt=good_karma></td><td  align=left><b>Congratulations! </b>$CURUSER[username] you  have just increased your upload amount! <img  src=pic/smilies/w00t.gif  alt=\"w00t\"><br><br><br><br> click to go  back to your <a class=altlink href=mybonus.php>Bonus  Points</a>  page.<br><br></td></tr></table>");
    }
    
/*
    //=== trade for one month VIP status ***note "SET class = '3'" change "3" to whatever your VIP class number is
    elseif($art == "class") {
    $vip_until = get_date_time(gmtime() + 28*86400);
    $bonuscomment = gmdate("Y-m-d") . " - " .$points. " Points for 1 month VIP Status.\n " .$bonuscomment;
     mysql_query("UPDATE users SET class = '3', vip_added = 'yes',  vip_until = '$vip_until', seedbonus = '$seedbonus' WHERE id =  '$userid'") or sqlerr(__FILE__, __LINE__);
    print("<table  width=100%><tr><td class=colhead align=left  colspan=2><h1>Success!</h1></td></tr>");
     print("<tr><td align=left><img  src=pic/smilies/karma.gif alt=good_karma></td><td  align=left><b>Congratulations! </b>$CURUSER[username] you  have got yourself VIP Status for one month! <img  src=pic/smilies/w00t.gif alt=\"w00t\"><br><br> Click to  go back to your <a class=altlink href=mybonus.php>Karma  Points</a>  page.<br><br></td></tr></table>");
    }
    */
    //=== trade for invites
    
elseif($art == "invite") {
    
$bonuscomment gmdate("Y-m-d") . " - " .$points" Points for invites.\n " .$bonuscomment;
     
mysql_query("UPDATE users SET invites = '$inv', seedbonus =  '$seedbonus' WHERE id = '$userid'") or sqlerr(__FILE____LINE__);
     print(
"<table width=100%><tr><td class=colhead  align=left  colspan=2><h1>Success!</h1></td></tr>");
     print(
"<tr><td align=left><img  src=pic/smilies/karma.gif alt=good_karma></td><td  align=left><b>Congratulations! </b>$CURUSER[username] you  have got your self 3 new invites! <img src=pic/w00t.gif  alt=\"w00t\"><br><br> click to go back to your <a  class=altlink href=mybonus.php>Bonus Points</a>  page.<br><br></td></tr></table>");
    }
    
//=== trade for special title
    /**** the $words array are words that you DO NOT want the user to have... use to filter "bad words" & user class...
    the user class is just for show, but what the hell tongue.gif Add more or edit to your liking.
    *note if they try to use a restricted word, they will recieve the special title "I just wasted my karma" *****/
    
elseif($art == "title") {
     
$words = array("****""shit""Moderator""Administrator""Admin",  "pussy""Sysop""****""nigger""VIP""Super User""Power User");
    
$title str_replace($words"I just wasted my karma"$title);
    
//if ($words)
    //$title = "I just wasted my karma";
     
$bonuscomment gmdate("Y-m-d") . " - " .$points" Points for custom  title. old title was $CURUSER[title] new title is $title\n "  .$bonuscomment;
    
mysql_query("UPDATE users SET title = $title, seedbonus = '$seedbonus' WHERE id = '$userid'") or sqlerr(__FILE____LINE__);
     print(
"<table width=100%><tr><td class=colhead  align=left  colspan=2><h1>Success!</h1></td></tr>");
     print(
"<tr><td align=left><img  src=pic/smilies/karma.gif alt=good_karma></td><td  align=left><b>Congratulations! </b>$CURUSER[username] you  are now known as $title! <img src=pic/w00t.gif  alt=\"w00t\"><br><br> click to go back to your <a  class=altlink href=mybonus.php>Bonus Points</a>  page.<br><br></td></tr></table>");
    }
    elseif(
$art == "gift_1") {
    
//=== trade for giving the gift of karma
    
$points $_POST["bonusgift"];
    
$bonus$CURUSER['seedbonus'];
    if(
$bonus >= $points){
    
$pointshtmlspecialchars($points,1);
    
$bonuscomment gmdate("Y-m-d") . " - " .$points" Points as gift to $_POST[username] .\n " .$bonuscomment;
    
$seedbonus=$bonus-$points;
    
$giftbonus1=$userseedbonus+$points;
    if (
$userid==$useridgift){
     print(
"<table width=100%><tr><td class=colhead  align=left  colspan=2><h1>Huh?</h1></td></tr>");
     print(
"<tr><td align=left><img src=pic/smilies/dwarf.gif  alt=good_karma></td><td align=left><b>Not so fast  there Mr. fancy pants!</b><br>$CURUSER[username]... you can  not spread the love to yourself...<br>If you want to spread the  love, pick another user! <br><br> click to go back to your  <a class=altlink href=mybonus.php>Bonus Points</a>  page.<br><br></td></tr></table>");
    die;
    }
    if (!
$useridgift){
     print(
"<table width=100%><tr><td class=colhead  align=left  colspan=2><h1>Error</h1></td></tr>");
     print(
"<tr><td align=left><img src=pic/smilies/dwarf.gif  alt=good_karma></td><td align=left><b>Sorry  $CURUSER[username]...</b><br> No User with that username  <br><br> click to go back to your <a class=altlink  href=mybonus.php>Bonus Points</a>  page.<br><br></td></tr></table>");
    die;
    }

     
mysql_query("UPDATE users SET seedbonus = '$seedbonus', bonuscomment =  '$bonuscomment' WHERE id = '$userid'") or sqlerr(__FILE____LINE__);
    
mysql_query("UPDATE users SET seedbonus = '$giftbonus1' WHERE id = '$useridgift'");

    
//===send message
    
$subject sqlesc("Someone gave you a gift"); //=== comment out this line if you do not have subject in your PM system
    
$added sqlesc(get_date_time());
    
$msg sqlesc("You have been given a gift of $points Bonus points by ".$CURUSER['username']);
     
mysql_query("INSERT INTO messages (sender, subject, receiver, msg,  added) VALUES(0, $subject$useridgift$msg$added)") or  sqlerr(__FILE____LINE__);
    
//mysql_query("INSERT INTO messages  (sender, receiver, msg, added) VALUES(0, $useridgift, $msg, $added)") or  sqlerr(__FILE__, __LINE__); //=== use this line if you do not have  subject in your PM system and comment out the above query.
    
$usernamegift unesc($_POST["username"]);
     print(
"<table width=100%><tr><td class=colhead  align=left  colspan=2><h1>Success!</h1></td></tr>");
     print(
"<tr><td align=left><img  src=pic/smilies/karma.gif alt=good_karma></td><td  align=left><b>Congratulations! $CURUSER[username] </b>you  have spread the love well.<br><br><b><a  class=altlink  href=userdetails.php?id=$useridgift>$usernamegift</a></b>  will be pleased with your kindness!<br><br>This is the  message that was sent to <a class=altlink  href=userdetails.php?id=$useridgift>$usernamegift</a>:<br><br><b>$subject</b><br>  <p>$msg</p>");
    print(
"<br>You may also send  <a class=altlink  href=userdetails.php?id=$useridgift>$usernamegift</a> a message  by clicking <a class=altlink  href=sendmessage.php?receiver=$useridgift>HERE</a> or go back  to your <a class=altlink href=mybonus.php>Bonus Points</a>  page.<br><br></td></tr></table>");
    }
    else{
     print(
"<table width=100%><tr><td class=colhead  align=left  colspan=2><h1>OUPS!</h1></td></tr>");
     print(
"<tr><td align=left><img src=pic/smilies/cry.gif  alt=oups></td><td align=left><b>Sorry  </b>$CURUSER[username] you don't have enough Bonus points!");
     print(
"<br> go back to your <a class=altlink  href=mybonus.php>Bonus Points</a>  page.<br><br></td></tr></table>");
    }
    }
    }
    }
    
end_frame();
    
stdfoot();

    
?>
and this sql:

PHP Code:
ALTER TABLE `usersADD `bonuscommenttext
Done!

Please Do Not "PM" Me For Personal Support!

would be a good if you add the clean up as well
Reply With Quote
Reply

Tags
seedbonus , version

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



All times are GMT +2. The time now is 07:29. vBulletin skin by ForumMonkeys. Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2024, vBulletin Solutions Inc.