Skip to content

PHP 7.0 support #181

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/config.php
6 changes: 3 additions & 3 deletions admin/admins.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
</tr>
<?php
// List users
$result_usr = @mysql_query("SELECT
$result_usr = $GLOBALS['mysqli']->query("SELECT
id,
first_name,
last_name,
Expand All @@ -31,9 +31,9 @@
WHERE
deleted = '0'
ORDER BY
id DESC") or die('Failed to query for users: '.mysql_error());
id DESC") or die('Failed to query for users: '.$GLOBALS['mysqli']->error);

while($row_usr = mysql_fetch_array($result_usr))
while($row_usr = $result_usr->fetch_array())
{
$usr_id = $row_usr['id'];
$usr_fullname = $row_usr['first_name'] . ' ' . $row_usr['last_name'];
Expand Down
12 changes: 6 additions & 6 deletions admin/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@
if(GPXDEBUG)
{
// Get version
$result_vr = @mysql_query("SELECT config_value FROM configuration WHERE config_setting = 'version' LIMIT 1");
$row_vr = mysql_fetch_row($result_vr);
$result_vr = $GLOBALS['mysqli']->query("SELECT config_value FROM configuration WHERE config_setting = 'version' LIMIT 1");
$row_vr = $result_vr->fetch_row();
$gpx_version = $row_vr[0];

echo '<b>NOTICE:</b> Debug mode has been enabled in configuration.php.<br />';
echo 'DEBUG: Master Version '.$gpx_version.'<br />';
echo 'DEBUG: Document Root: '.DOCROOT.'<br />';
if(mysql_error()) echo 'DEBUG: Last MySQL error: '.mysql_error().'<br />';
if($GLOBALS['mysqli']->error) echo 'DEBUG: Last MySQL error: '.$GLOBALS['mysqli']->error.'<br />';
}
?>
<div class="infobox" style="display:none;"></div>
Expand Down Expand Up @@ -61,7 +61,7 @@
//
// Check how setup they are
//
$result_tpl = @mysql_query("SELECT
$result_tpl = $GLOBALS['mysqli']->query("SELECT
u.id AS uid,
s.id AS sid,
t.id AS tid,
Expand All @@ -71,9 +71,9 @@
LEFT JOIN servers AS s ON (SELECT id FROM servers LIMIT 1)
LEFT JOIN templates AS t ON (SELECT id FROM templates WHERE t.status = 'complete' LIMIT 1)
LEFT JOIN network AS n ON (SELECT id FROM network LIMIT 1)
LIMIT 1") or die('Failed to check setup: '.mysql_error());
LIMIT 1") or die('Failed to check setup: '.$GLOBALS['mysqli']->error);

$row_tpl = mysql_fetch_row($result_tpl);
$row_tpl = $result_tpl->fetch_row();
$ck_u = $row_tpl[0];
$ck_s = $row_tpl[1];
$ck_t = $row_tpl[2];
Expand Down
8 changes: 4 additions & 4 deletions admin/games.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
$Plugins->do_action('games_table'); // Plugins

// List supported games
$result_def = @mysql_query("SELECT
$result_def = $GLOBALS['mysqli']->query("SELECT
d.id,
d.steam,
d.name,
Expand All @@ -40,13 +40,13 @@
d.id = t.cfgid
AND (t.status = 'complete' AND t.is_default = '1')
GROUP BY
t.cfgid,
d.id,
d.intname
ORDER BY
t.is_default DESC,
d.name ASC") or die('Failed to query for games: '.mysql_error());
d.name ASC") or die('Failed to query for games: '.$GLOBALS['mysqli']->error);

while($row_def = mysql_fetch_array($result_def))
while($row_def = $result_def->fetch_array())
{
$def_gameid = $row_def['id'];
$def_steam = $row_def['steam'];
Expand Down
4 changes: 2 additions & 2 deletions admin/gamesedit.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@ function gamesedit_showsect(area)

<?php
// Get game info
$result = @mysql_query("SELECT *
$result = $GLOBALS['mysqli']->query("SELECT *
FROM default_games
WHERE
id = '$url_id'
LIMIT 1") or die('Failed to query for games');

while($row = mysql_fetch_array($result))
while($row = $result->fetch_array())
{
$def_cfg_sep = $row['cfg_separator'];
$def_cfg_ip = $row['cfg_ip'];
Expand Down
8 changes: 4 additions & 4 deletions admin/network.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
</tr>
<?php
// List network servers
$result_net = @mysql_query("SELECT DISTINCT
$result_net = $GLOBALS['mysqli']->query("SELECT DISTINCT
n.id,
n.is_local,
n.ip,
Expand All @@ -32,11 +32,11 @@
n.datacenter
FROM network AS n
WHERE
n.parentid = '0'
n.parentid IS NULL
ORDER BY
n.id DESC") or die('Failed to query for network servers: '.mysql_error());
n.id DESC") or die('Failed to query for network servers: '.$GLOBALS['mysqli']->error);

while($row_net = mysql_fetch_array($result_net))
while($row_net = $result_net->fetch_array())
{
$net_id = $row_net['id'];
#$net_local = $row_net['is_local'];
Expand Down
6 changes: 3 additions & 3 deletions admin/networkedit.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
if(empty($enc_key)) die($lang['no_enc_key']);

// List available Network Servers
$result_net = @mysql_query("SELECT
$result_net = $GLOBALS['mysqli']->query("SELECT
id,
parentid,
is_local,
Expand All @@ -26,9 +26,9 @@
homedir
FROM network
WHERE
id = '$url_id'") or die('Failed to query for network servers: '.mysql_error());
id = '$url_id'") or die('Failed to query for network servers: '.$GLOBALS['mysqli']->error);

while($row_net = mysql_fetch_array($result_net))
while($row_net = $result_net->fetch_array())
{
$net_local = $row_net['is_local'];
$net_ip = $row_net['ip'];
Expand Down
8 changes: 4 additions & 4 deletions admin/networkips.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,16 @@
if(empty($enc_key)) die($lang['no_enc_key']);

// List all IP's for this physical server
$result_net = @mysql_query("SELECT
$result_net = $GLOBALS['mysqli']->query("SELECT
n.id,
n.ip
FROM network AS n
WHERE
n.parentid = '$url_id'
ORDER BY
n.ip ASC") or die('Failed to query for IPs: '.mysql_error());
n.ip ASC") or die('Failed to query for IPs: '.$GLOBALS['mysqli']->error);

$count_ips = mysql_num_rows($result_net);
$count_ips = $result_net->num_rows;

// Tabs
$tab = 'ips';
Expand Down Expand Up @@ -56,7 +56,7 @@
}


while($row_net = mysql_fetch_array($result_net))
while($row_net = $result_net->fetch_array())
{
$net_id = $row_net['id'];
$net_ip = $row_net['ip'];
Expand Down
6 changes: 3 additions & 3 deletions admin/plugins.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
$Plugins->do_action('plugins_table'); // Plugins

// List plugins
$result_def = @mysql_query("SELECT
$result_def = $GLOBALS['mysqli']->query("SELECT
id,
active,
description,
Expand All @@ -35,12 +35,12 @@
FROM plugins
ORDER BY
active DESC,
name ASC") or die('Failed to query for plugins: '.mysql_error());
name ASC") or die('Failed to query for plugins: '.$GLOBALS['mysqli']->error);

// Array of known plugins
$known = array();

while($row_def = mysql_fetch_array($result_def))
while($row_def = $result_def->fetch_array())
{
$plg_id = $row_def['id'];
$plg_active = $row_def['active'];
Expand Down
12 changes: 6 additions & 6 deletions admin/serveradd.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

<?php
// List available Network Servers
$result_net = @mysql_query("SELECT DISTINCT
$result_net = $GLOBALS['mysqli']->query("SELECT DISTINCT
n.id,
n.ip,
n.parentid,
Expand All @@ -43,9 +43,9 @@
LEFT JOIN network AS p ON
n.parentid = p.id
ORDER BY
n.ip ASC") or die('Failed to query for network servers: '.mysql_error());
n.ip ASC") or die('Failed to query for network servers: '.$GLOBALS['mysqli']->error);

while($row_net = mysql_fetch_array($result_net))
while($row_net = $result_net->fetch_array())
{
$net_id = $row_net['id'];
$net_ip = $row_net['ip'];
Expand Down Expand Up @@ -80,16 +80,16 @@

<?php
// List user accounts
$result_usr = @mysql_query("SELECT
$result_usr = $GLOBALS['mysqli']->query("SELECT
id,
username,
first_name,
last_name
FROM users
WHERE
deleted = '0'") or die('Failed to query for users: '.mysql_error());
deleted = '0'") or die('Failed to query for users: '.$GLOBALS['mysqli']->error);

while($row_usr = mysql_fetch_array($result_usr))
while($row_usr = $result_usr->fetch_array())
{
$userid = $row_usr['id'];
$usrname = $row_usr['username'];
Expand Down
12 changes: 6 additions & 6 deletions admin/servers.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,18 @@
else $sql_limit = '0,15';

// Get total servers
$result_total = @mysql_query("SELECT
$result_total = $GLOBALS['mysqli']->query("SELECT
COUNT(*) AS cnt
FROM servers AS s
LEFT JOIN default_games AS d ON
s.defid = d.id
$sql_where") or die('Failed to count servers: '.mysql_error().'!');
$sql_where") or die('Failed to count servers: '.$GLOBALS['mysqli']->error.'!');

$row_srv = mysql_fetch_row($result_total);
$row_srv = $result_total->fetch_row();
$total_servers = $row_srv[0];

// List servers
$result_srv = @mysql_query("SELECT
$result_srv = $GLOBALS['mysqli']->query("SELECT
s.id,
s.userid,
s.port,
Expand All @@ -71,12 +71,12 @@
ORDER BY
s.id DESC,
n.ip ASC
LIMIT $sql_limit") or die($lang['err_query'].' ('.mysql_error().')');
LIMIT $sql_limit") or die($lang['err_query'].' ('.$GLOBALS['mysqli']->error.')');

$json_arr = array();
$count_json = 0;

while($row_srv = mysql_fetch_array($result_srv))
while($row_srv = $result_srv->fetch_array())
{
$srv_id = $row_srv['id'];
$srv_userid = $row_srv['userid'];
Expand Down
6 changes: 3 additions & 3 deletions admin/templates.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
</tr>
<?php
// List templates
$result_srv = @mysql_query("SELECT
$result_srv = $GLOBALS['mysqli']->query("SELECT
t.id,
DATE_FORMAT(t.date_created, '%m/%d/%Y') AS date_created,
t.is_default,
Expand All @@ -70,9 +70,9 @@
WHERE
t.cfgid = '$url_id'
ORDER BY
t.id DESC") or die($lang['err_query'].' ('.mysql_error().')');
t.id DESC") or die($lang['err_query'].' ('.$GLOBALS['mysqli']->error.')');

while($row_srv = mysql_fetch_array($result_srv))
while($row_srv = $result_srv->fetch_array())
{
$tpl_id = $row_srv['id'];
$tpl_date = $row_srv['date_created'];
Expand Down
6 changes: 3 additions & 3 deletions admin/userperms.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
$url_id = $GPXIN['id'];

// Get user info
$result_usr = @mysql_query("SELECT
$result_usr = $GLOBALS['mysqli']->query("SELECT
perm_ftp,
perm_files,
perm_startup,
Expand All @@ -14,9 +14,9 @@
FROM users
WHERE
id = '$url_id'
LIMIT 1") or die('Failed to query for users: '.mysql_error());
LIMIT 1") or die('Failed to query for users: '.$GLOBALS['mysqli']->error);

while($row_usr = mysql_fetch_array($result_usr))
while($row_usr = $result_usr->fetch_array())
{
$usr_usrname = $row_usr['username'];
$perm_ftp = $row_usr['perm_ftp'];
Expand Down
6 changes: 3 additions & 3 deletions admin/users.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
</tr>
<?php
// List users
$result_usr = @mysql_query("SELECT
$result_usr = $GLOBALS['mysqli']->query("SELECT
id,
first_name,
last_name,
Expand All @@ -32,9 +32,9 @@
WHERE
deleted = '0'
ORDER BY
id DESC") or die('Failed to query for users: '.mysql_error());
id DESC") or die('Failed to query for users: '.$GLOBALS['mysqli']->error);

while($row_usr = mysql_fetch_array($result_usr))
while($row_usr = $result_usr->fetch_array())
{
$usr_id = $row_usr['id'];
$usr_fullname = $row_usr['first_name'] . ' ' . $row_usr['last_name'];
Expand Down
6 changes: 3 additions & 3 deletions admin/viewadmin.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
$url_id = $GPXIN['id'];

// Get user info
$result_usr = @mysql_query("SELECT
$result_usr = $GLOBALS['mysqli']->query("SELECT
first_name,
last_name,
username,
Expand All @@ -13,9 +13,9 @@
FROM admins
WHERE
id = '$url_id'
LIMIT 1") or die('Failed to query for admins: '.mysql_error());
LIMIT 1") or die('Failed to query for admins: '.$GLOBALS['mysqli']->error);

while($row_usr = mysql_fetch_array($result_usr))
while($row_usr = $result_usr->fetch_array())
{
$usr_fname = $row_usr['first_name'];
$usr_lname = $row_usr['last_name'];
Expand Down
6 changes: 3 additions & 3 deletions admin/viewuser.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
$url_id = $GPXIN['id'];

// Get user info
$result_usr = @mysql_query("SELECT
$result_usr = $GLOBALS['mysqli']->query("SELECT
first_name,
last_name,
username,
Expand All @@ -14,9 +14,9 @@
FROM users
WHERE
id = '$url_id'
LIMIT 1") or die('Failed to query for user details: '.mysql_error());
LIMIT 1") or die('Failed to query for user details: '.$GLOBALS['mysqli']->error);

while($row_usr = mysql_fetch_array($result_usr))
while($row_usr = $result_usr->fetch_array())
{
$usr_fname = $row_usr['first_name'];
$usr_lname = $row_usr['last_name'];
Expand Down
Loading