コード例 #1
0
ファイル: member.inc.php プロジェクト: simplyianm/clububer
function member_steal()
{
    //Steal Money
    global $HTTP_POST_VARS, $userdata, $locale, $settings, $golddata;
    //set an amount in case its missed later
    $success = '20';
    table_top($locale['urg_member_103']);
    /*
    First things first.. Can Only steal from users cash amounts never from bank.
    Lots of things can happen here. If steal is good stuff could happen to stealee
    if steal is bad stuff could happen to stealer.
    Maybe we need a jail now to go with this?
    Fail to steal go to jail and jail means loss of all owned stuff?
    */
    //lets trim the useage of this damn thing
    if ($golddata['steal'] < date('Ymd')) {
        global $stealfrom_id, $stealfrom_name, $steal_amount;
        if (isset($_POST['stealfrom']) != '') {
            //there must be something in the steal from box
            $stealfrom = stripinput($_POST['stealfrom']);
            //its not an numewral so select useing the name
            //sort out the name to id situation
            $id_query = dbquery("SELECT g.*, u.user_name as owner_name\n\t\t\t\tFROM " . DB_UG3 . " g\n\t\t\t\tLEFT JOIN " . DB_USERS . " u ON g.owner_id = u.user_id\n\t\t\t\tWHERE user_name = '" . $stealfrom . "'\n\t\t\t\tLIMIT 1");
            //$id_query = dbquery("SELECT * FROM ".DB_UG3." WHERE owner_name='".$stealfrom."' LIMIT 1");
            //$id_result = dbfetch_array($id_query);
            $id_result = dbarray($id_query);
            $stealfrom_id = $id_result['owner_id'];
            $stealfrom_name = $id_result['owner_name'];
            //timer for daily steal only
            $result = dbquery("UPDATE " . DB_UG3 . " SET steal = '" . date('Ymd') . "' WHERE owner_id = '" . $golddata['owner_id'] . "' LIMIT 1");
            $result = dbquery("SELECT g.*, u.user_name as owner_name\n\t\t\t\tFROM " . DB_UG3 . " g\n\t\t\t\tLEFT JOIN " . DB_USERS . " u ON g.owner_id = u.user_id\n\t\t\t\tWHERE owner_id = '" . $stealfrom_id . "'\n\t\t\t\tLIMIT 1");
            //$result = dbquery("SELECT * FROM ".DB_UG3." WHERE owner_id='".$stealfrom_id."' LIMIT 1");
            //ok its all so unfair aint it?
            //so lets play a little
            //if the theif has more money than the selected target
            $target_query = dbquery("SELECT g.*, u.user_name as owner_name\n\t\t\t\tFROM " . DB_UG3 . " g\n\t\t\t\tLEFT JOIN " . DB_USERS . " u ON g.owner_id = u.user_id\n\t\t\t\tWHERE owner_id = '" . $stealfrom_id . "'\n\t\t\t\tLIMIT 1");
            //$target_query = dbquery("SELECT * FROM ".DB_UG3." WHERE owner_id='".$stealfrom_id."' LIMIT 1");
            //$target_result = dbfetch_array($target_query);
            $target_result = dbarray($target_query);
            $targets_total = $target_result['cash'] + $target_result['bank'];
            if ($targets_total < '100' || $targets_total < '') {
                opentable($locale['urg_member_117']);
                echo $locale['urg_member_118'];
                closetable();
                include "footer.php";
                exit;
            }
            $my_total = $golddata['cash'] + $golddata['bank'];
            if ($targets_total < $my_total) {
                //less than theif
                //set the success percentage low
                $success = '10';
            } elseif ($targets_total > $my_total * 2) {
                //more than double of theif
                //set the success percentage low
                $success = '70';
            } elseif ($targets_total > $my_total / 2) {
                //more than half of theif
                //set the success percentage low
                $success = '45';
            } else {
                $success = '35';
            }
            //get a random number between 0 and 100
            $try = rand(0, 100);
            //percentage probability will work on
            //if successfull
            if ($try < $success) {
                // ??% chance of success
                $stealee = getusergold($stealfrom_id, 'cash');
                $steal_amount = rand(0, $stealee);
                //take this money away from stealee...
                takegold2($stealfrom_id, $steal_amount, 'cash');
                payuser($userdata['user_id'], $steal_amount, 'cash');
                if ($steal_amount < 50) {
                    echo $locale['urg_member_119'] . " " . $steal_amount . "!";
                } else {
                    echo $locale['urg_member_120'] . " " . $steal_amount . " " . $locale['urg_member_121'] . " " . $stealfrom_name . "" . $locale['urg_member_122'] . " " . $stealfrom_name . " " . $locale['urg_member_123'];
                }
            } else {
                if ($golddata['cash'] + $golddata['cash'] <= $steal_amount) {
                    $opt = '2';
                } else {
                    $opt = '4';
                }
                //ok its punishment time..
                $punishment_id = rand(0, $opt);
                //grab a random punishment
                if ($punishment_id == 0) {
                    echo $locale['urg_member_124'];
                } elseif ($punishment_id == 1) {
                    //take karma (must be forced to go negative)
                    takegold2($userdata['user_id'], '10', 'karma', 1);
                    echo $locale['urg_member_125'];
                } elseif ($punishment_id == 2) {
                    //take gold (force it)
                    //$fine = $golddata[cash]/2;
                    $fine_amount = rand(0, $golddata['cash'] + $golddata['bank']);
                    takegold2($userdata['user_id'], $fine_amount, 'cash', 1);
                    echo $locale['urg_member_126'] . formatMoney($fine_amount) . "!<br />";
                } elseif ($punishment_id == 3) {
                    //the stealee robs you
                    //$returnsteal = $golddata['cash']/2;
                    //$returnsteal = $golddata['cash'];
                    $returnsteal = $golddata['cash'] + $golddata['bank'];
                    payuser($stealfrom_id, $returnsteal, 'cash');
                    takegold2($userdata['user_id'], $returnsteal, 'cash', '1');
                    echo $stealfrom_name . $locale['urg_member_128'] . formatMoney($returnsteal) . $locale['urg_member_129'];
                } elseif ($punishment_id == 4) {
                    //the stealee robs you
                    //$returnsteal = $golddata['cash']/2;
                    $returnsteal = $golddata['cash'];
                    payuser($stealfrom_id, $returnsteal, 'cash');
                    takegold2($userdata['user_id'], $returnsteal, 'cash', '1');
                    echo $locale['urg_member_127'] . $stealfrom_name . $locale['urg_member_128'] . formatMoney($returnsteal) . $locale['urg_member_129'];
                } else {
                    echo $locale['urg_member_124'];
                }
            }
        } else {
            echo "<form action='index.php' method='post'>\n";
            echo "<table width='100%' cellpadding='3' cellspacing='3' class='tbl-border'>\n<tr valign='top'>\n";
            echo "<td width='100%' colspan='2'><br />" . $locale['urg_member_130'] . "</td>\n";
            echo "</tr>\n<tr valign='top'>\n";
            echo "<td width='100%' colspan='2'><br />" . $locale['urg_member_131'] . "</td>\n";
            echo "</tr>\n<tr valign='top'>\n";
            echo "<td width='100%' colspan='2'><br />" . $locale['urg_member_132'] . "</td>\n";
            echo "</tr>\n<tr class='tbl2'>\n";
            echo "<td><input type='hidden' name='op' value='member_steal' /></td>\n";
            echo "<td>" . $locale['urg_member_133'] . "<input type='text' class='textbox' name='stealfrom' size='50' />\n";
            echo "<a style='cursor:help;' href='javascript:void(window.open(\"findmember.php?title=findmember\",\"\",\"width=350,height=400\"));'>\n";
            echo "<img src='images/find.png' title='" . $locale['urg_member_107'] . "' alt='" . $locale['urg_member_107'] . "' style='border: 0;' />\n";
            echo "</a></td>\n";
            echo "</tr>\n<tr>\n";
            echo "<td colspan='2' align='center'><input class='button' type='submit' value='" . $locale['urg_member_108'] . "' /></td>\n";
            echo "</tr>\n</table>\n";
            echo "</form>";
        }
    } else {
        echo $locale['urg_member_134'];
    }
    closetable();
}
コード例 #2
0
ファイル: give_gift.php プロジェクト: simplyianm/clububer
        }
    } else {
        redirect(FUSION_SELF . "?gift_id=" . $gift_id . "&error=4");
    }
    //If you didn't write a username at all, you'll gett this error
} else {
    if (!empty($_POST['give_gift']) && empty($_POST['gift_user_name'])) {
        $gift_id = stripinput($_POST['gift_id']);
        redirect(FUSION_SELF . "?gift_id=" . $gift_id . "&error=1");
    }
}
//Here is the Buy Gift content
if (iMEMBER && isset($_GET['gift_id']) && isNum($_GET['gift_id'])) {
    opentable($locale['sfgift900']);
    $result = dbquery("SELECT * FROM " . DB_GIFT . " WHERE gift_id='" . $_GET['gift_id'] . "'");
    $mygold = getusergold($userdata['user_id'], "cash");
    if (dbrows($result)) {
        $data = dbarray($result);
        if ($mygold < $data['gift_price']) {
            $disabled = "disabled";
            echo "<table width='100%' align='center'>\n<tr>\n<td align='center'><b>" . $locale['sfgift920'] . "</b><br /><br /></td>\n</tr>\n</table>\n";
        } else {
            if ($data['gift_stock'] == $data['gift_bought']) {
                $disabled = "disabled";
                echo "<table width='100%' align='center'>\n<tr>\n<td align='center'><b>" . $locale['sfgift921'] . "</b><br /><br /></td>\n</tr>\n</table>\n";
            } else {
                $disabled = "";
            }
        }
        //Error messages
        if (isset($_GET['error']) && $_GET['error'] == "1") {
コード例 #3
0
 if ($_COOKIE['fusion_privmessages'] > $msg_count) {
     $cookievalue = $msg_count;
     setcookie("fusion_privmessages", "{$cookievalue}", time() + 3600, "/", "", "0");
 }
 if ($_COOKIE['fusion_privmessages'] < $msg_count) {
     echo "<script type='text/javascript' language='JavaScript'>window.open('" . BASEDIR . "privmessages.php','PrivateMessages','toolbar=0,scrollbars=0,menubar=0,resizable=0,width=360,height=230')</script>";
     $cookievalue = $msg_count;
     setcookie("fusion_privmessages", "{$cookievalue}", time() + 3600, "/", "", "0");
 }
 // end popup on new pm
 if ($userdata['user_avatar'] != "") {
     echo "<hr><center><img border='0' alt='" . $locale['on106'] . "' title='" . $locale['on106'] . "' src='" . BASEDIR . "images/avatars/" . $userdata['user_avatar'] . "'></center><hr>\n";
 } else {
     echo "<br><center><img border='0' alt='" . $locale['on107'] . "' title='" . $locale['on107'] . "' src='" . INFUSIONS . "user_info_panel/images/noimage.gif'></center><br><hr>\n";
 }
 echo "<center>You are carrying <b>" . getusergold($userdata['user_id'], "cash") . "</b> Bux.</center>";
 echo "<span class='small'><b><a href='" . BASEDIR . "forum/viewforum.php?forum_id=54'>Request a Game</a></b></span><br>";
 echo "<span class='small'><b>" . $locale['on103'] . "</b></span><br>";
 $data = dbarray(dbquery("SELECT user_id,user_name FROM " . $db_prefix . "users WHERE user_status='0' ORDER BY user_joined DESC LIMIT 0,1"));
 echo "<span class='small'>- </span> " . $locale['on117'] . "<a href='" . BASEDIR . "" . url("u", $data['user_id'], $data['user_name']) . "' class='side' title='" . $data['user_name'] . "'>" . trimlink($data['user_name'], 12) . "</a><br>\n<span class='small'>- </span> " . $locale['on100'] . number_format(dbcount("(user_id)", DB_USERS, "user_status<='1'")) . "<br><br>\n<span class='small'><b>" . $locale['on104'] . "</b></span><br>";
 $cond = $userdata['user_level'] != 0 ? "'" . $userdata['user_id'] . "'" : "'0' AND online_ip='" . USER_IP . "'";
 $result = dbquery("SELECT * FROM " . $db_prefix . "online WHERE online_user="******"");
 if (dbrows($result) != 0) {
     $result = dbquery("UPDATE " . $db_prefix . "online SET online_lastactive='" . time() . "' WHERE online_user="******"");
 } else {
     $name = $userdata['user_level'] != 0 ? $userdata['user_id'] : "0";
     $result = dbquery("INSERT INTO " . $db_prefix . "online VALUES('{$name}', '" . USER_IP . "', '" . time() . "')");
 }
 $result = dbquery("DELETE FROM " . $db_prefix . "online WHERE online_lastactive<" . (time() - 60) . "");
 $result = dbquery("SELECT * FROM " . $db_prefix . "online WHERE online_user='******'");
 echo "<span class='small'>- </span> " . $locale['on101'] . dbrows($result) . "<br>\n";
コード例 #4
0
ファイル: functions.php プロジェクト: simplyianm/clububer
function activity_check($gold, $userid)
{
    // NOTES
    // This should not be used unless required to get a check on someone who is not the current user!!
    // Information for the current user is available from
    // $golddata[cash],$golddata[bank],$golddata[chips],$golddata[karma] etc.
    global $locale;
    $mygold = getusergold($userid, 'all');
    if ($mygold < $gold) {
        opentable($locale['urg_functions_111']);
        echo $locale['urg_functions_112'];
        closetable();
        include "footer.php";
        die;
    }
    //$mygold < $gold
}
コード例 #5
0
ファイル: arcade.php プロジェクト: simplyianm/clububer
google_ad_width = 120;
google_ad_height = 600;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</td>

</tr>';
    if ($varcsettings['usergold'] == "1") {
        if (!iMEMBER) {
        } else {
            //edited to work with UG3 and UG2 - Start
            if (USERGOLD) {
                $available = getusergold($userdata['user_id'], 'cash');
            } else {
                $gold = dbarray(dbquery("SELECT * FROM " . $db_prefix . "users_points WHERE owner_id={$userdata['user_id']}"));
                $available = $gold['points_total'] + 1;
            }
            //edited to work with UG3 and UG2 - End
            if ($available <= $game['cost'] && $game['cost'] > 1) {
                if (!isset($p)) {
                    redirect("" . INFUSIONS . "varcade/arcade.php?lackofgold&game=" . $game['lid'] . "");
                } else {
                    redirect("" . INFUSIONS . "varcade/arcade.php?p=1&lackofgold&game=" . $game['lid'] . "");
                }
                exit;
            } else {
                //edited to work with UG3 and UG2 - Start
                if (USERGOLD) {