コード例 #1
0
$mc = array();
require $c['dir'] . "/system/minecraft.class.php";
/*
-----------------------------------------------------
Konfigurāciju rediģēt drīkst pēc šīs līnijas
-----------------------------------------------------
*/
/*
    Datubāzes servera adrese, pēc noklusējuma "localhost"
*/
$mc['db']['host'] = "localhost";
/*
    Datubāzes pieejas lietotājvārds
*/
$mc['db']['username'] = "";
/*
    Datubāzes pieejas parole
*/
$mc['db']['password'] = "";
/*
    Datubāzes nosaukums
*/
$mc['db']['database'] = "";
$mc['servers'] = array("Factions" => (object) array("title" => "Factions", "ip_address" => "", "rcon_port" => 25575, "rcon_password" => "", "show" => true));
foreach ($mc['servers'] as $type => $data) {
    $mc['rcon'][$type] = new MinecraftRcon($data->ip_address, $data->rcon_port, $data->rcon_password, 10);
    if ($mc['rcon'][$type]->connect() === false) {
        $data->show = false;
        echo baltsms::alert("Nav iespējams savienoties ar Minecraft serveri: <strong>" . $type . "</strong>. Pārbaudi pieejas datus!", "danger");
    }
}
コード例 #2
0
ファイル: my_plugin.php プロジェクト: ytteroy/baltGro-shop
    if (count($errors) > 0) {
        foreach ($errors as $error) {
            echo baltsms::alert($error, "danger");
        }
    } else {
        /*
        Pārbaudam atslēgas kodu un vai tas saskan ar apmaksāto kodu
        */
        $baltsms = new baltsms();
        $baltsms->setPrice($c[$p]['price']);
        # Cena, kas norādīta augstāk. Attiecīgi nomaini, ja cenas ir vairākas un cena tiek izvilkta no <select>
        $baltsms->setCode($_POST['code']);
        # Ievadītais atslēgas kods
        $baltsms->sendRequest();
        if ($baltsms->getResponse() === true) {
            echo baltsms::alert($lang[$p]['success'], "success");
            /*
            Šeit vari droši ievadīt savu saturu, kas nodos iegādāto pakalpojumu. Tā var būt Minecraft komanda vai vienkāršs SQL kvērijs
            */
            ?>
			<script type="text/javascript">
				setTimeout(function(){
					loadPlugin('<?php 
            echo $p;
            ?>
');
				}, 3000);
			</script>
			<?php 
        } else {
            echo $baltsms->getResponse();
コード例 #3
0
ファイル: mc_group.php プロジェクト: ytteroy/baltGro-shop
			<script type="text/javascript">
				setTimeout(function(){
					loadPlugin('<?php 
            echo $p;
            ?>
');
				}, 3000);
			</script>
			<?php 
        } else {
            echo $baltsms->getResponse();
        }
    }
} else {
    if ($db->tableExists($c[$p]['db']['table']) === false) {
        echo baltsms::alert("Tabula netika atrasta datubāzē. Tā tika izveidota automātiski ar nosaukumu, kas norādīts konfigurācijā!", "success");
    }
    if ($db->tableExists($c[$p]['db']['table']) === false) {
        echo baltsms::createTable($p, $c[$p]['db']['table']);
    }
    ?>
	<form class="form-horizontal" method="POST" id="<?php 
    echo $p;
    ?>
">
		<div class="alert alert-info" id="instructions" style="display: none;"><?php 
    echo baltsms::instructionTemplate($lang[$p]['instructions'], array("price" => baltsms::returnPrice(0), "code" => 0, "length" => 0));
    ?>
</div>
		<div id="alerts"></div>
		<div class="form-group">
コード例 #4
0
ファイル: mc_unjail.php プロジェクト: ytteroy/baltGro-shop
        foreach ($errors as $error) {
            echo baltsms::alert($error, "danger");
        }
    } else {
        $baltsms = new baltsms();
        $baltsms->setPrice($c[$p]['prices'][$_POST['server']]);
        $baltsms->setCode($_POST['code']);
        $baltsms->sendRequest();
        if ($baltsms->getResponse() === true) {
            $unjail = str_replace(array("<NICKNAME>"), array($_POST['nickname']), $c[$p]['commands']['unjail']);
            $mc['rcon'][$_POST['server']]->send_command($unjail);
            if ($c[$p]['ingame']['notifications'] === true) {
                $sendMessage = str_replace(array("<NICKNAME>"), array($_POST['nickname']), $c[$p]['ingame']['message']);
                $mc['rcon'][$_POST['server']]->send_command("say " . $sendMessage);
            }
            echo baltsms::alert($lang[$p]['unjail_successful'], "success");
            ?>
			<script type="text/javascript">
				setTimeout(function(){
					loadPlugin('<?php 
            echo $p;
            ?>
');
				}, 3000);
			</script>
			<?php 
        } else {
            echo $baltsms->getResponse();
        }
    }
} else {
コード例 #5
0
ファイル: mc_crate.php プロジェクト: ytteroy/baltGro-shop
        foreach ($errors as $error) {
            echo baltsms::alert($error, "danger");
        }
    } else {
        $baltsms = new baltsms();
        $baltsms->setPrice($_POST['price']);
        $baltsms->setCode($_POST['code']);
        $baltsms->sendRequest();
        if ($baltsms->getResponse() === true) {
            $giveCrate = str_replace(array("<NICKNAME>", "<CRATE>"), array($_POST['nickname'], $c[$p]['prices'][$_POST['server']][$_POST['price']]), $c[$p]['commands']['giveCrate']);
            $mc['rcon'][$_POST['server']]->send_command($giveCrate);
            if ($c[$p]['ingame']['notifications'] === true) {
                $sendMessage = str_replace(array("<NICKNAME>"), array($_POST['nickname']), $c[$p]['ingame']['message']);
                $mc['rcon'][$_POST['server']]->send_command("say " . $sendMessage);
            }
            echo baltsms::alert($lang[$p]['money_purchased'], "success");
            ?>
			<script type="text/javascript">
				setTimeout(function(){
					loadPlugin('<?php 
            echo $p;
            ?>
');
				}, 3000);
			</script>
			<?php 
        } else {
            echo $baltsms->getResponse();
        }
    }
} else {
コード例 #6
0
ファイル: mc_register.php プロジェクト: ytteroy/baltGro-shop
    if (count($errors) > 0) {
        foreach ($errors as $error) {
            echo baltsms::alert($error, "danger");
        }
    } else {
        $baltsms = new baltsms();
        $baltsms->setPrice($c[$p]['prices'][$_POST['server']]);
        $baltsms->setCode($_POST['code']);
        $baltsms->sendRequest();
        if ($baltsms->getResponse() === true) {
            $mc['rcon'][$_POST['server']]->send_command($register);
            if ($c[$p]['ingame']['notifications'] === true) {
                $sendMessage = str_replace(array("<NICKNAME>"), array($_POST['nickname']), $c[$p]['ingame']['message']);
                $mc['rcon'][$_POST['server']]->send_command("say " . $sendMessage);
            }
            echo baltsms::alert($lang[$p]['registration_successful'], "success");
            ?>
			<script type="text/javascript">
				setTimeout(function(){
					loadPlugin('<?php 
            echo $p;
            ?>
');
				}, 3000);
			</script>
			<?php 
        } else {
            echo $baltsms->getResponse();
        }
    }
} else {
コード例 #7
0
ファイル: mc_say.php プロジェクト: ytteroy/baltGro-shop
            $errors[] = $lang[$p]['error_invalid_code'];
        }
    }
    if (count($errors) > 0) {
        foreach ($errors as $error) {
            echo baltsms::alert($error, "danger");
        }
    } else {
        $baltsms = new baltsms();
        $baltsms->setPrice($c[$p]['prices'][$_POST['server']]);
        $baltsms->setCode($_POST['code']);
        $baltsms->sendRequest();
        if ($baltsms->getResponse() === true) {
            $sendMessage = str_replace(array("<MESSAGE>"), array($_POST['message']), $c[$p]['commands']['sendMessage']);
            $mc['rcon'][$_POST['server']]->send_command($sendMessage);
            echo baltsms::alert($lang[$p]['message_sent_successfully'], "success");
            ?>
			<script type="text/javascript">
				setTimeout(function(){
					loadPlugin('<?php 
            echo $p;
            ?>
');
				}, 3000);
			</script>
			<?php 
        } else {
            echo $baltsms->getResponse();
        }
    }
} else {
コード例 #8
0
ファイル: plugin.php プロジェクト: ytteroy/baltGro-shop
<?php

/*
    baltGro - SMS/PayPal maksājumu sistēmas gatavais risinājums
    baltGro ir aplikācija, kura saistās ar baltGro SMS/PayPal un uzturēšanas risinājumiem. Šo aplikācija drīkst izmantot tikai baltgro.lv klienti, kuriem ir vajadzīgie dati, lai aizpildītu konfigurāciju un izveidotu savienojumu
    Aplikāciju un tās spraudņus veidoja Miks Zvirbulis
    http://twitter.com/MiksZvirbulis
	https://twitter.com/mrYtteroy
*/
if (!isset($_SERVER['HTTP_X_REQUESTED_WITH']) or isset($_SERVER['HTTP_X_REQUESTED_WITH']) and strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) != "xmlhttprequest") {
    die("Ajax Only!");
}
if (isset($_POST['plugin'])) {
    require "../config.inc.php";
    if ($c['sms']['debug'] === true) {
        echo baltsms::alert("<center>SMS DEBUG IS TURNED ON!</center>", "warning");
    }
    if (file_exists($c['dir'] . "/plugins/" . $_POST['plugin'] . ".php")) {
        include $c['dir'] . "/plugins/" . $_POST['plugin'] . ".php";
    } else {
        echo baltsms::alert(str_replace("<PLUGIN>", $_POST['plugin'] . ".php", $c['lang']['lv']['plugin_not_found']), "danger");
    }
} else {
    exit;
}