Beispiel #1
0
function YTvideo($id)
{
    $db = getConnected("homepage");
    $q = $db->query("SELECT width,height,url FROM cms_videos WHERE id = '" . $id . "' LIMIT 1;");
    while ($video = $q->fetch_assoc()) {
        return $video;
    }
    $db->close();
}
Beispiel #2
0
     $userticketname = $row_getun["login"];
 }
 mysqli_close($mysqli_getun);
 $date2 = date('d-m-Y h:i A', strtotime($row["time"]));
 echo "<b>by " . $userticketname . " on {$date2}:</b><br>";
 $bb = new bbParser();
 echo $bb->getHtml($row["message"]) . "<br><br>";
 // answers
 $mysqli3 = getConnected("account");
 $res3 = mysqli_query($mysqli3, "SELECT * FROM cms_answers WHERE messageid='" . $form_id . "' ORDER BY id ASC");
 while ($row3 = mysqli_fetch_array($res3)) {
     $ansermessage = $row3["message"];
     // get username from ticket
     $useranswername = $row3["ufrom"];
     // connect to db
     $mysqli4 = getConnected("account");
     $res4 = mysqli_query($mysqli4, "SELECT login FROM account WHERE id='" . $useranswername . "'");
     while ($row4 = mysqli_fetch_array($res4)) {
         $useranswername = $row4["login"];
     }
     mysqli_close($mysqli4);
     echo "<div id=\"box\">";
     $date2 = $row3["time"];
     $date2 = date('d-m-Y h:i A', strtotime($date2));
     echo "<b>by {$useranswername} on {$date2}:</b><br>" . $bb->getHtml($ansermessage);
     echo "</div>";
 }
 mysqli_close($mysqli3);
 echo "<div id=\"box\">";
 echo "<a href=\"index.php?page=admin_ticket&action=answer&id=" . $row["id"] . "\"><img src=\"img/icons/answer.png\" border=\"0\"> " . lang('ADMIN_ANSWER') . "</a>&nbsp;&nbsp;&nbsp;";
 echo "<a href=\"index.php?page=admin_ticket&action=edit&id=" . $row["id"] . "\"><img src=\"img/icons/edit.png\" border=\"0\"> " . lang('ADMIN_EDIT') . "</a>&nbsp;&nbsp;&nbsp;";
<?php

/**
 * Created by PhpStorm.
 * User: Jan
 * Date: 6/11/2015
 * Time: 2:28 PM
 */
$db = getConnected("player");
$q = $db->query("SELECT COUNT(id) AS count FROM player.player WHERE DATE_SUB(NOW(), INTERVAL 5 MINUTE) < last_play;");
while ($res = $q->fetch_assoc()) {
    if ($res['count'] == "" || $res['count'] == "0") {
        echo "<li class='offline'><span>Player Online: 0 </span></li>";
    } else {
        echo "<li class='online'><span>Player Online: " . $res['count'] . "</span></li>";
    }
}
$q = $db->query("SELECT COUNT(id) AS count FROM player.player WHERE DATE_SUB(NOW(), INTERVAL 24 HOUR) < last_play;");
while ($res = $q->fetch_assoc()) {
    if ($res['count'] == "" || $res['count'] == "0") {
        echo "<li class='offline'><span>Player Online (24):  0 </span></li>";
    } else {
        echo "<li class='online'><span>Player Online (24): " . $res['count'] . "</span></li>";
    }
}
$q = $db->query("SELECT COUNT(id) FROM account.account;");
while ($res = $q->fetch_assoc()) {
    echo "<li class='online'><span>Registered Accounts: " . $res["COUNT(id)"] . "</span></li>";
}
$q = $db->query("SELECT COUNT(id) FROM player.player;");
while ($res = $q->fetch_assoc()) {
Beispiel #4
0
}
?>
<h2><?php 
echo _T("Samba status", "samba");
?>
</h2>

<div class="fixheight"></div>

<?php 
$pid = array();
$user = array();
$machine = array();
$ip = array();
$connections = array();
foreach (getConnected() as $item) {
    $connections[$item['useruid']][] = array($item['pid'], $item['machine'], $item['ip']);
}
ksort($connections);
foreach ($connections as $uid => $infos) {
    foreach ($infos as $info) {
        $user[] = $uid;
        $pid[] = $info[0];
        $machine[] = $info[1];
        $ip[] = $info[2];
    }
}
?>
    <h2><?php 
echo _T("Opened sessions", "samba");
?>
Beispiel #5
0
function write_coinslog($var1, $var2, $var3, $var4, $var5)
{
    // Write in Coinslog
    $coins = userinfo(coins);
    // get user coins
    $acc_id = userinfo(id);
    // get accountid
    // conect to player database
    $mysqli = getConnected("player");
    // If there is an vnum given
    if ($var4 > 0) {
        // get name by vnum
        $res = mysqli_query($mysqli, "SELECT name FROM item_proto WHERE vnum='" . $var4 . "' LIMIT 1");
        while ($row = mysqli_fetch_array($res)) {
            // return $row['name'];
            $vnum_name = " - " . $row['name'];
        }
    } else {
        $vnum_name = "";
    }
    mysqli_close($mysqli);
    // conect to account database
    $mysqli = getConnected("account");
    // Check of Coins get or lose and write log
    if ($var2 == "get") {
        $end_conins = $coins + $var1;
        //result
        if ($var5 != "0") {
            $var5 = mysqli_real_escape_string($mysqli, $var5);
            $res = mysqli_query($mysqli, "SELECT id FROM account WHERE login='******' LIMIT 1");
            while ($row = mysqli_fetch_array($res)) {
                $acc_id = $row["id"];
            }
            if (!is_numeric($coins)) {
                $coins = "0";
            }
            mysqli_query($mysqli, "INSERT INTO cms_coinslog (account_id,coins_balance,date,typ,content,balance) VALUES ('{$acc_id}','" . $var1 . "',NOW(),'get','" . $var3 . $vnum_name . "','{$coins}')");
        } else {
            mysqli_query($mysqli, "INSERT INTO cms_coinslog (account_id,coins_balance,date,typ,content,balance) VALUES ('" . userinfo(id) . "','" . $var1 . "',NOW(),'get','" . $var3 . $vnum_name . "','{$coins}')");
        }
    } elseif ($var2 == "lose") {
        $end_conins = $coins - $var1;
        //result
        if ($var5 != "0") {
            $var5 = mysqli_real_escape_string($mysqli, $var5);
            $res = mysqli_query($mysqli, "SELECT id FROM account WHERE login='******' LIMIT 1");
            while ($row = mysqli_fetch_array($res)) {
                $acc_id = $row["id"];
            }
            if (!is_numeric($coins)) {
                $coins = "0";
            }
            mysqli_query($mysqli, "INSERT INTO cms_coinslog (account_id,coins_balance,date,typ,content,balance) VALUES ('{$acc_id}','" . $var1 . "',NOW(),'lost','" . $var3 . $vnum_name . "','{$coins}')");
        } else {
            mysqli_query($mysqli, "INSERT INTO cms_coinslog (account_id,coins_balance,date,typ,content,balance) VALUES ('" . userinfo(id) . "','" . $var1 . "',NOW(),'lost','" . $var3 . $vnum_name . "','{$coins}')");
        }
    }
    // Update coins in account
    mysqli_query($mysqli, "UPDATE account.account SET coins='{$end_conins}' WHERE id='" . $acc_id . "' LIMIT 1");
    // Close connection
    mysqli_close($mysqli);
}