//Author: Ivan
//This plugin adds smiles in user comments.
if (!isset($website)) {
    header('HTTP/1.1 404 Not Found');
    die;
}
$PluginEnabled = '1';
//Enable edit plugin options
$PluginOptions = '1';
$SmiliesPath = 'img/smilies/';
$ThisPlugin = basename(__FILE__, '');
if ($PluginEnabled == 1) {
    //Change options
    if (isset($_POST["SmiliesPath"])) {
        $PATH = safeEscape($_POST["SmiliesPath"]);
        write_value_of('$SmiliesPath', "{$SmiliesPath}", $PATH, $plugins_dir . basename(__FILE__, ''));
        $SmiliesPath = $PATH;
    }
    //If user can edit plugin
    if (OS_is_admin() and OS_PluginEdit($ThisPlugin)) {
        //Show following options when user click on edit icon for this plugin
        //Display all smilies
        $Option = '
<form action="" method="post" >
  <input size="30" type="text" value="' . $SmiliesPath . '" name="SmiliesPath" />
  <input type="submit" value = "Change smilies path" class="menuButtons" />
  <a href="' . $website . 'adm/?plugins" class="menuButtons">Cancel</a>
</form>

<div><a href="javascript:;" onclick="showhide(\'smilies\')">Show all</a></div>';
        $Option .= '<div style="display:none; background-color: #fff;" id="smilies">';
        $gamelist = $db->prepare("CREATE TABLE " . OSDB_GAMELIST . " (id INT NOT NULL PRIMARY KEY AUTO_INCREMENT, botid INT, gamename VARCHAR(128), ownername VARCHAR(32), creatorname VARCHAR(32), map VARCHAR(100), slotstaken INT, slotstotal INT, usernames VARCHAR(512), totalgames INT, totalplayers INT) ENGINE = MEMORY; ");
        $result = $gamelist->execute();
        if ($gl) {
            write_value_of('$GameListPatch', "{$GameListPatch}", 1, "../config.php");
        }
    }
}
//REMOVE
if (isset($_GET["gamelist"]) and isset($_GET["remove"])) {
    $check = $db->prepare("SHOW TABLES LIKE '" . OSDB_GAMELIST . "'");
    //check again
    $result = $check->execute();
    if ($check->rowCount() >= 1) {
        $gamelist = $db->prepare("DROP TABLE " . OSDB_GAMELIST . " ");
        $result = $gamelist->execute();
        write_value_of('$GameListPatch', "{$GameListPatch}", 0, "../config.php");
    }
}
?>
<div align="center"> 

<h2>Gamelist</h2>

<?php 
$check = $db->prepare("SHOW TABLES LIKE '" . OSDB_GAMELIST . "'");
$result = $check->execute();
if ($check->rowCount() <= 0) {
    ?>
<table>
  <tr>
    <th class="padLeft">
Beispiel #3
0
//Facebook Login
if (!isset($website)) {
    header('HTTP/1.1 404 Not Found');
    die;
}
$PluginEnabled = '1';
//Enable edit plugin options
$PluginOptions = '1';
$ThisPlugin = basename(__FILE__, '');
if ($PluginEnabled == 1) {
    if (OS_is_admin() and OS_PluginEdit($ThisPlugin)) {
        if (isset($_POST["fb_appid"])) {
            $fb_appid = strip_tags((int) $_POST["fb_appid"]);
            $fb_enable = safeEscape($_POST["fb_enable"]);
            write_value_of('$FacebookAppID', "{$FacebookAppID}", $fb_appid, '../config.php');
            write_value_of('$FBLogin', "{$FBLogin}", $fb_enable, '../config.php');
            $FacebookAppID = $fb_appid;
            $FBLogin = $fb_enable;
        }
        $Option = "";
        if ($FacebookAppID == 'FB Application ID' or !is_numeric($FacebookAppID)) {
            $Option .= '<div style="color: red; font-weight:bold;" class="padLeft">You have not set Facebook Application ID.<div>Facebook login will not work.</div><a href="https://developers.facebook.com/apps" target="_blank">Click here to create Facebook App</a></div>';
        }
        $sel = array();
        if ($FBLogin == 1) {
            $sel[0] = 'selected="selected"';
        } else {
            $sel[0] = "";
        }
        if ($FBLogin == 0) {
            $sel[1] = 'selected="selected"';
Beispiel #4
0
<?php 
    //load plugins
    while (false !== ($PluginFile = readdir($handle))) {
        $PluginName = "";
        $PluginAuthor = "";
        $PluginDesc = "";
        if ($PluginFile != "." and $PluginFile != "index.php" and $PluginFile != ".." and strstr($PluginFile, ".php") == true) {
            //enable/disable
            if (isset($_GET["disable"]) and file_exists($plugins_dir . safeEscape($_GET["disable"])) and $PluginFile == $_GET["disable"] and OS_IsRoot()) {
                $PluginEnabled = 1;
                write_value_of('$PluginEnabled', "{$PluginEnabled}", 0, $plugins_dir . safeEscape($_GET["disable"]));
                echo $PluginFile . ' - disabled <a href="' . OS_HOME . 'adm/?plugins">&laquo; Back</a>';
            } else {
                if (isset($_GET["enable"]) and file_exists($plugins_dir . safeEscape($_GET["enable"])) and $PluginFile == $_GET["enable"] and OS_IsRoot()) {
                    $PluginEnabled = 0;
                    write_value_of('$PluginEnabled', "{$PluginEnabled}", 1, $plugins_dir . safeEscape($_GET["enable"]));
                    echo $PluginFile . ' - enabled <a href="' . OS_HOME . 'adm/?plugins">&laquo; Back</a>';
                } else {
                    if (isset($_GET["delete"]) and file_exists($plugins_dir . safeEscape($_GET["delete"])) and OS_IsRoot()) {
                        $PluginEnabled = 0;
                        unlink($plugins_dir . safeEscape($_GET["delete"]));
                    }
                }
            }
            if (file_exists($plugins_dir . $PluginFile)) {
                $PluginName = trim(str_replace("//Plugin:", "", OS_ReadLine($plugins_dir . $PluginFile, 2)));
                $PluginAuthor = trim(str_replace("//Author:", "", OS_ReadLine($plugins_dir . $PluginFile, 3)));
                $PluginDesc = trim(str_replace("//", "", OS_ReadLine($plugins_dir . $PluginFile, 4)));
                if (!empty($PluginName) and !empty($PluginAuthor)) {
                    include $plugins_dir . $PluginFile;
                    if (isset($PluginOptions) and $PluginOptions == 1 and $PluginEnabled == 1) {
Beispiel #5
0
if (isset($_POST["cron_save"])) {
    $CronUpdate = strip_tags(trim($_POST["CronUpdate"]));
    $MaxQueries = strip_tags(trim($_POST["MaxQueries"]));
    $StatsCountryUpdate = strip_tags(trim($_POST["StatsCountryUpdate"]));
    $MaxCronLogs = strip_tags(trim($_POST["MaxCronLogs"]));
    $CronReportDetails = strip_tags(trim($_POST["CronReportDetails"]));
    if (isset($_POST["CronPassword"]) and !empty($_POST["CronPassword"]) and $_POST["CronPassword2"] == $CronPassword) {
        $NewPassword = strip_tags(trim($_POST["CronPassword2"]));
        write_value_of('$CronPassword', "{$CronPassword}", $NewPassword, "cron_config.php");
        $pwchanged = 1;
    }
    write_value_of('$CronUpdate', "{$CronUpdate}", $CronUpdate, "cron_config.php");
    write_value_of('$MaxQueries', "{$MaxQueries}", $MaxQueries, "cron_config.php");
    write_value_of('$StatsCountryUpdate', "{$StatsCountryUpdate}", $StatsCountryUpdate, "cron_config.php");
    write_value_of('$MaxCronLogs', "{$MaxCronLogs}", $MaxCronLogs, "cron_config.php");
    write_value_of('$CronReportDetails', "{$CronReportDetails}", $CronReportDetails, "cron_config.php");
    if (!isset($pwchanged)) {
        header("location: ?pw=" . $CronPassword);
    } else {
        header("location: ?pw=" . $NewPassword);
    }
    die;
}
require_once '../../inc/class.db.PDO.php';
// below: just to load default constants (we dont want to load config.php, because cron+session conflict)
// this is temporary solution
if (!isset($TimeZone)) {
    $TimeZone = '';
}
$website = '';
$HomeTitle = '';
Beispiel #6
0
    write_value_of('$LiveGames', "{$LiveGames}", trim((int) $_POST["LiveGames"]), "../config.php");
    write_value_of('$LiveGamesTotalLogs', "{$LiveGamesTotalLogs}", trim((int) $_POST["LiveGamesTotalLogs"]), "../config.php");
    write_value_of('$LiveShowAegis', "{$LiveShowAegis}", trim((int) $_POST["LiveShowAegis"]), "../config.php");
    write_value_of('$LiveShowSwaps', "{$LiveShowSwaps}", trim((int) $_POST["LiveShowSwaps"]), "../config.php");
    write_value_of('$LiveShowHeroPicks', "{$LiveShowHeroPicks}", trim((int) $_POST["LiveShowHeroPicks"]), "../config.php");
    write_value_of('$LiveShowPlayerLevels', "{$LiveShowPlayerLevels}", trim((int) $_POST["LiveShowPlayerLevels"]), "../config.php");
    write_value_of('$LiveShowKills', "{$LiveShowKills}", trim((int) $_POST["LiveShowKills"]), "../config.php");
    write_value_of('$LiveShowAssists', "{$LiveShowAssists}", trim((int) $_POST["LiveShowAssists"]), "../config.php");
    write_value_of('$LiveShowSuicides', "{$LiveShowSuicides}", trim((int) $_POST["LiveShowSuicides"]), "../config.php");
    write_value_of('$LiveShowRunes', "{$LiveShowRunes}", trim((int) $_POST["LiveShowRunes"]), "../config.php");
    write_value_of('$LiveShowTowerKills', "{$LiveShowTowerKills}", trim((int) $_POST["LiveShowTowerKills"]), "../config.php");
    write_value_of('$LiveShowRoshanKill', "{$LiveShowRoshanKill}", trim((int) $_POST["LiveShowRoshanKill"]), "../config.php");
    write_value_of('$BotName', "{$BotName}", trim(strip_tags($_POST["BotName"])), "../config.php");
    //Online offline players
    write_value_of('$OnlineOfflineOnTopPage', "{$OnlineOfflineOnTopPage}", trim((int) $_POST["OnlineOfflineOnTopPage"]), "../config.php");
    write_value_of('$DailyPoints', "{$DailyPoints}", trim(strip_tags((int) $_POST["DailyPoints"])), "../config.php");
    ?>
<div align="center">
  <h2>Configuration successfully updated.   <a href="<?php 
    echo $website;
    ?>
adm/?cfg">&laquo; Back</a></h2>
  
<div style="height: 800px;">&nbsp;</div>
</div>
<?php 
    OS_AddLog($_SESSION["username"], "[os_config] Changed configuration");
} else {
    if (!OS_IsRoot()) {
        ?>
	<div align="center" style="margin-bottom: 220px;">
Beispiel #7
0
    flush();
    if ($result) {
        ?>
		<div>&nbsp;</div>
		<div><b>Admin successfully created.</b></div>
		<div style="display:none;">Please delete <b>install.php</b>, <b>sql_data.sql</b> and <b>sql_heroes_items.sql</b> from install  directory.</div>
		
		<div style="display:none;">Please delete or rename <b>install/</b> folder.</div>
		
		<div>&nbsp;</div>
		<input type="button" class="menuButtons" value="Go to OpenStats 4" onclick="location.href='<?php 
        echo $website;
        ?>
'" />
		<?php 
        write_value_of('$OS_INSTALLED', "{$OS_INSTALLED}", '1', "config.php");
    } else {
        echo "ERROR: mysql error!";
    }
}
if ($step <= 3) {
    ?>
    <div>Step: <b><?php 
    echo $step;
    ?>
</b> / 3 </div>
	<?php 
}
?>
    </div>
 </div>
Beispiel #8
0
$PluginEnabled = '0';
//Enable edit plugin options
$PluginOptions = '1';
$AdminEmail = '*****@*****.**';
$ThisPlugin = basename(__FILE__, '');
define("OS_ADMIN_EMAIL", $AdminEmail);
if ($PluginEnabled == 1) {
    if (OS_is_admin() and OS_PluginEdit($ThisPlugin)) {
        if (isset($_POST["AdminEmail"])) {
            $emailError = "";
            $Email = safeEscape($_POST["AdminEmail"]);
            if (!preg_match("/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\\.[A-Z]{2,6}\$/i", $Email)) {
                $emailError = '<div style="color:red">Invalid email address</div>';
            }
            if (empty($emailError)) {
                write_value_of('$AdminEmail', "{$AdminEmail}", $Email, $plugins_dir . basename(__FILE__, ''));
                $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;
    }
Beispiel #9
0
//Author: Ivan
//Private message system
if (!isset($website)) {
    header('HTTP/1.1 404 Not Found');
    die;
}
$PluginEnabled = '1';
$PluginOptions = '1';
$SendEmailOnPM = '1';
$ThisPlugin = basename(__FILE__, '');
define("OS_SEND_PM_EMAIL", $SendEmailOnPM);
if ($PluginEnabled == 1) {
    $AdminPMEmail = OS_SEND_PM_EMAIL;
    if (isset($_POST["AdminPMEmail"])) {
        $AdminPMEmail = (int) $_POST["AdminPMEmail"];
        write_value_of('$SendEmailOnPM', "{$SendEmailOnPM}", $AdminPMEmail, $plugins_dir . basename(__FILE__, ''));
    }
    if (OS_is_admin() and OS_PluginEdit($ThisPlugin)) {
        $sel = array();
        if ($AdminPMEmail == 1) {
            $sel[0] = 'selected="selected"';
        } else {
            $sel[0] = "";
        }
        if ($AdminPMEmail == 0) {
            $sel[1] = 'selected="selected"';
        } else {
            $sel[1] = "";
        }
        //Show following options when user click on edit icon for this plugin
        $Option = '
Beispiel #10
0
$SignaturePath = 'img/signatures/';
$SigCacheTime = '60';
$SigMenuLink = '1';
$SigUse = '1';
$ThisPlugin = basename(__FILE__, '');
define('SIG_PATH', $SignaturePath);
define('SIG_CACHE', $SigCacheTime);
define('SIG_MENU', $SigMenuLink);
define('SIG_USE', $SigUse);
if ($PluginEnabled == 1) {
    //If user can edit plugin
    if (OS_is_admin() and OS_PluginEdit($ThisPlugin)) {
        if (isset($_POST["SigCacheTime"])) {
            write_value_of('$SigCacheTime', "{$SigCacheTime}", (int) $_POST["SigCacheTime"], $plugins_dir . basename(__FILE__, ''));
            write_value_of('$SigMenuLink', "{$SigMenuLink}", (int) $_POST["sig_menu"], $plugins_dir . basename(__FILE__, ''));
            write_value_of('$SigUse', "{$SigUse}", (int) $_POST["sig_use"], $plugins_dir . basename(__FILE__, ''));
            $SigCacheTime = (int) $_POST["SigCacheTime"];
            $SigMenuLink = (int) $_POST["sig_menu"];
            $SigUse = (int) $_POST["sig_use"];
        } else {
            $SigCacheTime = SIG_CACHE;
            $SigMenuLink = SIG_MENU;
            $SigUse = SIG_USE;
        }
        if ($SigMenuLink == 1) {
            $sel[0] = 'selected="selected"';
        } else {
            $sel[0] = "";
        }
        if ($SigMenuLink == 0) {
            $sel[1] = 'selected="selected"';
Beispiel #11
0
                 }
             }
             $CurrentPage = $pref . $_SERVER["SERVER_NAME"] . $_SERVER["REQUEST_URI"];
             if (strstr($CurrentPage, OS_HOME) and !isset($_GET["login"]) and !strstr($CurrentPage, "action=signature")) {
                 $_SESSION["last_page"] = $CurrentPage;
             }
             //echo  $CurrentPage;
         }
     }
 }
 if (OS_is_admin() and OS_PluginEdit()) {
     if (isset($_POST["RedirectPage"])) {
         $emailError = "";
         $RedirectPage = safeEscape($_POST["RedirectPage"]);
         if (is_numeric($RedirectPage)) {
             write_value_of('$RedirectLogin', "{$RedirectLogin}", $RedirectPage, $plugins_dir . basename(__FILE__, ''));
             $RedirectLogin = $RedirectPage;
         }
     }
     $sel = array();
     if ($RedirectLogin == 0) {
         $sel[0] = 'selected = "selected"';
     } else {
         $sel[0] = '';
     }
     if ($RedirectLogin == 1) {
         $sel[1] = 'selected = "selected"';
     } else {
         $sel[1] = '';
     }
     if ($RedirectLogin == 2) {
Beispiel #12
0
define('neutralsGoal', $neutralsGoal);
define('PlayTimeGoal', $PlayTimeGoal);
if ($PluginEnabled == 1) {
    if (OS_is_admin() and OS_PluginEdit($ThisPlugin)) {
        if (isset($_POST["editAchievements"])) {
            write_value_of('$killsGoal', "{$killsGoal}", $_POST["killsGoal"], $plugins_dir . basename(__FILE__, ''));
            write_value_of('$assistsGoal', "{$assistsGoal}", $_POST["assistsGoal"], $plugins_dir . basename(__FILE__, ''));
            write_value_of('$winslossesGoal', "{$winslossesGoal}", $_POST["winslossesGoal"], $plugins_dir . basename(__FILE__, ''));
            write_value_of('$kpGoal', "{$kpGoal}", $_POST["kpGoal"], $plugins_dir . basename(__FILE__, ''));
            write_value_of('$gamesGoal', "{$gamesGoal}", $_POST["gamesGoal"], $plugins_dir . basename(__FILE__, ''));
            write_value_of('$winsGoal', "{$winsGoal}", $_POST["winsGoal"], $plugins_dir . basename(__FILE__, ''));
            write_value_of('$creepsGoal', "{$creepsGoal}", $_POST["creepsGoal"], $plugins_dir . basename(__FILE__, ''));
            write_value_of('$denieGoal', "{$denieGoal}", $_POST["denieGoal"], $plugins_dir . basename(__FILE__, ''));
            write_value_of('$towersGoal', "{$towersGoal}", $_POST["towersGoal"], $plugins_dir . basename(__FILE__, ''));
            write_value_of('$neutralsGoal', "{$neutralsGoal}", $_POST["neutralsGoal"], $plugins_dir . basename(__FILE__, ''));
            write_value_of('$PlayTimeGoal', "{$PlayTimeGoal}", $_POST["PlayTimeGoal"], $plugins_dir . basename(__FILE__, ''));
            $Option = '
   <div style="height:230px;">
     <h2>Updated. </h2>
     <a href="' . OS_HOME . 'adm/?plugins&amp;edit=' . basename(__FILE__) . '&amp;' . generate_hash(8) . '#' . basename(__FILE__) . '" class="menuButtons">Refresh</a>
   </div>';
        } else {
            function OS_AddAchieveOption($text = "", $value = 0, $valueName = '', $text2 = "", $more = "")
            {
                $option = '<tr class="row">
	  <td align="right">' . $text . '</td>
	  <td width="58" align="left" class="padLeft">
	     <input size="1" type="text" value="' . $value . '" name="' . $valueName . '" />' . $more . '
	  </td>
	  <td align="left">' . $text2 . '</td>
	</tr>';