Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
- /**
- * LICENSE:
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- *
- * @categories Games/Entertainment, Systems Administration
- * @package Bright Game Panel
- * @author warhawk3407 <warhawk3407@gmail.com> @NOSPAM
- * @copyleft 2013
- * @license GNU General Public License version 3.0 (GPLv3)
- * @version (Release 0) DEVELOPER BETA 9
- * @link http://www.bgpanel.net/
- */
- $page = 'server';
- $tab = 2;
- $isSummary = TRUE;
- if ( !isset($_GET['id']) || !is_numeric($_GET['id']) )
- {
- header( 'Location: index.php' );
- die();
- }
- $return = 'server.php';
- require("configuration.php");
- require("include.php");
- require("./libs/lgsl/lgsl_class.php");
- require("./includes/func.ssh2.inc.php");
- require_once("./libs/phpseclib/Crypt/AES.php");
- $title = T_('Server Summary');
- $serverid = mysql_real_escape_string($_GET['id']);
- if (query_numrows( "SELECT `name` FROM `".DBPREFIX."server` WHERE `serverid` = '".$serverid."'" ) == 0)
- {
- exit('Error: ServerID is invalid.');
- }
- $rows = query_fetch_assoc( "SELECT * FROM `".DBPREFIX."server` WHERE `serverid` = '".$serverid."' LIMIT 1" );
- $serverIp = query_fetch_assoc( "SELECT `ip` FROM `".DBPREFIX."boxIp` WHERE `ipid` = '".$rows['ipid']."' LIMIT 1" );
- $box = query_fetch_assoc( "SELECT * FROM `".DBPREFIX."box` WHERE `boxid` = '".$rows['boxid']."' LIMIT 1" );
- $type = query_fetch_assoc( "SELECT `querytype` FROM `".DBPREFIX."game` WHERE `gameid` = '".$rows['gameid']."' LIMIT 1");
- $game = query_fetch_assoc( "SELECT `game` FROM `".DBPREFIX."game` WHERE `gameid` = '".$rows['gameid']."' LIMIT 1" );
- $group = query_fetch_assoc( "SELECT `name` FROM `".DBPREFIX."group` WHERE `groupid` = '".$rows['groupid']."' LIMIT 1" );
- $logs = mysql_query( "SELECT * FROM `".DBPREFIX."log` WHERE `serverid` = '".$serverid."' ORDER BY `logid` DESC LIMIT 15" );
- //---------------------------------------------------------+
- $checkGroup = checkClientGroup($rows['groupid'], $_SESSION['clientid']);
- if ($checkGroup == FALSE)
- {
- $_SESSION['msg1'] = T_('Error!');
- $_SESSION['msg2'] = T_('This is not your server!');
- $_SESSION['msg-type'] = 'error';
- header( 'Location: index.php' );
- die();
- }
- //---------------------------------------------------------+
- include("./bootstrap/header.php");
- /**
- * Notifications
- */
- include("./bootstrap/notifications.php");
- ?>
- <div class="tabbable">
- <ul class="nav nav-tabs">
- <li <?php if(!isset($_GET['s']) || empty($_GET['s'])){ ?>class="active"<?php }?>><a href="#1" data-toggle="tab"><?php echo T_('Server Summary'); ?></a></li>
- <li><a href="#2" data-toggle="tab"><?php echo T_('Server Control Panel'); ?></a></li>
- <?php
- if ($type['querytype'] != 'none')
- {
- echo "\t\t\t\t\t<li><a href=\"#3\" data-toggle=\"tab\">LGSL</a></li>";
- }
- ?>
- <?php
- if ($rows['panelstatus'] == 'Started')
- {
- echo "\t\t\t\t\t<li><a href=\"utilitiesrcontool.php?serverid=".$serverid."\">".T_('RCON Tool')."</a></li>";
- }
- if($rows['panelstatus'] != 'Started' && strcmp($game['game'], "Minecraft") == 0)
- {
- if(!isset($_GET['s']) || empty($_GET['s']))
- echo "\t\t\t\t\t<li><a href=\"#6\" data-toggle=\"tab\">Bukkit Plugins</a></li>";
- else
- echo "\t\t\t\t\t<li class=\"active\"><a href=\"#6\" data-toggle=\"tab\">Bukkit Plugins</a></li>";
- }
- ?>
- <li><a href="#5" data-toggle="tab"><?php echo T_('Activity Logs'); ?></a></li>
- </ul>
- <div class="tab-content">
- <div class="tab-pane <?php if(!isset($_GET['s']) || empty($_GET['s'])){ ?>active<?php } ?>" id="1">
- <div class="row-fluid">
- <div class="span6">
- <div class="well">
- <div style="text-align: center; margin-bottom: 5px;">
- <span class="label label-info"><?php echo T_('Server Information'); ?></span>
- </div>
- <table class="table table-striped table-bordered table-condensed">
- <tr>
- <td><?php echo T_('Name'); ?></td>
- <td><?php echo htmlspecialchars($rows['name'], ENT_QUOTES); ?></td>
- </tr>
- <tr>
- <td><?php echo T_('Status'); ?></td>
- <td><?php echo formatStatus($rows['status']); ?></td>
- </tr>
- <tr>
- <td><?php echo T_('Owner Group'); ?></td>
- <td><?php echo htmlspecialchars($group['name'], ENT_QUOTES); ?></td>
- </tr>
- <tr>
- <td><?php echo T_('Game'); ?></td>
- <td><?php echo htmlspecialchars($game['game'], ENT_QUOTES); ?></td>
- </tr>
- <tr>
- <td><?php echo T_('IP Address'); ?></td>
- <td><?php echo $serverIp['ip']; ?></td>
- </tr>
- <tr>
- <td><?php echo T_('Port'); ?></td>
- <td><?php echo $rows['port']; ?></td>
- </tr>
- <tr>
- <td><?php echo T_('Query Port'); ?></td>
- <td><?php echo $rows['queryport']; ?></td>
- </tr>
- <tr>
- <td><?php echo T_('Slots'); ?></td>
- <td><?php echo $rows['slots']; ?></td>
- </tr>
- </table>
- </div>
- </div>
- <div class="span6">
- <div class="well">
- <div style="text-align: center; margin-bottom: 5px;">
- <span class="label label-info"><?php echo T_('Server Configuration'); ?></span>
- </div>
- <table class="table table-striped table-bordered table-condensed">
- <tr>
- <td><?php echo T_('Priority'); ?></td>
- <td colspan="2"><?php echo $rows['priority']; ?></td>
- </tr>
- <tr>
- <td><?php echo T_('Start Command'); ?></td>
- <td colspan="2"><?php echo htmlspecialchars($rows['startline'], ENT_QUOTES); ?></td>
- </tr>
- <tr>
- <td><?php echo T_('Directory'); ?></td>
- <td colspan="2"><?php echo htmlspecialchars(dirname($rows['path']), ENT_QUOTES); ?></td>
- </tr>
- <tr>
- <td><?php echo T_('Executable'); ?></td>
- <td colspan="2"><?php echo htmlspecialchars(basename($rows['path']), ENT_QUOTES); ?></td>
- </tr>
- <tr>
- <td><?php echo T_('Screen Name'); ?></td>
- <td colspan="2"><?php echo $rows['screen']; ?></td>
- </tr>
- <?php
- $n = 1;
- while ($n < 10)
- {
- if (!empty($rows['cfg'.$n.'name']) || !empty($rows['cfg'.$n]))
- {
- ?>
- <tr>
- <td><?php echo htmlspecialchars($rows['cfg'.$n.'name'], ENT_QUOTES); ?></td>
- <td><?php echo htmlspecialchars($rows['cfg'.$n.''], ENT_QUOTES); ?></td>
- <td>{cfg<?php echo $n; ?>}</td>
- </tr>
- <?php
- }
- ++$n;
- }
- unset($n);
- ?>
- </table>
- </div>
- </div>
- </div>
- <div class="row">
- <div class="span6">
- <div class="well">
- <div style="text-align: center; margin-bottom: 5px;">
- <span class="label label-info"><?php echo T_('Server Monitoring'); ?></span>
- </div>
- <table class="table table-striped table-bordered table-condensed">
- <tr>
- <td><?php echo T_('Query Type'); ?></td>
- <td><?php echo $type['querytype']; ?></td>
- </tr>
- <tr>
- <td><?php echo T_('Panel Status'); ?></td>
- <td><?php echo formatStatus($rows['panelstatus']); ?></td>
- </tr>
- <?php
- if (($rows['status'] == 'Active') && ($rows['panelstatus'] == 'Started'))
- {
- //---------------------------------------------------------+
- //Querying the server
- $server = lgsl_query_live($type['querytype'], $serverIp['ip'], NULL, $rows['queryport'], NULL, 's');
- //
- //---------------------------------------------------------+
- }
- ?>
- <tr>
- <td><?php echo T_('Net Status'); ?></td>
- <td><?php
- if (@$server['b']['status'] == '1')
- {
- echo formatStatus('Online');
- }
- else
- {
- echo formatStatus('Offline');
- }
- ?></td>
- </tr>
- <tr>
- <td><?php echo T_('Map'); ?></td>
- <td><?php echo @$server['s']['map']; ?></td>
- </tr>
- <tr>
- <td><?php echo T_('Players'); ?></td>
- <td><?php echo @$server['s']['players']; ?> / <?php echo @$server['s']['playersmax']; ?></td>
- </tr>
- </table>
- </div>
- </div>
- </div>
- </div>
- <div class="tab-pane" id="2">
- <div class="row">
- <div class="span12">
- <div class="well">
- <div style="text-align: center; margin-bottom: 5px;">
- <span class="label label-info"><?php echo T_('Server Control Panel'); ?></span>
- </div>
- <?php
- if ($rows['status'] == 'Pending')
- {
- ?>
- <div class="alert alert-info">
- <h4 class="alert-heading"><?php echo T_('Server not validated !'); ?></h4>
- <p>
- <?php echo T_('An administrator must validate the server in order to use it.'); ?>
- </p>
- </div>
- <?php
- }
- else if ($rows['status'] == 'Inactive')
- {
- ?>
- <div class="alert alert-block" style="text-align: center;">
- <h4 class="alert-heading"><?php echo T_('The server has been disabled !'); ?></h4>
- </div>
- <?php
- }
- else if ($rows['status'] == 'Active')
- {
- //---------------------------------------------------------+
- ?>
- <table class="table">
- <tr>
- <td><?php echo T_('Path'); ?></td>
- <td><?php echo T_('Screen Name'); ?></td>
- <td><?php echo T_('Box'); ?></td>
- <td><?php echo T_('IP:Port'); ?></td>
- <td><?php echo T_('Panel Status'); ?></td>
- <td><?php echo T_('Net Status'); ?></td>
- </tr>
- <tr>
- <td><?php echo htmlspecialchars($rows['path'], ENT_QUOTES); ?></td>
- <td><?php echo $rows['screen']; ?></td>
- <td><?php echo htmlspecialchars($box['name'], ENT_QUOTES); ?></td>
- <td><?php echo $serverIp['ip'].':'.$rows['port']; ?></td>
- <td><?php echo formatStatus($rows['panelstatus']); ?></td>
- <td><?php
- if (@$server['b']['status'] == '1')
- {
- echo formatStatus('Online');
- }
- else
- {
- echo formatStatus('Offline');
- }
- unset($server);
- ?></td>
- </tr>
- </table>
- <div style="text-align: center;">
- <?php
- if ($rows['panelstatus'] == 'Stopped') //The server has been validated and is marked as offline, the only available action is to start it
- {
- ?>
- <a href="serverprocess.php?task=serverstart&serverid=<?php echo $serverid; ?>" class="btn btn-primary"><i class="icon-play icon-white"></i> <?php echo T_('Start'); ?></a>
- <?php
- }
- else if ($rows['panelstatus'] == 'Started') //The server has been validated and is marked as online, the available actions are to restart or to stop it
- {
- ?>
- <a href="serverprocess.php?task=serverstop&serverid=<?php echo $serverid; ?>" class="btn btn-warning"><i class="icon-stop icon-white"></i> <?php echo T_('Stop'); ?></a>
- <a href="serverprocess.php?task=serverreboot&serverid=<?php echo $serverid; ?>" class="btn btn-primary"><i class="icon-repeat icon-white"></i> <?php echo T_('Restart'); ?></a>
- <?php
- }
- ?>
- <a href="#" class="btn btn-primary" onclick="dlScrLog();return false;"><i class="icon-download-alt icon-white"></i> <?php echo T_('Download Screenlog'); ?></a>
- <?php
- //---------------------------------------------------------+
- }
- ?>
- </div>
- </div>
- </div>
- </div>
- </div>
- <div class="tab-pane" id="3">
- <div class="well">
- <?php
- if ($type['querytype'] != 'none')
- {
- /*----------------------------------------------------------------------------------------------------------\
- | |
- | [ LIVE GAME SERVER LIST ] [ © RICHARD PERRY FROM GREYCUBE.COM ] |
- | |
- | Released under the terms and conditions of the GNU General Public License Version 3 (http://gnu.org) |
- | |
- \-----------------------------------------------------------------------------------------------------------*/
- //------------------------------------------------------------------------------------------------------------+
- // THIS CONTROLS HOW THE PLAYER FIELDS ARE DISPLAYED
- $fields_show = array("name", "score", "kills", "deaths", "team", "ping", "bot", "time"); // ORDERED FIRST
- $fields_hide = array("teamindex", "pid", "pbguid"); // REMOVED
- $fields_other = TRUE; // FALSE TO ONLY SHOW FIELDS IN $fields_show
- //------------------------------------------------------------------------------------------------------------+
- // GET THE SERVER DETAILS AND PREPARE IT FOR DISPLAY
- global $output;
- $output = "";
- global $lgsl_server_id;
- $lgsl_server_id = $serverid;
- $server = lgsl_query_cached("", "", "", "", "", "sep", $lgsl_server_id);
- //if (!$server) { $output .= "<div style='margin:auto; text-align:center'> {$lgsl_config['text']['mid']} </div>"; return; }
- $fields = lgsl_sort_fields($server, $fields_show, $fields_hide, $fields_other);
- $server = lgsl_sort_players($server);
- $server = lgsl_sort_extras($server);
- $misc = lgsl_server_misc($server);
- $server = lgsl_server_html($server);
- //------------------------------------------------------------------------------------------------------------+
- // SHOW THE STANDARD INFO
- $output .= "
- <table class='table table-bordered table-striped'>
- <thead>
- <tr>
- <th colspan='6' style='text-align: center;'> {$server['s']['name']} </th>
- <th colspan='2' style='text-align: center;'> <a href='{$misc['software_link']}'>{$lgsl_config['text']['slk']}</a> </th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td><b> {$lgsl_config['text']['sts']} </b></td>
- <td><b> {$lgsl_config['text']['adr']} </b></td>
- <td><b> {$lgsl_config['text']['cpt']} </b></td>
- <td><b> {$lgsl_config['text']['qpt']} </b></td>
- <td><b> {$lgsl_config['text']['typ']} </b></td>
- <td><b> {$lgsl_config['text']['gme']} </b></td>
- <td><b> {$lgsl_config['text']['map']} </b></td>
- <td><b> {$lgsl_config['text']['plr']} </b></td>
- </tr>
- <tr>
- <td> {$misc['text_status']} </td>
- <td> {$server['b']['ip']} </td>
- <td> {$server['b']['c_port']} </td>
- <td> {$server['b']['q_port']} </td>
- <td> {$server['b']['type']} </td>
- <td> {$server['s']['game']} </td>
- <td> {$server['s']['map']} </td>
- <td> {$server['s']['players']} / {$server['s']['playersmax']} </td>
- </tr>
- </tbody>
- </table>";
- //------------------------------------------------------------------------------------------------------------+
- $output .= "\r\n\r\n\t\t\t<hr>\r\n";
- //------------------------------------------------------------------------------------------------------------+
- // SHOW THE PLAYERS
- if (empty($server['p']) || !is_array($server['p']))
- {
- $output .= "\r\n\t\t\t<div style='text-align: center;'><span class='label'> {$lgsl_config['text']['npi']} </span></div>";
- }
- else
- {
- $output .= "
- <table class='table table-striped'>
- <thead>
- <tr>";
- foreach ($fields as $field)
- {
- $field = ucfirst($field);
- $output .= "
- <td><b> {$field} </b></td>\r\n";
- }
- $output .= "
- </tr>
- </thead>
- <tbody>";
- foreach ($server['p'] as $player_key => $player)
- {
- $output .= "
- <tr>";
- foreach ($fields as $field)
- {
- $output .= "
- <td> {$player[$field]} </td>";
- }
- $output .= "
- </tr>";
- }
- $output .= "
- </tbody>
- </table>";
- }
- //------------------------------------------------------------------------------------------------------------+
- $output .= "\r\n\r\n\t\t\t<hr>\r\n";
- //------------------------------------------------------------------------------------------------------------+
- // SHOW THE SETTINGS
- if (empty($server['e']) || !is_array($server['e']))
- {
- $output .= "\r\n\t\t\t<div style='text-align: center;'><span class='label'> {$lgsl_config['text']['nei']} </span></div>";
- }
- else
- {
- $output .= "
- <table class='table table-striped'>
- <thead>
- <tr>
- <td><b> {$lgsl_config['text']['ehs']} </b></td>
- <td><b> {$lgsl_config['text']['ehv']} </b></td>
- </tr>
- </thead>
- <tbody>";
- foreach ($server['e'] as $field => $value)
- {
- $output .= "
- <tr>
- <td> {$field} </td>
- <td> {$value} </td>
- </tr>";
- }
- $output .= "
- </tbody>
- </table>";
- }
- echo $output;
- unset($output);
- }
- ?>
- </div>
- </div>
- <div class="tab-pane" id="5">
- <div class="row">
- <div class="span6 offset3">
- <div class="well">
- <div style="text-align: center; margin-bottom: 5px;">
- <span class="label label-info"><?php echo T_('Last 15 Actions'); ?></span>
- </div>
- <table class="table table-bordered">
- <?php if (mysql_num_rows($logs) == 0){ ?>
- <tr>
- <td>
- <div style="text-align: center;"><span class="label label-warning"><?php echo T_('No Logs Found'); ?></span></div>
- </td>
- </tr>
- <?php
- }
- while ($rowsLogs = mysql_fetch_assoc($logs)){
- ?>
- <tr>
- <td>
- <div style="text-align: center;"><?php echo formatDate($rowsLogs['timestamp']); ?> - <?php echo htmlspecialchars($rowsLogs['message']); ?></div>
- </td>
- </tr>
- <?php
- }
- unset($logs);
- ?>
- </table>
- </div>
- </div>
- </div>
- </div>
- <div class="tab-pane <?php if(isset($_GET['s']) && !empty($_GET['s'])){ ?>active<?php } ?>" id="6">
- <div class="row">
- <div class="span6 offset3">
- <div class="well">
- <?php
- require_once("./libs/phpseclib/SFTP.php");
- $aes = new Crypt_AES();
- $aes->setKeyLength(256);
- $aes->setKey(CRYPT_KEY);
- // Get SFTP
- $sftp = new Net_SFTP($box['ip'], $box['sshport']);
- if (!$sftp->login($box['login'], $aes->decrypt($box['password'])))
- {
- $_SESSION['msg1'] = T_('Connection Error!');
- $_SESSION['msg2'] = '';
- $_SESSION['msg-type'] = 'error';
- header( "Location: index.php");
- die();
- }
- $plugins = array();
- foreach($sftp->rawlist(dirname($rows['path']).'/plugins/') as $filename => $attr) {
- if ($attr['type'] == NET_SFTP_TYPE_REGULAR) {
- $ch = curl_init();
- curl_setopt($ch, CURLOPT_URL,"http://api.bukget.org/3/search/versions.0.filename/equals/".$filename);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
- curl_setopt($ch, CURLOPT_USERAGENT, 'RedstonePower (BGP custom)');
- $server_output = curl_exec($ch);
- curl_close ($ch);
- $info = json_decode($server_output, true);
- $plugins[] = array($filename, $info[0]);
- }else{
- continue;
- }
- }
- if(isset($_GET['s']) && !empty($_GET['s']))
- {
- $ch = curl_init();
- curl_setopt($ch, CURLOPT_URL,"http://api.bukget.org/3/search/plugin_name/like/".$_GET['s']."?fields=plugin_name,versions,slug");
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
- curl_setopt($ch, CURLOPT_USERAGENT, 'RedstonePower (BGP custom)');
- $server_output = curl_exec($ch);
- curl_close ($ch);
- $info = json_decode($server_output, true);
- ?>
- <div style="text-align: center; margin-bottom: 5px;">
- <span class="label label-info">Search plugins</span>
- </div>
- <table class="table table-bordered">
- <?php
- foreach($info as $key => $value)
- {
- if(!(preg_match("@CB 1\.7\.[9,10]-(.*?)@", $value['versions'][0]['game_versions'][0]) == 1) && isset($_GET['comp'])) continue;
- ?>
- <tr>
- <td>
- <div style="text-align: center;"><a href="http://dev.bukkit.org/bukkit-plugins/<?php echo $value['slug']; ?>/"><?php echo $value['plugin_name']; ?></a></div>
- </td>
- <?php
- if(false !== $plug = array_search($value['plugin_name'], $plugins))
- {
- ?>
- <td>
- <div style="text-align: center;"><a href="serverprocess.php?task=rmBukkitPlug&serverid=<?php echo $serverid; ?>&id=<?php echo $value['slug']; ?>" title="Remove <?php echo $value['plugin_name']; ?>"><span class="icon icon-remove"></span></a></div>
- </td>
- </tr>
- <?php
- }else{
- ?>
- <td>
- <?php
- if(preg_match("@CB 1\.7\.[9,10]-(.*?)@", $value['versions'][0]['game_versions'][0]) == 1)
- {
- ?>
- <div style="text-align: center;"><a href="serverprocess.php?task=addBukkitPlug&serverid=<?php echo $serverid; ?>&id=<?php echo $value['slug']; ?>" title="Install <?php echo $value['plugin_name']; ?>"><span class="icon icon-ok"></span></a></div>
- <?php
- }else{
- ?>
- <div style="text-align: center;"><span class="label label-warning" title="There is no version available for your version of bukkit">Not compatible</span></div>
- <?php
- }
- ?>
- </td>
- </tr>
- <?php
- }
- }
- ?>
- </table>
- <?php
- }else{
- ?>
- <div style="text-align: center; margin-bottom: 5px;">
- <span class="label label-info">Installed</span>
- </div>
- <table class="table table-bordered">
- <?php
- if(empty($plugins) && sizeof($plugins) == 0)
- {
- ?>
- <tr>
- <td>
- <div style="text-align: center;"><span class="label label-warning"><?php echo T_('No plugins installed'); ?></span></div>
- </td>
- </tr>
- <?php
- }else{
- foreach($plugins as $name)
- {
- ?>
- <tr>
- <td>
- <div style="text-align: center;"><a href="http://dev.bukkit.org/bukkit-plugins/<?php echo $name[1]['slug']; ?>/"><?php echo $name[1]['plugin_name']; ?></a></div>
- </td>
- <td>
- <div style="text-align: center;"><a href="serverprocess.php?task=rmBukkitPlug&serverid=<?php echo $serverid; ?>&id=<?php echo $name[1]['slug']; ?>" title="Remove <?php echo $name[1]['plugin_name']; ?>"><span class="icon icon-remove"></span></a></div>
- </td>
- </tr>
- <?php
- }
- }
- $sftp->disconnect();
- ?>
- </table>
- <div style="text-align: center; margin-bottom: 5px;">
- <span class="label label-success">15 Popular plugins this Month</span>
- </div>
- <table class="table table-bordered">
- <?php
- $ch = curl_init();
- curl_setopt($ch, CURLOPT_URL,"http://api.bukget.org/3/plugins?size=15&sort=popularity.monthly");
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
- curl_setopt($ch, CURLOPT_USERAGENT, 'RedstonePower (BGP custom)');
- $server_output = curl_exec($ch);
- curl_close ($ch);
- $info = json_decode($server_output, true);
- foreach($info as $key => $value)
- {
- echo "<tr><td><div style=\"text-align: center;\"><a href=\"http://dev.bukkit.org/bukkit-plugins/".$value['slug']."\">".$value['plugin_name'] . "</a></div></td>";
- $ch = curl_init();
- curl_setopt($ch, CURLOPT_URL,"http://api.bukget.org/3/plugins/bukkit/".$info[0]['slug']."/latest");
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
- curl_setopt($ch, CURLOPT_USERAGENT, 'RedstonePower (BGP custom)');
- $server_output = curl_exec($ch);
- curl_close ($ch);
- $info2 = json_decode($server_output, true);
- if((preg_match("@CB 1\.7\.[9,10]-(.*?)@", $info2['versions'][0]['game_versions'][0]) == 1))
- {
- echo "<td><div style=\"text-align: center;\"><a href=\"serverprocess.php?task=addBukkitPlug&serverid=".$serverid."&id=".$info[0]['slug']."\" title=\"Install ".$value['plugin_name']."\"><span class=\"icon icon-ok\"></span></a></div></td>
- </tr>";
- }
- }
- ?>
- </table>
- <?php } ?>
- <div style="text-align: center; margin-bottom: 5px;">
- <span class="label label-info">Search</span>
- </div>
- <table class="table table-bordered">
- <form method="get">
- <input type="hidden" name="id" value="<?php echo $serverid; ?>" />
- <tr>
- <td><input type="text" name="s" placeholder="Search.." value="<?php echo htmlentities($_GET['s']); ?>" /></td>
- <td>Only compatible: <input type="checkbox" name="comp" <?php if(isset($_GET['comp'])){ ?>checked<?php } ?> /></td>
- <td><input type="submit" value="Search" /></td>
- </tr>
- </form>
- </table>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- <div style="text-align: center;">
- <ul class="pager">
- <li>
- <a href="index.php"><?php echo T_('Back to Home'); ?></a>
- </li>
- </ul>
- </div>
- <script>
- function dlScrLog()
- {
- if (confirm("<?php echo T_('Download SCREENLOG ?'); ?>"))
- {
- window.location.href='serverprocess.php?task=getserverlog&serverid=<?php echo $serverid; ?>';
- }
- }
- </script>
- <?php
- include("./bootstrap/footer.php");
- ?>
Add Comment
Please, Sign In to add comment