Example #1
0
function OS_Curl($url)
{
    if (function_exists('curl_init') and os_is_logged()) {
        $ch = curl_init($url);
        curl_setopt($ch, CURLOPT_HEADER, 0);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($ch, CURLOPT_REFERER, $_SERVER['HTTP_REFERER']);
        curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.5) Gecko/20041107 Firefox/1.0');
        $return = curl_exec($ch);
        curl_close($ch);
        return $return;
    }
}
Example #2
0
function OS_RatePlayer($Player, $Slot, $PlayersList, $PlayerRate = 0, $voted = 0, $TotalVotes = 0)
{
    if (isset($_GET["game"]) and os_is_logged() and isset($_SESSION["bnet_username"]) and $voted == 0) {
        $gid = (int) $_GET["game"];
        foreach ($PlayersList as $player) {
            if (trim(strtolower($player)) == strtolower($_SESSION["bnet_username"])) {
                $CanRate = 1;
            } else {
                $voted = 1;
            }
        }
        if (strtolower($_SESSION["bnet_username"]) != strtolower($Player)) {
            if (isset($CanRate)) {
                $voted = 0;
                ?>
         <div id="ratings-<?php 
                echo $Slot;
                ?>
">
		    <!--
		   <input type="button" class="RatingStar" <?php 
                echo ShowToolTip("Rate 1: NOOB!", OS_THEME_PATH . 'images/star-1.png', 200, 32, 32);
                ?>
 onclick="showhide('comment-<?php 
                echo $Slot;
                ?>
')"/>
		    -->
           <a class="RatingStar" href="javascript:;" onclick="RatePlayer('<?php 
                echo $Player;
                ?>
', '<?php 
                echo $gid;
                ?>
', '1', '<?php 
                echo $Slot;
                ?>
')" <?php 
                echo ShowToolTip("Rate 1: NOOB!", OS_THEME_PATH . 'images/star-1.png', 200, 32, 32);
                ?>
></a>
		   <a class="RatingStar" href="javascript:;" onclick="RatePlayer('<?php 
                echo $Player;
                ?>
', '<?php 
                echo $gid;
                ?>
', '2', '<?php 
                echo $Slot;
                ?>
')" <?php 
                echo ShowToolTip("Rate 2: Bad player", OS_THEME_PATH . 'images/star-1.png', 200, 32, 32);
                ?>
></a>
		   <a class="RatingStar" href="javascript:;" onclick="RatePlayer('<?php 
                echo $Player;
                ?>
', '<?php 
                echo $gid;
                ?>
', '3', '<?php 
                echo $Slot;
                ?>
')" <?php 
                echo ShowToolTip("Rate 3: Not bad", OS_THEME_PATH . 'images/star-1.png', 200, 32, 32);
                ?>
></a>
		   <a class="RatingStar" href="javascript:;" onclick="RatePlayer('<?php 
                echo $Player;
                ?>
', '<?php 
                echo $gid;
                ?>
', '4', '<?php 
                echo $Slot;
                ?>
')" <?php 
                echo ShowToolTip("Rate 4: Good player", OS_THEME_PATH . 'images/star-1.png', 200, 32, 32);
                ?>
></a>
		   <a class="RatingStar" href="javascript:;" onclick="RatePlayer('<?php 
                echo $Player;
                ?>
', '<?php 
                echo $gid;
                ?>
', '5', '<?php 
                echo $Slot;
                ?>
')" <?php 
                echo ShowToolTip("Rate 5: Awesome player", OS_THEME_PATH . 'images/star-1.png', 200, 32, 32);
                ?>
></a>
		   
		   <span id="rate-<?php 
                echo $Slot;
                ?>
"></span>
		   
		   <div id="comment-<?php 
                echo $Slot;
                ?>
" style="display:none;">
		     <textarea style="width: 200px; height:60px;" id="rateComment-<?php 
                echo $Slot;
                ?>
" maxlength="255"></textarea>
			 <input type="button" value="Submit" class="menuButtons" onclick="RatePlayer('<?php 
                echo $Player;
                ?>
', '<?php 
                echo $gid;
                ?>
', '<?php 
                echo $rate;
                ?>
', '<?php 
                echo $slot;
                ?>
', 'test' )" /> 
		   </div>
        </div>
   <?php 
            }
        } else {
            ?>
<div>It's you, nab! :-)</div><?php 
        }
    }
    $PlayerRate = ROUND($PlayerRate);
    if ($voted == 1) {
        $LeftStars = 5 - $PlayerRate;
        if ($TotalVotes >= 1) {
            for ($x = 1; $x <= $PlayerRate; $x++) {
                ?>
<img src="<?php 
                echo OS_THEME_PATH;
                ?>
images/star-1.png" width="24" height="24" alt="rating star" /><?php 
            }
        }
        if ($LeftStars >= 1 and $TotalVotes >= 1) {
            for ($x = 1; $x <= $LeftStars; $x++) {
                ?>
<img src="<?php 
                echo OS_THEME_PATH;
                ?>
images/star-0.png" width="24" height="24" alt="rating star" /> <?php 
            }
        }
        if ($TotalVotes >= 1) {
            ?>
( votes: <?php 
            echo $TotalVotes;
            ?>
)<?php 
        }
    }
}
Example #3
0
    $ChatOpen = 1;
    if (isset($_POST["SendSubmit"]) and isset($_POST["commandSend"])) {
        $sendTo = trim(htmlentities($_GET["c"]));
        $message = trim(strip_tags(htmlentities($_POST["commandSend"])));
        $message = substr($message, 0, 400);
        $command = "!say /w {$chatWith} [" . $_SESSION["username"] . "]: {$message} ";
        if (strlen($message) >= 2) {
            $db->insert(OSDB_COMMANDS, array("botid" => 1, "command" => $command));
            $InsertID = $db->lastInsertId();
            $return = "<div>" . $lang["chat_successfull"] . "</div>";
            $return .= "<div><b>[" . $_SESSION["username"] . "]:</b> {$message}</div>";
        } else {
            $return = $lang["chat_error1"];
        }
    }
    if (!os_is_logged()) {
        $dis = 'disabled';
        $message = $lang["you_must_be"] . " <a href='" . OS_HOME . "?login'>" . $lang["logged_in"] . "</a> " . $lang["to_use_feature"];
    } else {
        $dis = "";
        $message = "";
    }
} else {
    if ($LiveGamesLimit >= 1) {
        $LIMIT = "LIMIT {$LiveGamesLimit}";
    }
    $sql = " ";
    //Limit to botid 1 - for other users - SHOW ALL for admins
    //if (os_is_logged() AND $_SESSION["level"]>=9 ) $sql = " ";
    //else $sql = " AND botid = 1";
    $sth = $db->prepare("SELECT * FROM " . OSDB_GAMESTATUS . " WHERE gamestatus<=2 \n\t AND gametime>=NOW()-INTERVAL 2 hour\n\t {$sql}\n     ORDER BY gamestatus ASC, gametime DESC {$LIMIT}");
Example #4
0
 if (isset($_GET["items"]) and $ItemsPage == 1) {
     include OS_PAGE_PATH . "items_page.php";
 } else {
     if (isset($_GET["item"]) and $ItemsPage == 1) {
         include OS_PAGE_PATH . "single_item_page.php";
     } else {
         if (isset($_GET["common_games"])) {
             include OS_PAGE_PATH . "common_games.php";
         } else {
             if (OS_is_home_page()) {
                 include OS_PAGE_PATH . "home_page.php";
             } else {
                 if (isset($_GET["profile"]) and os_is_logged()) {
                     include OS_PAGE_PATH . "user_profile_page.php";
                 } else {
                     if (isset($_GET["profile"]) and !os_is_logged()) {
                         header("location: " . OS_HOME . "?login");
                         die;
                     } else {
                         if (isset($_GET["ban_report"]) and $BanReports == 1) {
                             include OS_PAGE_PATH . "ban_reports_page.php";
                         } else {
                             if (isset($_GET["ban_appeal"])) {
                                 include OS_PAGE_PATH . "ban_appeals_page.php";
                             } else {
                                 if (isset($_GET["moderator"])) {
                                     include OS_PAGE_PATH . "moderator_page.php";
                                 }
                             }
                         }
                     }
Example #5
0
                                    echo $row["id"];
                                    ?>
"><?php 
                                    echo $player;
                                    ?>
</a></div>
	 <?php 
                                }
                                ?>
	</div>
	<?php 
                            } else {
                                if (isset($_POST["insult"])) {
                                    // Nothing do to here!
                                } else {
                                    if (os_is_logged() and isset($_REQUEST["ratings"]) and isset($_SESSION["bnet_username"])) {
                                        $bl = explode(',', $RatePlayersBlackList);
                                        if (in_array(strtolower($_SESSION["bnet_username"]), $bl)) {
                                            die("<span style='color:red'>Rating is disabled for you!</span>");
                                        }
                                        if (isset($_POST["player"]) and isset($_POST["gameid"]) and isset($_POST["rate"]) and isset($_POST["slot"])) {
                                            $Player = trim(strip_tags($_POST["player"]));
                                            $gameid = trim((int) $_POST["gameid"]);
                                            $rate = trim((int) $_POST["rate"]);
                                            $slot = trim((int) $_POST["slot"]);
                                            $voter = trim($_SESSION["bnet_username"]);
                                            $comment = trim(strip_tags($_POST["comment"]));
                                            //$CHECK1 = 1;
                                            if ($rate <= 4 and isset($CHECK1) and !empty($comment)) {
                                                ?>
		 <div style="position:fixed;
Example #6
0
    header('HTTP/1.1 404 Not Found');
    die;
}
$PluginEnabled = '1';
//Enable edit plugin optins
//$PluginOptions = '1';
//unset($_SESSION["password_send"] );
if ($PluginEnabled == 1) {
    if (OS_login_page() and !os_is_logged()) {
        AddEvent("os_login_fields", "OS_ForgotPasswordLink");
    }
    if (OS_GetAction("reset_password") and os_is_logged()) {
        header('location:' . OS_HOME . '');
        die;
    }
    if (OS_GetAction("reset_password") and !os_is_logged()) {
        AddEvent("os_content", "OS_ForgotPassword");
        $HomeTitle = "Password reminder";
    }
    function OS_ForgotPasswordLink()
    {
        ?>
   <tr>
     <td></td>
	 <td class="padLeft">
	   <div><a href="<?php 
        echo OS_HOME;
        ?>
?action=reset_password">Forgot your password?</a></div>
	 </td>
	</tr>
        header("location: " . $_SESSION["logout"] . "");
        die;
    } else {
        if (isset($_GET["forum"])) {
            header("location: " . OS_HOME . "?login");
            die;
        }
        header("location: " . OS_HOME . "");
        die;
    }
}
if (isset($_GET["forum"]) and os_is_logged()) {
    os_logout();
}
//Resend Activation code
if (!os_is_logged() and isset($_GET["resend"]) and !empty($_GET["resend"]) and !isset($_SESSION["email_send"])) {
    $email = $_GET["resend"];
    $errors = "";
    if (!preg_match("/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\\.[A-Z]{2,6}\$/i", $email)) {
        $errors .= "<div>" . $lang["error_email"] . "</div>";
    }
    if (empty($errors)) {
        $sth = $db->prepare("SELECT * FROM " . OSDB_USERS . " WHERE user_email=:user_email AND code!='' ");
        $sth->bindValue(':user_email', $email, PDO::PARAM_STR);
        $result = $sth->execute();
        if ($sth->rowCount() >= 1) {
            $row = $sth->fetch(PDO::FETCH_ASSOC);
            $message = $lang["email_activation1"] . " " . $row["user_name"] . ",<br /><br />";
            $message .= $lang["email_activation2"] . " " . OS_HOME . " <br />";
            $message .= $lang["email_activation3"] . "<br /><br />";
            $message .= OS_HOME . "?login&code=" . $row["code"] . "&e=" . $row["user_email"] . "<br />";
Example #8
0
        echo $MenuClass["fb"];
        ?>
"><a href="<?php 
        echo OS_HOME;
        ?>
?action=facebook"><img src="<?php 
        echo OS_HOME;
        ?>
img/fb.png" alt="fb" class="imgvalign" width="16" height="16" /> LOGIN</a></li>
   <?php 
    }
}
?>
   
   <?php 
if (os_is_logged()) {
    ?>
   <li class="<?php 
    echo $MenuClass["profile"];
    ?>
">
    <a href="<?php 
    echo OS_HOME;
    ?>
?profile"><b><?php 
    echo substr($_SESSION["username"], 0, 30);
    ?>
</b> <?php 
    if (isset($_SESSION["bnet"])) {
        echo OS_bnet_icon($_SESSION["bnet"], 24, 24, "imgvalign", 0);
        ?>
function OS_GetPlayerList($DataArray, $chatID = 0, $lastID = 0, $click = 0)
{
    global $lang;
    $kills = "";
    $deaths = "";
    $assists = "";
    $tk = "";
    $td = "";
    //$HTML = "<h3>List of players #".$chatID."</h3>";
    $HTML = "<table class='PlayerLogInfoTable'><tr><th width='230'>#" . $chatID . " &nbsp;&nbsp; " . $lang["gl_playerlist_sentinel_title"] . "</th><th class='padLeft'>" . $lang["gl_playerlist_kda"] . "</th><th>T/D</th></tr>";
    $SentKills = 0;
    $ScourKills = 0;
    //PLAYER INFO - HERO ICON and KDA
    $DataArray2 = array_reverse($DataArray);
    $c = 1;
    //Detect if playerdata exists (HID and KDA)
    if ($click == 1) {
        $PlayerInfoData = 1;
    } else {
        $PlayerInfoData = 0;
    }
    $PlayerData = array();
    foreach ($DataArray2 as $Info) {
        $Log2 = explode("\t", $Info);
        if (isset($Log2[0])) {
            $event = $Log2[0];
        } else {
            $event = "";
        }
        if ($event == 6) {
            $PlayerInfoData = 1;
            if (isset($Log2[2])) {
                $PlayerData[$c]["hid"] = strtoupper($Log2[2]);
            } else {
                $PlayerData[$c]["hid"] = "";
            }
            if (isset($Log2[2])) {
                $PlayerData[$c]["level"] = strtoupper($Log2[4]);
            } else {
                $PlayerData[$c]["level"] = "";
            }
            if (isset($Log2[5])) {
                $PlayerData[$c]["kda"] = strtoupper($Log2[5]);
            } else {
                $PlayerData[$c]["kda"] = "";
            }
            if (isset($Log2[6])) {
                $PlayerData[$c]["td"] = strtoupper($Log2[6]);
            } else {
                $PlayerData[$c]["td"] = "";
            }
            //Try to fix bug with player levels - currently disabled!
            if ($PlayerData[$c]["level"] > 25) {
                // if (!empty($PlayerData[$c]["hid"]) ) { $PlayerData[$c]["level"] = $PlayerData[$c]["level"]; } ; else $PlayerData[$c]["level"] = "-";
                //if (empty($PlayerData[$c]["hid"]) ) $PlayerData[$c]["level"] = "-";
            }
            $c++;
        }
    }
    //END -----> PLAYER INFO - HERO ICON and KDA
    foreach ($DataArray as $Data) {
        $Log = explode("\t", $Data);
        if (isset($Log[0]) and $Log[0] != '-') {
            $info = $Log[0];
        } else {
            $info = "";
        }
        if (isset($Log[1]) and $Log[1] != '-') {
            $event = $Log[1];
        } else {
            $event = "";
        }
        //echo $Log[6]."<br>";
        $EmptySlot = ' - ';
        if ($info == 2 or $info == 4) {
            $PlayerInfoData = 1;
        }
        //Always update for lobby
        if ($event == "pl" and !isset($PlayerData[$c]["hid"]) and empty($PlayerData[$c]["hid"])) {
            $Logs = explode("\t", $Data);
            $slots = array();
            for ($i = 1; $i <= 10; $i++) {
                if (isset($Logs[$i + 1]) and $Logs[$i + 1] != '-') {
                    $slots[$i] = $Logs[$i + 1];
                } else {
                    $slots[$i] = $EmptySlot;
                }
            }
            $c = 1;
            foreach ($slots as $slot) {
                $link = OS_HOME . "?live_games&c=" . $slot . "&id=" . $chatID . "&l=" . $lastID . "&hash=" . md5($slot);
                $alert = 'onclick="alert(\'Chat with ' . $slot . ' is currently unavailable.\')"';
                if (isset($PlayerData[$c]["hid"]) and !empty($PlayerData[$c]["hid"])) {
                    $Hero = '<img src="' . OS_HOME . 'img/heroes/' . $PlayerData[$c]["hid"] . '.gif" width="24" height="24" class="imgvalign" alt="h" />';
                } else {
                    $Hero = '<img src="' . OS_HOME . 'img/heroes/blank.gif" width="24" height="24" class="imgvalign" alt="h" />';
                }
                if (isset($PlayerData[$c]["level"])) {
                    $Level = '(' . $PlayerData[$c]["level"] . ')';
                } else {
                    $Level = "";
                }
                //KD
                if (isset($PlayerData[$c]["kda"])) {
                    $KDAData = explode("/", $PlayerData[$c]["kda"]);
                    if (isset($KDAData[0])) {
                        $kills = '<span class="won">' . $KDAData[0] . '<span> / ';
                    } else {
                        $KDAData[0] = "";
                    }
                    if (isset($KDAData[1])) {
                        $deaths = '<span class="lost">' . $KDAData[1] . '<span> / ';
                    } else {
                        $KDAData[1] = "";
                    }
                    if (isset($KDAData[2])) {
                        $assists = '<span class="assists">' . $KDAData[2] . '<span>';
                    } else {
                        $KDAData[2] = "";
                    }
                    $kda = '<span>' . $kills . $deaths . $assists . "</span>";
                    if (isset($KDAData[0])) {
                        $killsData = $KDAData[0];
                    } else {
                        $killsData = "";
                    }
                } else {
                    $kda = "";
                    $killsData = "";
                }
                //TD
                if (isset($PlayerData[$c]["td"])) {
                    $TDData = explode("/", $PlayerData[$c]["td"]);
                    if (isset($TDData[0])) {
                        $tk = $TDData[0] . "/";
                    } else {
                        $tk = "";
                    }
                    if (isset($TDData[1])) {
                        $td = $TDData[1];
                    } else {
                        $td = "";
                    }
                }
                $chatIcon = '<a onMouseout="hidetooltip()" onclick="hidetooltip()" onMouseover="tooltip(\'<b>' . $slot . '</b><br />' . $lang["gl_playerlist_send"] . ' \', \'' . OS_HOME . 'img/chat-icon.png\', 160, 32, 32)" href="' . $link . '" target="_blank" ><img class="PlayerListChat" src="' . OS_HOME . 'img/chat-icon.png" alt="chat" width="16" height="16" class="imgvalign" /></a>';
                //$chatIcon ="";
                if (os_is_logged() and $_SESSION["level"] >= 9) {
                    $AdminCommands = '<a href="javascript:;" onclick="showhide(\'adm' . $c . '\')"><img style="float:right; padding-right: 5px;" src="' . OS_HOME . 'img/cfg.png" class="imgvalign" width="16" height="16" /></a><div id="adm' . $c . '" style="display:none; padding-left:16px;"><a href="javascript:;" onclick="if (confirm(\'Mute player [' . $slot . '] ?\') ) { OS_AdminExec(\'mute\', \'' . $slot . '\') } ">mute</a> | <a href="javascript:;" onclick="if (confirm(\'Unmute player [' . $slot . '] ?\') ) { OS_AdminExec(\'unmute\', \'' . $slot . '\') } ">unmute</a> | <a href="javascript:;" onclick="if (confirm(\'KICK player [' . $slot . '] ?\') ) { OS_AdminExec(\'kick\', \'' . $slot . '\') } ">kick</a> | <a href="javascript:;" onclick="if (confirm(\'Ban player [' . $slot . '] ?\') ) window.open(\'' . OS_HOME . 'adm/?bans&add=' . $slot . '&gid=' . $chatID . '\', \'_blank\')">ban</a></div>';
                } else {
                    $AdminCommands = "";
                }
                if ($c >= 6 and !isset($scourgeTable)) {
                    $scourgeTable = 1;
                    $HTML .= '</tr></table>';
                    $HTML .= "<table class='PlayerLogInfoTable'><tr><th width='230'>#" . $chatID . " &nbsp;&nbsp; " . $lang["gl_playerlist_scourge_title"] . "</th><th class='padLeft'>" . $lang["gl_playerlist_kda"] . "</th><th>T/D</th></tr>";
                }
                if (!isset($scourgeTable)) {
                    $SentKills += $killsData;
                } else {
                    $ScourKills += $killsData;
                }
                if (trim($slot) == "-") {
                    $HTML .= '</tr><td width="230"><div class="PlayerListSingle slot' . $c . '"> &nbsp; ' . $slot . ' </div> </td><td></td><td></td></tr>';
                } else {
                    $HTML .= '<tr><td  width="230"><div class="PlayerListSingle slot' . $c . '"> &nbsp;' . $Hero . '&nbsp; <a target="_blank" href="' . OS_HOME . '?u=' . strtolower($slot) . '"><span class="col' . $c . '">' . $slot . '</span></a> ' . $Level . ' ' . $chatIcon . '  ' . $AdminCommands . '</td><td class="PlayerListSingle">' . $kda . ' </div> <div class="PLClear">&nbsp;</div></td><td>' . $tk . '' . $td . '</td></tr>';
                }
                $c++;
            }
        }
    }
    $HTML .= "</table>";
    $TeamScores = "<table class='TeamScores'><tr><td><span class='sentinelKills'><b>" . $lang["gl_playerlist_sentinel"] . "</b></span> {$SentKills} : {$ScourKills} <span class='scourgeKills'><b>" . $lang["gl_playerlist_scourge"] . "</b></span></td><td></td></tr></table>";
    $OUTPUT = $TeamScores . $HTML;
    if ($PlayerInfoData == 0) {
        $OUTPUT = "updating";
    }
    return $OUTPUT;
}
Example #10
0
}
//DELETE COMMENT - ADMIN
if (os_is_logged() and isset($_SESSION["level"]) and $_SESSION["level"] >= 9 and isset($_GET["delete_comment"]) and isset($_GET["post_id"])) {
    $id = safeEscape((int) $_GET["delete_comment"]);
    $pid = safeEscape((int) $_GET["post_id"]);
    $del_1 = $db->exec("DELETE FROM " . OSDB_COMMENTS . " WHERE id = '" . (int) $id . "' AND post_id = '" . (int) $pid . "' LIMIT 1");
    $sth = $db->prepare("SELECT COUNT(*) FROM " . OSDB_COMMENTS . " WHERE post_id=:post_id LIMIT 1");
    $sth->bindValue(':post_id', (int) $pid, PDO::PARAM_INT);
    $result = $sth->execute();
    $r = $sth->fetch(PDO::FETCH_NUM);
    $TotalComments = $r[0];
    $update = $db->exec("UPDATE " . OSDB_NEWS . " SET comments = '" . (int) $TotalComments . "' WHERE news_id = '" . (int) $pid . "' ");
    header('location: ' . OS_HOME . '?post_id=' . $pid . '#comments');
    die;
}
if (isset($_POST["add_comment"]) and os_is_logged() and isset($_GET["post_id"]) and is_numeric($_GET["post_id"]) and isset($_SESSION["code"]) and isset($_POST["code"]) and isset($_POST["pid"])) {
    require_once OS_PLUGINS_DIR . 'index.php';
    os_init();
    $id = safeEscape((int) $_GET["post_id"]);
    $text = OS_StrToUTF8($_POST["post_comment"]);
    $text = PrepareTextDB($text);
    //$text = EscapeStr( ($text) );
    //$text = (($text));
    $errors = "";
    //Check if comments is allowed for this post
    $sth = $db->prepare("SELECT * FROM " . OSDB_NEWS . " WHERE news_id=:news_id AND allow_comments = 1");
    $sth->bindValue(':news_id', (int) $id, PDO::PARAM_INT);
    $result = $sth->execute();
    if ($sth->rowCount() <= 0) {
        $errors .= "<div>" . $lang["error_comment_not_allowed"] . "</div>";
    }
Example #11
0
        $GamesData[$c]["assists"] = $row["assists"];
    } else {
        $GamesData[$c]["assists"] = "0";
    }
    if (isset($row["neutralkills"])) {
        $GamesData[$c]["neutrals"] = $row["neutralkills"];
    } else {
        $GamesData[$c]["neutrals"] = "0";
    }
    if (isset($row["player"])) {
        $GamesData[$c]["player"] = $row["player"];
    }
    $c++;
}
//MODERATE USER
if (os_is_logged() and $_SESSION["level"] >= 5 and isset($_GET["mcp"])) {
    $uid = safeEscape((int) $_GET["u"]);
    $HomeTitle .= " :: Moderator Control Panel";
    //REMOVE BAN
    if (isset($_GET["rban"]) and is_numeric($_GET["rban"])) {
        $upd = $db->prepare("DELETE FROM " . OSDB_BANS . " WHERE id='" . (int) $_GET["rban"] . "' ");
        $result = $upd->execute();
        $upd2 = $db->prepare("UPDATE " . OSDB_STATS . " SET banned = '0' WHERE player = '" . $PlayerName . "' ");
        $result = $upd2->execute();
        $upd3 = $db->prepare("UPDATE " . OSDB_STATS_P . " SET banned = '0' WHERE player = '" . $PlayerName . "' ");
        $result = $upd3->execute();
        OS_AddLog($_SESSION["username"], "[os_moderator] Removed Ban: {$PlayerName} ");
        header("location: " . OS_HOME . "?u=" . $uid . "&mcp");
        die;
    }
    //ADD BAN
Example #12
0
 $GameData[$c]["totalrate"] = $rates["totalrate"];
 if ($rates["totalrate"] >= 1) {
     $GameData[$c]["player_rate"] = $rates["totalrate"] / $rates["totalvotes"];
 } else {
     $GameData[$c]["player_rate"] = 0;
 }
 //Check if we already rated
 $GameData[$c]["voted"] = 0;
 if (!os_is_logged()) {
     $GameData[$c]["voted"] = 1;
 }
 //Limit votes for 2 days
 if ($GameDateTime + 3600 * 24 * 3 <= time()) {
     $GameData[$c]["voted"] = 1;
 } else {
     if (os_is_logged() and isset($_SESSION["bnet_username"]) and $GameData[$c]["voted"] == 0) {
         $voter = trim($_SESSION["bnet_username"]);
         if (strtolower($voter) == strtolower($row["name"])) {
             $GameData[$c]["voted"] = 1;
         } else {
             $sth3 = $db->prepare("SELECT COUNT(*) FROM " . OSDB_GPR . " \n\t\tWHERE player='" . $row["name"] . "' AND voter = '" . $voter . "' AND gameid = '" . $gameid . "'");
             $result3 = $sth3->execute();
             $r = $sth3->fetch(PDO::FETCH_NUM);
             $numrows = $r[0];
             if ($numrows >= 1) {
                 $GameData[$c]["voted"] = 1;
             }
         }
     }
 }
 $GameData[$c]["heroid"] = $row["hero"];