joeroberts |
19th January 2009 17:07 |
replace mybonus.php
PHP Code:
<?php /* *----------------------------phpMyBitTorrent V 2.0-beta4-----------------------* *--- The Ultimate BitTorrent Tracker and BMS (Bittorrent Management System) ---* *-------------- Created By Antonio Anzivino (aka DJ Echelon) --------------* *------------- http://www.p2pmania.it -------------* *------------ Based on the Bit Torrent Protocol made by Bram Cohen ------------* *------------- http://www.bittorrent.com -------------* *------------------------------------------------------------------------------* *------------------------------------------------------------------------------* *-- This program is free software; you can redistribute it and/or modify --* *-- it under the terms of the GNU General Public License as published by --* *-- the Free Software Foundation; either version 2 of the License, or --* *-- (at your option) any later version. --* *-- --* *-- This program is distributed in the hope that it will be useful, --* *-- but WITHOUT ANY WARRANTY; without even the implied warranty of --* *-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --* *-- GNU General Public License for more details. --* *-- --* *-- You should have received a copy of the GNU General Public License --* *-- along with this program; if not, write to the Free Software --* *-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA --* *-- --* *------------------------------------------------------------------------------* *------ 2005 phpMyBitTorrent Development Team ------* *----------- http://phpmybittorrent.com -----------* *------------------------------------------------------------------------------* */ if (!eregi("mybonus.php",$_SERVER["PHP_SELF"])) die ("You cannot include this file"); include("header.php"); global $user, $db, $db_prefix; $bon = "SELECT active, upload, comment, offer, fill_request, seeding, by_torrent FROM ".$db_prefix."_bonus_points ;"; $bonset = $db->sql_query($bon); list ($active, $upload, $comment, $offer, $fill_request, $seeding, $by_torrent) = $db->sql_fetchrow($bonset); $db->sql_freeresult($bonset); if($active =='false'){ OpenMessTable("Bonus System is Closed"); echo"Sorry to Announce But at this time we are not useing the Bonus system"; echo"If you feel you have reached this error By Mistake please contact on of the sites moderatores so the may assest you"; CloseMessTable(); die(); } $bonus = $user->seedbonus; $userid = "".getuserid($btuser).""; OpenTable("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: <? print $user->seedbonus;?>)
(If the button's deactivated, you do not have enough to trade.)
<?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>");
$sql = ("SELECT * FROM ".$db_prefix."_bonus order by id"); $res = $db->sql_query($sql); while ($gets = $db->sql_fetchrow($res)) { print("<tr class=tableb><td>".$gets["id"]."</td><td align='left'><b>".$gets["bonusname"]."</b>".$gets["description"]."</td><td align='right'>".$gets["points"]."</td>"); 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=\"".$gets["art"]."\">\n"); if($user->seedbonus >= $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>"); ?> <blockquote><p align=left><b>How do I get points?</b> You receive <?php echo $seeding;?> points for every 10 minutes the system registers you as being a seeder. You well receive <?php echo $upload;?> points for uploading a new torrent. You well receive <?php echo $comment;?> points for leaving a comment on a torrent (that includes a quick thanks). You well receive <?php echo $offer;?> points for Making a Offer to upload a torrent You well receive <?php echo $fill_request;?> points for filling a Requisted torrent (Note any comment deleted By you or staff well result in loss of those points so no flooding) </p></blockquote> </td></tr> <tr><td><a href=user.php?op=profile&id=<?php echo $userid;?>>Back to your profile</a></td></tr>
</table> <?php if ($action == "exchange") { global $seedbonus, $invites; $userid = $_POST["userid"]; $option = $_POST["option"]; $points = $_POST["points"]; $bonus = $_POST["bonus"];
$seedbonus2=$user->seedbonus-$points;
$art = $_POST["art"]; $modcomment = $user->modcomment; $upload = $user->uploaded; $bpoints = $user->seedbonus; $sql = ("SELECT * FROM ".$db_prefix."_bonus WHERE id='$option'"); $res = $db->sql_query($sql); $bytes = $db->sql_fetchrow($res); $up = $user->uploaded+$bytes['menge']; $invites = $user->invites; $inv = $invites+$bytes['menge']; if($user->seedbonus >= $points) {
if($art == "traffic") { $modcomment = gmdate("Y-m-d") . " - User has traded " .$points. " Points for traffic.\n ".$bytes['menge']."" .$modcomment; $complete = $db->sql_query("UPDATE ".$db_prefix."_users SET uploaded = '".$up."', seedbonus = '$seedbonus2', modcomment = '$modcomment' WHERE id = '$userid'") or sqlerr(__FILE__, __LINE__); if($complete)bterror("You have Traded " .$points. " Points for traffic","Sucsess"); } elseif($art == "invite") { $modcomment = gmdate("Y-m-d") . " - User has traded " .$points. " Points for invites.\n " .$modcomment; $complete = $db->sql_query("UPDATE ".$db_prefix."_users SET invites = '".$inv."', seedbonus = '$seedbonus2', modcomment = '$modcomment' WHERE id = '$userid'") or sqlerr(__FILE__, __LINE__); if($complete)bterror("You have Traded " .$points. " Points for invites","Sucsess"); } else { echo "No valid type"; }
} else { echo "Not enough points to trade..."; } }
CloseTable(); include("footer.php"); ?>
|