View Single Post
  #28  
Old 22nd April 2016, 13:56
Viny Viny is offline
Senior Member
 
Join Date: Sep 2012
P2P
Posts: 23
Default
Quote:
Originally Posted by Napon View Post
mybonus fix

Code:
<?php
/*
+------------------------------------------------
|   BitTorrent Tracker PHP
|   =============================================
|   by Cod3r
|   (c) 2015 - 2016 torrentstrike.net
|   http://torrentstrike.net
|   =============================================
|   Licence Info: GPL
+------------------------------------------------
*/
require_once "include/bittorrent.php";
require_once "include/user_functions.php";
dbconn();
loggedinorreturn();
$lang = array_merge( load_language('global'), load_language('mybonus') );
$HTMLOUT ='';
                function I_smell_a_rat($var){
                       if ((0 + $var) == 1)
                                $var = 0 + $var;
                                else
                        stderr("Error", "I smell a rat!");
}
                                $bonus = htmlspecialchars($CURUSER['seedbonus'], 1);
                      switch (true){
                        case ($_GET['up_success']):
                             I_smell_a_rat($_GET['up_success']);
                             $amt = (int)$_GET['amt'];
                      switch ($amt) {
                       case $amt == 75.0:
                            $amt = '1 GB';
                            break;
                       case $amt == 150.0:
                            $amt = '2.5 GB';
                            break;
                          default:
                            $amt = '5 GB';
}

$HTMLOUT .='<table width="80%"><tr><td class="colhead" align="left" colspan="2"><h1>Success !</h1></td></tr><tr>'.'<td class="colhead" align="left"><img src=pic/smilies/karma.gif alt=good_karma></td>'.'<td class="colhead" 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>Karma Bonus Point</a> page.<br /><br /></td></tr></table>';
            print stdhead($CURUSER['username'] . "'s Karma Bonus Points Page") . $HTMLOUT . stdfoot();
            die;
}
            if ($_GET['exchange']){
            I_smell_a_rat($_GET['exchange']);
                $userid = 0 + $CURUSER['id'];
            if (!is_valid_id($userid))
                stderr("Error", "That is not your user ID!");
                $option = 0 + $_POST['option'];
                $res_points = mysql_query("SELECT * FROM bonus WHERE id =" . sqlesc($option));
                $arr_points = mysql_fetch_assoc($res_points);
                $art = $arr_points['art'];
                $points = $arr_points['points'];
            if ($points == 0)
                stderr("Error", "I smell a rat!");
                $seedbonus = htmlspecialchars($bonus-$points,1);
                $upload = $CURUSER['uploaded'];
                $bonuscomment = $CURUSER['bonuscomment'];
                $bpoints = $CURUSER['seedbonus'];
            if ($bonus < $points)
                stderr("Sorry", "you do not have enough Karma points!");
        switch ($art){
        case 'traffic':
                $up = $upload + $arr_points['menge'];
                $bonuscomment = gmdate("Y-m-d") . " - " .$points. " Points for upload bonus.\n " .$bonuscomment;
                mysql_query("UPDATE users SET uploaded = $upload + $arr_points[menge], seedbonus = '$seedbonus', bonuscomment = '$bonuscomment' WHERE id = '$userid'") or sqlerr(__FILE__, __LINE__);
                header("Refresh: 0; url={$TBDEV['baseurl']}/mybonus.php?up_success=1&amt=$points");
                die;
                break;
                }
}
$HTMLOUT .='<table align=center width="100%"  border="0"  cellspacing="0" cellpadding="5"><tr><td class="colhead" colspan="4">'.'<h1>'.$SITENAME.' Karma Bonus Point system:</h1></td></tr><tr><td align="center" colspan="4"  class="colhead">'.'Exchange your <a class=altlink href=mybonus.php>Karma Bonus Points</a> [ current '.$bonus.' ] for goodies!'.'<br /><br />[ If no buttons appear, you have not earned enough bonus points to trade. ]<br /><br /><tr>'.'<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 ORDER BY id ASC");
     while ($gets = mysql_fetch_assoc($res)){
            $count1= (++$count1)%2;
            $class = 'clearalt'.($count1==0?'6':'7');
$HTMLOUT .='<form action=mybonus.php?exchange=1 method=post>';
     switch (true){
     case ($gets['id'] == 5):
           break;
           default:
$HTMLOUT .='<tr><td class="colhead" align="left" class='.$class.'><h1><font color="#2682ff">'.$gets['bonusname'].'</font></h1>'.$gets['description'].'</td><td class="colhead" align="center" class='.$class.'>'.$gets['points'].'</td>';
}
$HTMLOUT .='<input type=hidden name=option value='.$gets['id'].'> <input type=hidden name=art value='.$gets['art'].'>';
            if($bonus >= $gets['points']) {
            switch (true){
            case ($gets['id'] == 7):
$HTMLOUT .='<td class="colhead" class='.$class.'><input class=button type=submit name=submit value="Karma Gift!"></form></td>';
            break;
            default:
$HTMLOUT .='<td class="colhead" class='.$class.'><input class=button type=submit name=submit value="Exchange!"></form></td>';
}
            }else
$HTMLOUT .='<td class="colhead" class='.$class.' align=center><b>more points needed</b></form></td>';
}
$HTMLOUT .='</table><br /><br /><br /><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 class="colhead">- For every hour that you seed a torrent, you are awarded with 1'.' Karma Bonus Point... <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 (max of 5) 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>'.'uploading a new subtitle = 10 points</li><li>comment on torrent = 3 points</li>'.'<li>saying thanks = 2 points</li><li>making a post = 1 point</li>'.'<li>starting a topic = 1 point</li><li>voting on poll = 1 point</li><li>filling a request = 10 points</li>'.'</ul><h1>Some things that will cost you karma points:</h1><ul>'.'<li>upload credit</li><li>custom title</li>'.'<li>a 1:1 ratio on a torrent</li>'.'<li>buying off your warning</li><li>one month custom smilies for the forums and comments</li>'.'<li>getting extra invites</li><li>giving a gift of karma points to another user</li>'.'<li>asking for a re-seed</li><li>making a request</li></ul><p>But keep in mind that everything that can get'.' you karma 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 karma 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>';
            print stdhead($CURUSER['username'] . "'s Karma Bonus Points Page") . $HTMLOUT . stdfoot();
?>
the problem has decreased but still remains
Code:
Notice: Undefined index: up_success in /home/vinyg365/public_html/monkeyz/mybonus.php on line 27

Notice: Undefined index: exchange in /home/vinyg365/public_html/monkeyz/mybonus.php on line 45

Notice: Undefined variable: SITENAME in /home/vinyg365/public_html/monkeyz/mybonus.php on line 73

Notice: Undefined variable: count1 in /home/vinyg365/public_html/monkeyz/mybonus.php on line 76
Reply With Quote