Esempio n. 1
0
    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>
   <?php 
Esempio n. 2
0
" class="padLeft imgvalign"><?php 
            echo $txt1;
            ?>
 <?php 
            echo $goalValue;
            echo $more;
            ?>
 <?php 
            echo $txt2;
            ?>
 ( <?php 
            echo $value;
            echo $more;
            ?>
 )</td>
	</tr>
	<?php 
        }
    }
    function OS_AchievementIcon($image, $achieved = 1)
    {
        if ($achieved == 0) {
            $style = 'style="opacity: 0.1; filter: alpha(opacity = 15);"';
        } else {
            $style = "";
        }
        $icon = '<img ' . $style . ' src="' . OS_HOME . OS_PLUGINS_DIR . '/achievements/' . $image . '" alt="image" width="64" height="64" />';
        return $icon;
    }
    AddEvent("os_display_custom_fields", "OS_UserAchievements");
}
<?php

//Plugin: Captcha on registration
//Author: Ivan
//Adds simple captcha on registration
if (!isset($website)) {
    header('HTTP/1.1 404 Not Found');
    die;
}
$PluginEnabled = '1';
if ($PluginEnabled == 1) {
    AddEvent("os_start", "OS_CheckCaptchaRegistration", 1);
    AddEvent("os_registration_fields", "OS_CaptchaOnRegistration");
    function OS_CheckCaptchaRegistration()
    {
        $error = "";
        if (isset($_SESSION["r_code"]) and $_SESSION["r_code"] == "OK") {
            /* CAPTCHA OK */
        } else {
            if (isset($_POST["register_"])) {
                $error = "";
                if (!isset($_POST["r_captcha"]) or !isset($_SESSION["r_code"])) {
                    $error .= "<h2>Invalid captcha form</h2>";
                } else {
                    if ($_POST["r_captcha"] != $_SESSION["r_code"]) {
                        $error .= "<h2>Invalid captcha code</h2>";
                    } else {
                        if (!isset($_SESSION["r_trap1"]) or !isset($_SESSION["r_trap2"])) {
                            $error .= "<h2>Invalid captcha form</h2>";
                        } else {
                            if (!isset($_POST[$_SESSION["r_trap1"]])) {
Esempio n. 4
0
<?php

//Plugin: Captcha on comments
//Author: Ivan
//Adds simple captcha on comments
if (!isset($website)) {
    header('HTTP/1.1 404 Not Found');
    die;
}
$PluginEnabled = '0';
if ($PluginEnabled == 1) {
    AddEvent("os_init", "OS_CheckCaptcha", 1);
    AddEvent("os_after_comment_form", "OS_SimpleCaptcha");
    AddEvent("os_comment_form", "OS_Anchor");
    function OS_Anchor()
    {
        ?>
   <a href="javascript:;" name="SubmitComment"></a>
   <?php 
    }
    function OS_SimpleCaptcha()
    {
        $code = strtoupper(generate_hash(5));
        $code = str_replace(array("o", "0"), array("x", "x"), $code);
        $_SESSION["c_code"] = $code;
        ?>
	<table>
	 <tr>
	   <td width="68"><input type="text" size="3" value="" name="c_code" /> </td>
	   <td><h2><?php 
        echo $code;
Esempio n. 5
0
		</select><div>' . $info . '</div></td>
	  </tr>
	  <tr>
	    <td width="150"></td>
		<td>
		<input type="submit" value = "Submit" class="menuButtons" />
		<a href="' . OS_HOME . 'adm/?plugins" class="menuButtons">&laquo; Back</a>
		</td>
	  </tr> 
	</table>
    </form>';
    }
    if (!is_logged() and (OS_GetAction("facebook") or isset($_GET["fb"]))) {
        AddEvent("os_start", "OS_RedirectFB");
        AddEvent("os_content", "OS_FacebookLogin");
        AddEvent("os_start", "OS_CheckFacebookLogin");
    }
    if (OS_GetAction("facebook") and is_logged()) {
        header('location:' . OS_HOME . '');
        die;
    }
    function OS_CheckFacebookLogin()
    {
        if (isset($_POST["fb_name"]) and isset($_POST["fb_email"]) and isset($_POST["fb_id"])) {
            global $db;
            $errors = '';
            $FBID = trim($_POST["fb_id"]);
            $gender = safeEscape(trim($_POST["fb_gender"]));
            $name = strip_tags(trim($_POST["fb_name"]));
            $email = safeEscape(trim($_POST["fb_email"]));
            $IP = safeEscape($_SERVER["REMOTE_ADDR"]);
Esempio n. 6
0
         $uc++;
     }
     $Option .= '</table>';
     $Option .= '<div><b>Total:</b> ' . $sth->rowCount() . ' &nbsp; <a href="' . OS_HOME . 'adm/?plugins" class="menuButtons">&laquo; Back</a> </div>';
     $Option .= '';
     if (isset($GeoIP) and $GeoIP == 1) {
         geoip_close($GeoIPDatabase);
     }
 }
 AddEvent("os_start", "OS_TrackUsers");
 //Shows only on Home Page
 if (!$_GET) {
     AddEvent("os_after_content", "OS_ShowOnline");
 }
 //Remove data from database on logout
 AddEvent("os_init", "OS_LogOutDeleteOnline");
 function OS_TrackUsers()
 {
     global $db;
     if (is_logged()) {
         $uid = $_SESSION["user_id"];
     } else {
         $uid = 0;
     }
     $CurrentTime = time();
     //purge old sessions
     $del = $db->prepare("DELETE FROM `online_users` WHERE timedate<'" . ($CurrentTime - OS_OnlineTime) . "' ");
     $result = $del->execute();
     //LOGGED USERS
     if (is_logged()) {
         $sth = $db->prepare("SELECT COUNT(*) FROM `online_users` WHERE user_id>= 1 AND user_id =:uid");
Esempio n. 7
0
<?php

//Plugin: Top By Country
//Author: Ivan
//Display most players from country
if (!isset($website)) {
    header('HTTP/1.1 404 Not Found');
    die;
}
$PluginEnabled = '1';
if ($PluginEnabled == 1) {
    AddEvent("os_add_menu_misc", "OS_TopByCountry");
    if (OS_GetAction("top_country")) {
        AddEvent("os_content", "OS_ShowTopCountry");
    }
    function OS_TopByCountry()
    {
        ?>
	<li><a href="<?php 
        echo OS_HOME;
        ?>
?action=top_country">Top Players by Country</a></li>
	<?php 
    }
    function OS_ShowTopCountry()
    {
        global $db;
        //TOP BY COUNTRIES
        $sth = $db->prepare("SELECT COUNT( country_code ) AS total, country_code \n    FROM  `" . OSDB_STATS . "` \n    GROUP BY country_code\n    ORDER BY total DESC \n    LIMIT 100");
        $result = $sth->execute();
        $c = 0;
Esempio n. 8
0
    function OS_PMMenu()
    {
        //BUG - or something must be fixed...link only
        global $db;
        //$db = new db("mysql:host=".OSDB_SERVER.";dbname=".OSDB_DATABASE."", OSDB_USERNAME, OSDB_PASSWORD);
        $sth = $db->prepare("SELECT COUNT(*) FROM " . OSDB_CUSTOM_FIELDS . " as c WHERE c.field_name LIKE ('%||p.m.0') AND c.field_id = ? ");
        $sth->bindValue(1, OS_GetUserID(), PDO::PARAM_INT);
        $result = $sth->execute();
        $r = $sth->fetch(PDO::FETCH_NUM);
        $numrows = $r[0];
        if ($numrows >= 1) {
            ?>
	<li><a href="<?php 
            echo OS_HOME;
            ?>
?action=pm&amp;inbox"><b>(<?php 
            echo $numrows;
            ?>
) My Messages</b></a></li>
	<?php 
            if (!OS_GetAction("pm")) {
                AddEvent("os_content", "OS_PMNewMessageNotification");
            }
        } else {
            ?>
<li><a href="<?php 
            echo OS_HOME;
            ?>
?action=pm&amp;inbox">(<?php 
            echo $numrows;
            ?>
) My Messages</a></li><?php 
        }
        ?>
<li><a href="<?php 
        echo OS_HOME;
        ?>
?action=pm&amp;inbox">My Messages</a></li><?php 
    }
Esempio n. 9
0
<?php

//Plugin: Scroll to top (jQuery)
//Author: Ivan
//Scroll to top plugin. <b>jQuery</b> must be enabled.
if (!isset($website)) {
    header('HTTP/1.1 404 Not Found');
    die;
}
$PluginEnabled = '1';
if ($PluginEnabled == 1) {
    AddEvent("os_head", "OS_ScrollToTop");
    function OS_ScrollToTop()
    {
        ?>
<script type="text/javascript">	
jQuery.noConflict();
var $jq = jQuery;
$jq(function(){
			
  //$("#content").remove();
  $jq("body").append('<div id="scroll_to_top"><a href="#top">Go top</a></div>');
  $jq("#scroll_to_top a").css({'display' : 'none', 'z-index' : '9', 'position' : 'fixed', 'top' : '100%', 'width' : '72px', 'margin-top' : '-55px', 'right' : '50px', 'margin-left' : '-50px', 'height' : '20px', 'padding' : '3px 5px', 'font-size' : '14px', 'text-align' : 'center', 'padding' : '3px', 'color' : '#ffffff', 'background-color' : '#222222', '-moz-border-radius' : '5px', '-khtml-border-radius' : '5px', '-webkit-border-radius' : '5px', 'opacity' : '.8', 'text-decoration' : 'none'});	
  
  $jq('#scroll_to_top a').click(function(){
  $jq('html, body').animate({scrollTop:0}, 'slow');
  });
  
  $jq('.gototop').remove(); //Remove go to top (in template)
  
	var scroll_timer;
Esempio n. 10
0
 function OS_Signatures()
 {
     if (isset($_GET["sig"]) or !isset($_GET["user"])) {
         if (SIG_USE == 1 and !is_logged()) {
         } else {
             AddEvent("os_content", "OS_ShowSignature");
         }
     }
     if (isset($_GET["user"]) and is_numeric($_GET["user"])) {
         global $db;
         global $lang;
         $userID = safeEscape((int) $_GET["user"]);
         $SigPath = SIG_PATH . "user_" . $userID . ".jpg";
         if (file_exists($SigPath) and time() - SIG_CACHE * 60 < filemtime($SigPath)) {
             $NewImage = imagecreatefromjpeg($SigPath);
             //image create by existing image
             header("Content-type: image/jpeg");
             // out out the image
             //imagejpeg($NewImage);//Output image to browser
             //file_put_contents('img/signatures/html.html', 'aaa');
             echo file_get_contents($SigPath);
             exit;
         }
         $sth = $db->prepare("SELECT * FROM " . OSDB_STATS . " WHERE id = :uid ");
         $sth->bindValue(':uid', $userID, PDO::PARAM_INT);
         $result = $sth->execute();
         if ($sth->rowCount() >= 1) {
             $row = $sth->fetch(PDO::FETCH_ASSOC);
             $id = (int) $row["id"];
             $player = $row["player"];
             $score = number_format($row["score"], 0);
             $games = number_format($row["games"], 0);
             $wins = number_format($row["wins"], 0);
             $losses = number_format($row["losses"], 0);
             $draw = number_format($row["draw"], 0);
             $kills = number_format($row["kills"], 0);
             $deaths = number_format($row["deaths"], 0);
             $assists = number_format($row["assists"], 0);
             $creeps = number_format($row["creeps"], 0);
             $denies = number_format($row["denies"], 0);
             $neutrals = number_format($row["neutrals"], 0);
             $towers = $row["towers"];
             $rax = $row["rax"];
             $banned = $row["banned"];
             $ip = $row["ip"];
             include "inc/geoip/geoip.inc";
             $GeoIPDatabase = geoip_open("inc/geoip/GeoIP.dat", GEOIP_STANDARD);
             $letter = geoip_country_code_by_addr($GeoIPDatabase, $ip);
             $country = geoip_country_name_by_addr($GeoIPDatabase, $ip);
             if (empty($letter)) {
                 $letter = "blank";
                 $country = "Reserved";
             }
             if ($row["wins"] == 0 and $row["wins"] + $row["losses"] == 0) {
                 $winloose = 0;
             } else {
                 $winloose = round($row["wins"] / ($row["wins"] + $row["losses"]), 3) * 100;
             }
             if ($row["kills"] >= 1) {
                 $killsPerGame = ROUND($row["kills"] / $row["games"], 1);
             } else {
                 $killsPerGame = 0;
             }
             $sth = $db->prepare("SELECT \n\t\tSUM(`left`) \n\t\tFROM " . OSDB_GP . " \n\t\tWHERE LOWER(name)= :player LIMIT 1");
             $sth->bindValue(':player', strtolower($player), PDO::PARAM_STR);
             $result = $sth->execute();
             $res = $sth->fetch(PDO::FETCH_ASSOC);
             $TotalDuration = secondsToTime($res["SUM(`left`)"]);
             $TotalHours = ROUND($res["SUM(`left`)"] / 3600, 1);
             $TotalMinutes = ROUND($res["SUM(`left`)"] / 3600 * 60, 1);
             $TimePlayed = secondsToTime($res["SUM(`left`)"], $lang["h"], $lang["m"], $lang["s"]);
             $dbh = $db->prepare(OS_MostPlayedHero(strtolower($player)));
             $result = $dbh->execute();
             $r = $dbh->fetch(PDO::FETCH_ASSOC);
             $MostPlayedHero = strtoupper($r["original"]);
             $MostPlayedHeroName = $r["description"];
             $MostPlayedCount = $r["played"];
             $MostPlayedTime = secondsToTime($r["timeplayed"]);
             $NewImage = imagecreatefromjpeg(SIG_PATH . "_signature.jpg");
             $TextColor = imagecolorallocate($NewImage, 255, 246, 0);
             //text color - RGB
             $TextColor2 = imagecolorallocate($NewImage, 255, 255, 255);
             //text color - RGB
             $TextColor3 = imagecolorallocate($NewImage, 253, 193, 193);
             //text color - RGB
             imagestring($NewImage, 5, 10, 1, $player, $TextColor);
             //score
             imagestring($NewImage, 2, 10, 26, "Score:", $TextColor3);
             imagestring($NewImage, 2, 68, 26, $score, $TextColor2);
             //games
             imagestring($NewImage, 2, 10, 42, "Games:", $TextColor3);
             imagestring($NewImage, 2, 68, 42, $games, $TextColor2);
             //wins
             imagestring($NewImage, 2, 10, 58, "Wins:", $TextColor3);
             imagestring($NewImage, 2, 68, 58, $winloose . "%", $TextColor2);
             //Kills Per Game
             imagestring($NewImage, 2, 10, 82, $killsPerGame . " Kills per game", $TextColor2);
             //imagestring($NewImage, 2, 102, 82,$kpg, $TextColor2);
             //duration
             imagestring($NewImage, 2, 10, 98, "Time:", $TextColor3);
             imagestring($NewImage, 2, 52, 98, $TimePlayed, $TextColor2);
             //Creep Kills
             imagestring($NewImage, 2, 140, 82, "Creeps:", $TextColor3);
             imagestring($NewImage, 2, 200, 82, $creeps, $TextColor2);
             //Creep Denies
             imagestring($NewImage, 2, 140, 98, "Denies:", $TextColor3);
             imagestring($NewImage, 2, 200, 98, $denies, $TextColor2);
             //kills
             imagestring($NewImage, 2, 140, 26, "Kills:", $TextColor3);
             imagestring($NewImage, 2, 200, 26, $kills, $TextColor2);
             //deaths
             imagestring($NewImage, 2, 140, 42, "Deaths:", $TextColor3);
             imagestring($NewImage, 2, 200, 42, $deaths, $TextColor2);
             //assists
             imagestring($NewImage, 2, 140, 58, "Assists:", $TextColor3);
             imagestring($NewImage, 2, 200, 58, $assists, $TextColor2);
             //COUNTRY FLAGS
             $NewImage2 = imagecreatefromgif("img/flags/" . $letter . ".gif");
             imagecopy($NewImage, $NewImage2, 220, 3, 0, 0, imagesx($NewImage2), imagesy($NewImage2));
             imagestring($NewImage, 2, 250, 3, $country, $TextColor2);
             imagedestroy($NewImage2);
             //FAVORITE HERO
             $NewImage2 = imagecreatefromgif("img/heroes/" . $MostPlayedHero . ".gif");
             imagecopyresized($NewImage, $NewImage2, 306, 54, 0, 0, 32, 32, 64, 64);
             imagedestroy($NewImage2);
             imagestring($NewImage, 2, 280, 25, "Favorite Hero", $TextColor3);
             imagestring($NewImage, 1, 280, 39, $MostPlayedHeroName, $TextColor2);
             header("Content-type: cache");
             // out out the image
             imagejpeg($NewImage, $SigPath, 100);
             //Output image to browser
             imagedestroy($NewImage);
             header("Content-type: image/jpeg");
             // out the image
             $NewImage = imagecreatefromjpeg($SigPath);
             //image create by existing image
             imagejpeg($NewImage);
             //Output image to browser
             imagedestroy($NewImage);
             exit;
             header("location: " . OS_HOME . "?action=signature&sig=" . $userID . "");
             die;
         } else {
             header("location: " . OS_HOME . "?action=signature&unknown");
             die;
         }
     }
 }
Esempio n. 11
0
//Plugin: User Line Chart Stats (JQuery)
//Author: Ivan
//Allows you to view the history of games for players as a timeline and chart statistics for kda on single game page. <b>JQuery</b> plugin must be enabled on some themes.
if (!isset($website)) {
    header('HTTP/1.1 404 Not Found');
    die;
}
$PluginEnabled = '1';
if ($PluginEnabled == 1) {
    if (isset($_GET["u"]) and is_numeric($_GET["u"])) {
        //bugged
        //AddEvent("os_head","OS_JQuery182");
        //AddEvent("os_display_custom_fields","OS_ChartData");
    }
    if (isset($_GET["game"]) and is_numeric($_GET["game"])) {
        AddEvent("os_display_custom_fields", "OS_ChartGameData");
    }
    function OS_JQuery182()
    {
        global $db;
        global $MinDuration;
        global $UserData;
        $Total = 50;
        if (isset($_GET["showgames"]) and $_GET["showgames"] == 10) {
            $Total = 10;
        } else {
            if (isset($_GET["showgames"]) and $_GET["showgames"] == 20) {
                $Total = 20;
            } else {
                if (isset($_GET["showgames"]) and $_GET["showgames"] == 50) {
                    $Total = 50;
Esempio n. 12
0
    @$dom->loadHTML(convEnt($text));
    $xpath = new DOMXPath($dom);
    $entries = $xpath->query('//img');
    $default = OS_HOME . "themes/" . OS_THEMES_DIR . "/images/dota_banner.png";
    foreach ($entries as $e) {
        $_imgs[$c] = $e->getAttribute("src");
        $c++;
        break;
    }
    if (!empty($_imgs[0])) {
        return $_imgs[0];
    } else {
        return $default;
    }
}
AddEvent("os_head", "OS_LiveGames");
function OS_LiveGames()
{
    ?>
  <?php 
    if (isset($_GET["live_games"]) or !$_GET) {
        /* <script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script><?php */
        ?>
<script src="<?php 
        echo OS_HOME;
        ?>
themes/live.js"></script>
<?php 
    }
    ?>
  <?php 
Esempio n. 13
0
}
$PluginEnabled = '0';
$PluginOptions = '1';
$ThisPlugin = basename(__FILE__, '');
if ($PluginEnabled == 1) {
    if (OS_is_admin() and OS_PluginEdit($ThisPlugin)) {
        $Option = '
<div><a class="menuButtons" href="' . OS_HOME . '?reset_notification" target="_blank">Reset notification</a></div>';
    }
    //Check cookies - info about admin last login
    if (OS_is_admin()) {
        AddEvent("os_start", "OS_UserLoginCheck");
    }
    if (OS_is_admin() and !$_GET) {
        if (!isset($_SESSION["notification"])) {
            AddEvent("os_content", "OS_GetNotifications");
        }
        //AddEvent("os_content", "OS_Debug");
    }
    function OS_UserLoginCheck()
    {
        if (!isset($_COOKIE["os_last_login"])) {
            @setcookie("os_last_login", time() - 3600 * 24, time() + 3600 * 24 * 7, "/");
            header("location: " . OS_HOME . "");
            die;
        }
        //Reset notification
        if (isset($_GET["reset_notification"])) {
            @setcookie("os_last_login", " ", time() - 3600 * 24 * 7, "/");
            if (isset($_SESSION["notification"])) {
                unset($_SESSION["notification"]);
Esempio n. 14
0
   <option ' . $sel[0] . ' value="0">Home page</option>
   <option ' . $sel[1] . ' value="1">Profile page</option>
   <option ' . $sel[2] . ' value="2">Top page</option>
   <option ' . $sel[3] . ' value="3">Games page</option>
   <option ' . $sel[4] . ' value="4">Admins page</option>
   <option ' . $sel[5] . ' value="5">About Us page</option>
   <option ' . $sel[6] . ' value="6">Members page</option>
   <option ' . $sel[7] . ' value="7">Bans page</option>
  </select>
  <input type="submit" value = "Submit" class="menuButtons" />
  <a href="' . $website . 'adm/?plugins" class="menuButtons">Cancel</a>
</form>';
        }
    }
    AddEvent("os_init", "EventWhenUserLogIn");
    AddEvent("os_start", "RedirectToHomePage");
    function EventWhenUserLogIn()
    {
        if (isset($_GET["login"]) and isset($_POST["login_"]) and empty($errors) and is_logged()) {
            if (defined('OS_REDIRECT_TO') and OS_REDIRECT_TO != "") {
                if (OS_REDIRECT_TO == 'last_page' and isset($_SESSION["last_page"]) and strstr($_SESSION["last_page"], OS_HOME)) {
                    if (empty($_SESSION["last_page"]) or $_SESSION["last_page"] == "last_page" or isset($_GET["last_page"])) {
                        header("location: " . OS_HOME);
                        die;
                    }
                    header("location: " . $_SESSION["last_page"]);
                    die;
                }
                header("location: " . OS_HOME . "?" . OS_REDIRECT_TO);
                die;
            }
Esempio n. 15
0
}
$PluginEnabled = '1';
//Enable edit plugin options
//$PluginOptions = '1';
if ($PluginEnabled == 1) {
    //?action=reports
    if (OS_GetAction("reports") and is_logged()) {
        AddEvent("os_content", "OS_MyReports");
    }
    //?action=appeals
    if (OS_GetAction("appeals") and is_logged()) {
        AddEvent("os_content", "OS_MyAppeals");
    }
    //Add to main menu (MISC link)
    if (is_logged()) {
        AddEvent("os_add_menu_misc", "OS_ShowReportAppealMenu");
    }
    function OS_ShowReportAppealMenu()
    {
        ?>
	<li><a href="<?php 
        echo OS_HOME;
        ?>
?action=reports">My Reports</a></li>
	<li><a href="<?php 
        echo OS_HOME;
        ?>
?action=appeals">My Appeals</a></li>
	<?php 
    }
    //REPORTS
Esempio n. 16
0
            $UserIPRange[$c]["gamename"] = $row["gamename"];
            $UserIPRange[$c]["reason"] = convEnt($row["reason"]);
            $UserIPRange[$c]["expiredate"] = date(OS_DATE_FORMAT, strtotime($row["expiredate"]));
            if (empty($row["expiredate"]) or $row["expiredate"] == "0000-00-00 00:00:00") {
                $UserIPRange[$c]["expiredate"] = '<span class="perm_ban">Permanent</span>';
            }
            $c++;
        }
        $sth = $db->prepare("SELECT gp.id, gp.ip, gp.name, g.gamename, g.datetime, gp.gameid \n\t\t\t FROM " . OSDB_GP . " as gp\n\t\t\t LEFT JOIN " . OSDB_GAMES . " as g on g.id = gp.gameid\n\t\t\t WHERE name!= '" . $PlayerName . "' AND ip LIKE '" . $ip_part . ".%'\n\t\t\t GROUP BY gp.name ORDER BY gp.id DESC LIMIT 50");
        $result = $sth->execute();
        $OtherIPAddr = array();
        $c = 0;
        while ($row = $sth->fetch(PDO::FETCH_ASSOC)) {
            $OtherIPAddr[$c]["id"] = $row["id"];
            $OtherIPAddr[$c]["ip"] = $row["ip"];
            $OtherIPAddr[$c]["name"] = $row["name"];
            $OtherIPAddr[$c]["gameid"] = $row["gameid"];
            $OtherIPAddr[$c]["gamename"] = $row["gamename"];
            $OtherIPAddr[$c]["datetime"] = date(OS_DATE_FORMAT, strtotime($row["datetime"]));
            $c++;
        }
    }
}
//Hook js
AddEvent("os_js", "OS_UserMap");
function OS_UserMap()
{
    ?>
<script src="https://maps.googleapis.com/maps/api/js?sensor=false"></script>
  <?php 
}
Esempio n. 17
0
                                                                            }
                                                                        }
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
include "inc/compare_players.php";
AddEvent("os_add_meta", "OS_MetaVersion");
function OS_MetaVersion()
{
    ?>
<meta name="generator" content="OpenStats <?php 
    echo OS_VERSION;
    ?>
" />
<?php 
}
Esempio n. 18
0
                $AdminEmail = $Email;
            }
        }
        //Show following options when user click on edit icon for this plugin
        $Option = '
<form action="" method="post" >
  <input size="30" type="text" value="' . $AdminEmail . '" name="AdminEmail" class="field" />
  <input type="submit" value = "Admin email" class="menuButtons" />
  <a href="' . $website . 'adm/?plugins" class="menuButtons">Cancel</a>
</form>
<div>Enter the email address for notification</div>';
    }
    if (isset($emailError) and !empty($emailError)) {
        $Option .= $emailError;
    }
    AddEvent("os_init", "SendMailOnNewComment");
    function SendMailOnNewComment()
    {
        if (isset($_POST["post_comment"])) {
            global $lang;
            global $mail;
            $message = "You can see a new comment by clicking on the following link<br />";
            $message .= "" . OS_HOME . "<br />";
            require "inc/class.phpmailer.php";
            $mail = new PHPMailer();
            $mail->CharSet = 'UTF-8';
            $mail->SetFrom(OS_ADMIN_EMAIL, "DotA OpenStats");
            $mail->AddReplyTo($lang["email_from"], $lang["email_from_full"]);
            $mail->AddAddress(OS_ADMIN_EMAIL, "");
            $mail->Subject = "New comment";
            $mail->MsgHTML($message);
Esempio n. 19
0
<?php

//Plugin: Add JQuery plugin to header
//Author: Ivan
//Enable JavaScript Library that simplifies HTML document traversing, event handling, animating, and Ajax interactions for rapid web development.
if (!isset($website)) {
    header('HTTP/1.1 404 Not Found');
    die;
}
$PluginEnabled = '1';
if ($PluginEnabled == 1) {
    AddEvent("os_js", "OS_JQuery");
    function OS_JQuery()
    {
        ?>
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<?php 
    }
}
Esempio n. 20
0
}
$PluginEnabled = '0';
if ($PluginEnabled == 1) {
    global $CommentsData;
    if (!empty($CommentsData)) {
        for ($i = 0; $i < count($CommentsData); $i++) {
            $username = $CommentsData[$i]["username_clean"];
            $search = '/\\[quote=(.*?)\\](.*?)\\[\\/quote\\]/is';
            $replace = '<div style="background-color: #EEE; border: 1px solid #D6D6D6; padding: 6px; color: #3D3D3D; "><b>$1</b>:<br /> <i>$2</i></div>';
            $CommentsData[$i]["text"] = preg_replace($search, $replace, $CommentsData[$i]["text"]);
            //Add quote button/link
            $CommentsData[$i]["text"] = '<div id="comment-' . $CommentsData[$i]["id"] . '">' . $CommentsData[$i]["text"] . "</div>";
            $CommentsData[$i]["text"] .= '<div style="float:right;"><a href="javascript:;" onclick="QuoteText(\'' . $CommentsData[$i]["id"] . '\', \'' . $username . '\')">[quote]</a></div>';
        }
    }
    AddEvent("os_head", "QuoteTextJs");
    //ADD javascript to header
    function QuoteTextJs()
    {
        ?>
<script type="text/javascript">
    function QuoteText(id, name) {
	document.getElementById("text_message").focus();
	txt = js_strip_tags(document.getElementById("comment-"+id).innerHTML);
	textarea = document.getElementById("text_message").value;
	
	if (name=="") name="guest";
	
	html = textarea+"[quote="+name+"]"+txt+"[/quote]\n";
	document.getElementById("text_message").value = html;
	}
Esempio n. 21
0
//  All rights reserved.                                                     //
//                                                                           //
//  This program is free software. You may use, modify, and/or redistribute  //
//  it under the terms of the MIT License.                                   //
//                                                                           //
//***************************************************************************//
// Initialize OvBB.
require './includes/init.inc.php';
// Build a list of the months.
$aMonths = array(1 => 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December');
// What are they wanting to do?
switch ($_REQUEST['action']) {
    case 'viewevent':
        ViewEvent();
    case 'addevent':
        AddEvent();
    case 'editevent':
        EditEvent();
    default:
        ViewCalendar();
}
// *************************************************************************** \\
// Displays the calendar.
function ViewCalendar()
{
    global $CFG, $dbConn, $aMonths;
    // Constants
    define('DAY', 0);
    define('INMONTH', 1);
    define('ISTODAY', 2);
    define('AUTHOR', 0);
Esempio n. 22
0
//Plugin: Realm username and birthday
//Author: Ivan
//Add custom field:  Realm username on and user birthday <a href="../?profile" target="_blank">profile page</a>.
if (!isset($website)) {
    header('HTTP/1.1 404 Not Found');
    die;
}
$PluginEnabled = '0';
if ($PluginEnabled == 1) {
    if (isset($_GET["profile"]) and is_logged()) {
        AddEvent("os_custom_user_fields", "OS_CustomField");
        AddEvent("os_init", "OS_UpdateCustomField");
    }
    if (isset($_GET["action"]) and $_GET["action"] == "profile" and isset($_GET["id"])) {
        AddEvent("os_custom_user_fields", "OS_DisplayCustomField");
    }
    function OS_CustomField()
    {
        //Display realm username edit field on profile page
        if (isset($_GET["profile"])) {
            global $db;
            $uid = (int) $_SESSION["user_id"];
            $realmUnValue = OS_get_custom_field($uid, "realm_username");
            $BirthValue = OS_get_custom_field($uid, "user_birthday");
            if (!empty($BirthValue)) {
                $UserBirth = explode("-", $BirthValue);
                //we use day-month-year DATEFORMAT
                $dd = $UserBirth[0];
                $mm = $UserBirth[1];
                $yy = $UserBirth[2];
Esempio n. 23
0
        if (strtolower($Player["player"]) == strtolower($MostKPG)) {
            $ComparePlayersData[$c]["points"] += 1;
        }
        if (strtolower($Player["player"]) == strtolower($MostAPG)) {
            $ComparePlayersData[$c]["points"] += 1;
        }
        if (strtolower($Player["player"]) == strtolower($MostCK)) {
            $ComparePlayersData[$c]["points"] += 1;
        }
        if (strtolower($Player["player"]) == strtolower($MostCD)) {
            $ComparePlayersData[$c]["points"] += 1;
        }
        if (strtolower($Player["player"]) == strtolower($MostNE)) {
            $ComparePlayersData[$c]["points"] += 1;
        }
        $c++;
    }
    if (isset($_GET["compare_players"])) {
        AddEvent("os_head", "OS_GoogleChart");
        function OS_GoogleChart()
        {
            ?>
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
<?php 
        }
    }
}
if (isset($_GET["compare_players"]) and !isset($_GET["empty"]) and empty($_SESSION["compare_list"])) {
    header("location: " . OS_HOME . "?compare_players&empty");
    die;
}
    $e = $_GET["e"];
    $errors = "";
    if (!preg_match("/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\\.[A-Z]{2,6}\$/i", $e)) {
        $errors .= "<div>" . $lang["error_email"] . "</div>";
    }
    if (empty($errors)) {
        $sth = $db->prepare("SELECT * FROM " . OSDB_USERS . " WHERE user_email=:user_email AND code=:code ");
        $sth->bindValue(':user_email', $e, PDO::PARAM_STR);
        $sth->bindValue(':code', $code, PDO::PARAM_STR);
        $result = $sth->execute();
        if ($sth->rowCount() >= 1) {
            $row = $sth->fetch(PDO::FETCH_ASSOC);
            if ($row["user_bnet"] == 1) {
                $update = $db->update(OSDB_USERS, array("code" => '', "user_bnet" => 2), "user_email = '" . $e . "' AND code = '" . $code . "'");
            }
            AddEvent("os_content", "OS_BNET_Message");
            function OS_BNET_Message()
            {
                global $lang;
                ?>
<div id="content" class="s-c-x">
<div class="wrapper">   
    <div id="main-column">
     <div class="padding">
      <div class="inner">
       <h2><?php 
                echo $lang["succes_registration"];
                ?>
</h2>
     </div>
    </div>
Esempio n. 25
0
        ?>
icon_tongue.gif" alt="smiley" /></a>
	 <a href="javascript:;" onclick="AddSmiley(':woot:')" ><img src="<?php 
        echo $path;
        ?>
icon_woot.gif" alt="smiley" /></a>
	</div>
	
<?php 
    }
    function SmiliesJS()
    {
        ?>
  <script type="text/javascript">
function AddSmiley(tag) {
   document.getElementById("text_message").focus();
   var html = document.getElementById("text_message").value;
   html=html+""+tag+" ";
   document.getElementById("text_message").value = html;
}
</script>
  <?php 
    }
    AddEvent("os_head", "SmiliesJS");
    //ADD javascript to header
    AddEvent("os_comment_form", "AddSmiliesButtons");
    //ADD SMILIES BUTTONS ON TEXT FORM
    //AddEvent("os_after_comment_form","AddSmiliesButtons"); //or add after comment form
    //Display smilies
    ShowSmilesInComments($SmiliesPath);
}
Esempio n. 26
0
        $gametimenew = substr(str_ireplace(":", "-", date("Y-m-d H:i", strtotime($replayDate))), 0, 16);
        $gid = (int) $row["id"];
        $gamename = $RecentGamesData[$c]["gamename"];
        include 'inc/get_replay.php';
        if (file_exists($replayloc)) {
            $RecentGamesData[$c]["replay"] = $replayloc;
        } else {
            $RecentGamesData[$c]["replay"] = "";
        }
        //END REPLAY
        $c++;
    }
    //$db->free($result);
}
if (isset($_SESSION["points_updated"]) and $DailyPoints >= 1) {
    AddEvent("os_content", "OS_PTS_INFO");
    unset($_SESSION["points_updated"]);
    function OS_PTS_INFO()
    {
        global $lang;
        global $DailyPoints;
        ?>
<div class="clr"></div>
 <div class="ct-wrapper"  id="content" class="s-c-x">
  <div class="outer-wrapper wrapper">
   <div class="content section" id="main-column">
    <div class="widget Blog padding">
     <div class="blog-posts hfeed padLeft padTop padBottom inner">
	    <h4><?php 
        echo $lang["points_info1"];
        ?>