本文整理汇总了PHP中Lobby类的典型用法代码示例。如果您正苦于以下问题:PHP Lobby类的具体用法?PHP Lobby怎么用?PHP Lobby使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Lobby类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: getDependencyVersion
/**
* Get Version of a component
*/
public static function getDependencyVersion($dependency)
{
/**
* If dependency is 'app/admin' etc.
*/
if (strpos($dependency, "/") !== false) {
list($dependency, $subDependency) = explode("/", $dependency);
}
switch ($dependency) {
case "lobby":
return \Lobby::getVersion();
break;
case "app":
$App = new Apps($subDependency);
return $App->exists ? $App->info["version"] : 0;
break;
case "curl":
$curl = function_exists("curl_version") ? curl_version() : 0;
return $curl === 0 ? 0 : $curl["version"];
break;
default:
/**
* phpversion() returns FALSE on failure
*/
$v = phpversion($dependency);
return $v ? $v : 0;
}
}
开发者ID:LobbyOS,项目名称:server,代码行数:31,代码来源:Need.php
示例2: makePanelItem
public function makePanelItem($text, $href, $id, $extraClass = "")
{
if ($href == L_URL) {
/**
* Home button
*/
$html = "<li class='item {$extraClass}' id='home'><a href='" . L_URL . "'></a></li>";
} else {
if ($href == "/admin") {
/**
* Admin button
*/
$html = "<li class='item {$extraClass}' id='lobby'><a href='" . \Lobby::u($href) . "' class='parent'>Lobby</a></li>";
} else {
$html = '<li class="item ' . $extraClass . '" id="' . $id . '">';
if ($href == "") {
$html .= $text;
} else {
if ($href === "htmlContent") {
$html .= $text;
} else {
$html .= \Lobby::l($href, $text);
}
}
$html .= '</li>';
}
}
return $html;
}
开发者ID:LobbyOS,项目名称:server,代码行数:29,代码来源:Theme.php
示例3: init
public function init()
{
if (!\Lobby::status("lobby.assets-serve")) {
$this->addScript("filepicker.js");
$this->addStyle("filepicker.css");
}
}
开发者ID:LobbyOS,项目名称:server,代码行数:7,代码来源:Module.php
示例4: loadTheme
/**
* Load a theme
*/
public static function loadTheme()
{
require_once L_DIR . "/includes/src/UI/Theme.php";
require_once THEME_DIR . "/Theme.php";
$className = "\\Lobby\\UI\\Themes\\" . self::$theme;
$GLOBALS["THEME_OBJ"] = new $className();
$GLOBALS["THEME_OBJ"]->init();
/**
* Load Panel
*/
if (\Lobby::status("lobby.admin")) {
\Lobby::hook("admin.head.begin", function () {
$GLOBALS["THEME_OBJ"]->panel(true);
$GLOBALS["THEME_OBJ"]->addStyle("/style.css");
$GLOBALS["THEME_OBJ"]->addStyle("/admin.style.css");
});
\Lobby::hook("admin.body.begin", function () {
echo $GLOBALS["THEME_OBJ"]->inc("/Panel/load.admin.php");
});
} else {
$GLOBALS["THEME_OBJ"]->addStyle("/style.css");
\Lobby::hook("head.begin", function () {
$GLOBALS["THEME_OBJ"]->panel(false);
});
\Lobby::hook("body.begin", function () {
echo $GLOBALS["THEME_OBJ"]->inc("/Panel/load.php");
});
}
}
开发者ID:saviobosco,项目名称:lobby,代码行数:32,代码来源:Themes.php
示例5: __constructStatic
public static function __constructStatic()
{
/**
* Get DB config
*/
$config = \Lobby::config(true);
if (is_array($config)) {
/**
* Make DB credentials variables from the config.php file
*/
self::$prefix = $config['prefix'];
self::$type = $config['type'];
$options = array(\PDO::ATTR_PERSISTENT => true, \PDO::ATTR_ERRMODE => \PDO::ERRMODE_EXCEPTION);
try {
if ($config['type'] === 'mysql') {
self::$dbh = new \PDO("mysql:dbname={$config['dbname']};host={$config['host']};port={$config['port']};charset=utf8;", $config['username'], $config['password'], $options);
/**
* Check if Lobby tables exist
*/
$notable = false;
$tables = array("options", "data");
// The Tables of Lobby
foreach ($tables as $tableName) {
$results = self::$dbh->prepare("SHOW TABLES LIKE ?");
$results->execute(array(self::$prefix . $tableName));
if ($results->rowCount() == 0) {
$notable = true;
}
}
} else {
if ($config['type'] === 'sqlite') {
self::$dbh = new \PDO("sqlite:" . \Lobby\FS::loc($config['path']), "", "", $options);
/**
* Enable Multithreading Read/Write
*/
self::$dbh->exec("PRAGMA journal_mode=WAL;");
/**
* Check if Lobby tables exist
*/
$sql = self::$dbh->query("SELECT COUNT(1) FROM `sqlite_master` WHERE `type` = 'table' AND (`name` = 'l_data' OR `name` = 'l_options')");
$notable = $sql->fetchColumn() === "2" ? false : true;
}
}
if ($notable === false) {
/* There are database tables */
parent::$installed = true;
} else {
parent::log(array("fatal", "Tables required by Lobby was not found in the database. Check your <b>config.php</b> and database to fix the error. Or Install again by removing <b>config.php</b>."));
}
} catch (\PDOException $e) {
parent::$installed = false;
$error = $e->getMessage();
parent::log(array("fatal", "Unable to connect to database server. Is the database credentials given in <b>config.php</b> correct ? <blockquote>{$error}</blockquote>"));
}
} else {
self::$installed = false;
}
}
开发者ID:LobbyOS,项目名称:server,代码行数:58,代码来源:DB.php
示例6: lookForLobby
static function lookForLobby()
{
$database = DB::getInstance();
if (self::isUserInLobby()) {
return Lobby::viewLobby();
} else {
return ['loadview' => 'loadingpage', 'randomTip' => self::getRandomTip()];
}
}
开发者ID:Carl-the-menace,项目名称:RoadToDevGlobal,代码行数:9,代码来源:LobbyLoader.class.php
示例7: __constructStatic
public static function __constructStatic()
{
if (!isset($_COOKIE['csrfToken'])) {
self::$token = Helper::randStr(10);
setcookie("csrfToken", self::$token, 0, "/", Lobby::getHostname());
} else {
self::$token = $_COOKIE['csrfToken'];
}
}
开发者ID:LobbyOS,项目名称:server,代码行数:9,代码来源:CSRF.php
示例8: MasterAdd
public function MasterAdd($id, $name, $description, $password)
{
$random_salt = \Lobby::randStr(15);
$hashed = hash("sha512", $this->master_salt . $password . $random_salt);
if (!$this->MasterExists($id)) {
saveData("master_" . $id . "_name", $name);
saveData("master_" . $id . "_description", $description);
saveData("master_" . $id . "_password", $hashed);
saveData("master_" . $id . "_password_salt", $random_salt);
saveData("master_" . $id . "_items", '');
\H::saveJSONData("keyrings", array($id => 1));
return true;
} else {
return false;
}
}
开发者ID:saviobosco,项目名称:lobby,代码行数:16,代码来源:App.php
示例9: init
public function init()
{
if (\Lobby::status("lobby.assets-serve") === false) {
$this->install();
$this->routes();
require_once $this->app->dir . "/src/inc/load.php";
if (LS::$loggedIn) {
/**
* Logged In
*/
Hooks::addAction("init", function () {
/**
* Add Change Password Item in Top Panel -> Admin before Log Out item
* This is done by first removing the Log Out item, adding the Change
* Password item and then adding back the Log Out item
*/
\Lobby\UI\Panel::addTopItem('adminModule', array("text" => "<img src='" . $this->app->srcURL . "/src/image/logo.svg' style='width: 40px;height: 40px;' />", "href" => "/", "position" => "left", "subItems" => array("changePassword" => array("text" => "Change Password", "href" => "/app/admin/change-password"), 'LogOut' => array("text" => "Log Out", "href" => "/app/admin/logout"))));
});
} else {
/**
* If `indi` module is active, make the index page available to everyone
*/
if (!Modules::exists("app_indi")) {
if (\Lobby::curPage() != "/admin/login" && !\Lobby::status("lobby.install")) {
\Response::redirect("/admin/login");
}
} else {
Panel::removeTopItem("indiModule", "left");
if (\Lobby::curPage() != "/admin/login" && \Lobby::curPage() != "/admin/install.php" && substr(\Lobby::curPage(), 0, 6) == "/admin") {
\Response::redirect("/admin/login");
}
}
Hooks::addFilter("panel.left.items", function ($left) {
unset($left["lobbyAdmin"]);
if (Modules::exists("app_indi")) {
unset($left["indiModule"]);
}
return $left;
});
Assets::removeJS("notify");
Assets::removeCSS("notify");
}
}
}
开发者ID:LobbyOS,项目名称:server,代码行数:44,代码来源:Module.php
示例10: init
public static function init()
{
$root = L_DIR;
$config = \Lobby::config(true);
if (is_array($config)) {
/**
* Make DB credentials variables from the config.php file
*/
self::$prefix = $config['prefix'];
$options = array(\PDO::ATTR_PERSISTENT => true, \PDO::ATTR_ERRMODE => \PDO::ERRMODE_EXCEPTION);
try {
self::$dbh = new \PDO("mysql:dbname={$config['dbname']};host={$config['host']};port={$config['port']}", $config['username'], $config['password'], $options);
$notable = false;
$tables = array("options", "data");
// The Tables of Lobby
foreach ($tables as $tableName) {
$results = self::$dbh->prepare("SHOW TABLES LIKE ?");
$results->execute(array(self::$prefix . $tableName));
if ($results->rowCount() == 0) {
$notable = true;
}
}
if ($notable === false) {
/* There are database tables */
parent::$installed = true;
} else {
self::$error = "Lobby Tables Not Found";
self::log("Lobby Tables not found in database. Install Again.");
}
} catch (\PDOException $e) {
parent::$installed = false;
$error = $e->getMessage();
self::$error = $error;
$GLOBALS['initError'] = array("Couldn't Connect To Database", "Unable to connect to database server. Is the credentials given in <b>config.php</b> correct ? <blockquote>" . $error . "</blockquote>");
self::log("Unable to connect to database server : " . $error);
}
} else {
self::$installed = false;
}
}
开发者ID:anandubajith,项目名称:lobby,代码行数:40,代码来源:Database.php
示例11: check
/**
* Get updates
*/
public static function check()
{
$apps = array_keys(\Lobby\Apps::getApps());
$response = \Lobby::loadURL(L_SERVER . "/updates", array("apps" => implode(",", $apps)), "POST");
if ($response) {
$response = json_decode($response, true);
if (is_array($response)) {
saveOption("lobby_latest_version", $response['version']);
saveOption("lobby_latest_version_release", $response['released']);
if (isset($response['apps']) && count($response['apps']) != 0) {
$AppUpdates = array();
foreach ($response['apps'] as $appID => $version) {
$App = new \Lobby\Apps($appID);
if ($App->info['version'] != $version) {
$AppUpdates[$appID] = $version;
}
}
saveOption("app_updates", json_encode($AppUpdates));
}
}
}
}
开发者ID:saviobosco,项目名称:lobby,代码行数:25,代码来源:Server.php
示例12:
\Lobby::ser("Output Path problem", "The path you gave as output doesn't exist or permission is not acceptable. Make sure it's an existing directory with Read & Write permission", false);
} else {
if (!ctype_alnum(str_replace(" ", "", $name))) {
\Lobby::ser("Invalid Name", "Only alphanumeric characters are allowed for Site Name", false);
} else {
if (array_search($theme, $this->themes) === false) {
\Lobby::ser("Invalid Theme", "The theme you selected doesn't exist", false);
} else {
// Everything's great
$this->addSite($name, $output, $theme);
\Lobby::sss("Site added", "The site was added successfully");
}
}
}
} else {
\Lobby::ser("Fill Up", "Please fill the form completely", false);
}
}
?>
<form action="" method="POST">
<label>
<div>Site Name</div>
<input type="text" name="site" />
</label><cl/>
<label>
<div>Output Location</div>
<input type="text" name="output" title="Where the generated site should be extracted" />
</label><cl/>
<label>
<div>Empty Output location</div>
<input type="checkbox" name="empty" title="Should the contents of output directory be removed before generating the site everytime" />
开发者ID:LobbyOS,项目名称:app-sige,代码行数:31,代码来源:new.php
示例13: User
require_once 'includes/header.php';
$uid = $_SESSION['id'];
$lid = $_GET['id'];
$request = $_GET['request'];
$team = $_GET['team'];
$class = $_GET['class'];
$ready = $_GET['ready'];
$lat = $_GET['latitude'];
$lon = $_GET['longitude'];
$fid = $_GET['fid'];
$message = $_GET['message'];
if ($uid) {
$user = new User($uid);
}
if ($lid) {
$lobby = new Lobby($lid);
}
if ($uid && $lid) {
$id = getLPid($uid, $lid);
}
if ($uid && $lid) {
switch ($request) {
case "userready":
$status = readystatus($id, true);
$leader = $lobby->lobbyLeader();
$array = array('ready' => $status, 'leader' => $leader);
echo json_encode($array);
break;
case "changeTeam":
if (isset($team) && freeslots($lid, $team) > 0) {
joinTeam($id, $team);
开发者ID:marat1803,项目名称:tf2matchmaking,代码行数:31,代码来源:api.php
示例14: array
<?php
if (!\Lobby::status("lobby.serve")) {
/**
* For enabling access by \Lobby\Panel
*/
require __DIR__ . "/class.panel.php";
/**
* Panel UI
*/
if (!\Lobby::status("lobby.install")) {
\Lobby::addScript("superfish", "/includes/lib/modules/panel/lib/superfish.js");
\Lobby::addStyle("panel", "/includes/lib/modules/panel/lib/panel.css");
\Lobby::addScript("panel", "/includes/lib/modules/panel/lib/panel.js");
}
if (\Lobby::$config['server_check'] === true) {
/**
* Default Items provided by the module
*/
\Lobby\Panel::addTopItem("netStatus", array("html" => "<span id='net' title='Online'></span>", "position" => "right"));
\Lobby::addScript("panel-item-connection", "/includes/lib/modules/panel/connection/connection.js");
}
\Lobby::hook("body.begin", function () {
include __DIR__ . "/panel.ui.php";
});
\Lobby::hook("admin.body.begin", function () {
include __DIR__ . "/panel.ui.php";
});
}
开发者ID:anandubajith,项目名称:lobby,代码行数:29,代码来源:load.php
示例15: foreach
<div class="contents">
<h2>sige</h2>
<p>Manage Pages of site <strong><?php
echo $name;
?>
</strong></p>
<p>
<?php
echo \Lobby::l("{$su}/edit", "New Page", "class='button'");
$pages = $this->getPages($name);
if (count($pages) == 0) {
\Lobby::ser("No Pages", "No pages has been created.");
echo '<p><strong>Note that a page called "index" should be created in the site.</strong></p>';
} else {
echo "<h3>Pages</h3>";
foreach ($pages as $id => $page) {
echo \Lobby::l("{$su}/edit?id={$id}", "{$id}", "class='button'") . "<cl/>";
}
}
?>
</p>
</div>
开发者ID:LobbyOS,项目名称:app-sige,代码行数:22,代码来源:pages.php
示例16: getOption
<div class="sidebar">
<div style="height:32px;text-align:center;margin-top:10px;">
<a target="_blank" href="http://lobby.subinsb.com" style="color:white;">Lobby <?php
echo getOption("lobby_version");
?>
</a>
</div>
<?php
$links = array("/admin" => "Dashboard", "/admin/apps.php" => "Apps", "/admin/lobby-store.php" => "Lobby Store", "/admin/modules.php" => "Modules", "/admin/about.php" => "About");
$curPage = \Lobby::curPage();
foreach ($links as $link => $text) {
if ($link == $curPage || $curPage == "/admin/update.php" && $text == "About") {
echo \Lobby::l($link, $text, "class='link active'");
} else {
echo \Lobby::l($link, $text, "class='link'");
}
}
?>
</div>
开发者ID:saviobosco,项目名称:lobby,代码行数:19,代码来源:sidebar.php
示例17: array
<?php
$this->addStyle("admin.css");
$this->addStyle("jquery.fancybox.css");
$this->addScript("jquery.fancybox.js");
$this->addScript("chart.min.js");
$this->addScript("admin.js");
?>
<div class='leftpane'>
<center>
<h3>logSys<br/><span style='font-size: 12px;'><?php
echo $this->manifest['version'];
?>
<a style='display: block;' href='http://subinsb.com/php-logsys?utm_source=lobby_logsys.admin' target='_blank'>Documentation</a></span></h3>
</center>
<div>
<?php
$links = array("/admin" => "Home", "/admin/users" => "Users", "/admin/tokens" => "Tokens", "/admin/stats" => "Stats", "/admin/config" => "Settings");
foreach ($links as $link => $name) {
echo $this->l($link, $name, \Lobby::curPage() == "/app/fr-logsys{$link}" ? "class='active'" : "");
}
?>
</div>
</div>
<div class='rightpane'>
开发者ID:subins2000,项目名称:lobby-fr-logsys,代码行数:25,代码来源:layout.php
示例18: define
<?php
/**
* Make important locations and URLs as
* constants to easily access them
*/
define("L_URL", \Lobby::getURL());
define("THEME_ID", Lobby\UI\Themes::getThemeID());
define("THEME_DIR", Lobby\UI\Themes::getThemeDir());
define("THEME_URL", Lobby\UI\Themes::getThemeURL());
/**
* LOAD MODULES
* ------------
* It will first, load the core modules
* Then the custom modules
*/
\Lobby\Modules::load();
开发者ID:LobbyOS,项目名称:server,代码行数:17,代码来源:extra.php
示例19: array
if ($q !== null) {
$params = array("q" => $_GET['q']);
} else {
$params = array("get" => "popular");
}
if ($p !== null) {
$params["p"] = $p;
}
$server_response = \Lobby\Server::store($params);
if ($server_response == false) {
echo ser("Nothing Found", "Nothing was found that matches your criteria. Sorry...");
} else {
echo "<div class='apps row'>";
foreach ($server_response['apps'] as $app) {
$appImage = $app['image'] != "" ? $app['image'] : L_URL . "/includes/lib/lobby/image/blank.png";
$url = \Lobby::u("/admin/lobby-store.php?app={$app['id']}");
?>
<div class="app card col s12 m6 l6">
<div class="app-inner row">
<div class="lpane col s4 m5 l4">
<a href="<?php
echo $url;
?>
">
<img src="<?php
echo $appImage;
?>
" />
</a>
</div>
<div class="rpane col s8 m6 l8">
开发者ID:LobbyOS,项目名称:server,代码行数:31,代码来源:lobby-store.php
示例20: ser
<?php
require "../load.php";
?>
<!DOCTYPE html>
<html>
<head>
<?php
\Lobby::doHook("admin.head.begin");
\Lobby::head("Install App");
//~
?>
</head>
<body>
<?php
\Lobby::doHook("admin.body.begin");
?>
<div class="workspace">
<div class="contents">
<?php
if (H::input("id") == null) {
ser("Error", "No App is mentioned. Install Apps from <a href='lobby-store.php'>Lobby Store</a>");
}
if (H::input("action") == "enable" && H::csrf()) {
$App = new \Lobby\Apps($_GET['id']);
if (!$App->exists) {
ser("Error", "App is not installed");
}
$App->enableApp();
sss("Enabled", "The App <b>{$_GET['id']}</b> is enabled. The author says thanks.<a href='" . $App->info['URL'] . "' class='button green'>Open App</a>");
}
开发者ID:saviobosco,项目名称:lobby,代码行数:31,代码来源:install-app.php
注:本文中的Lobby类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论