mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Remove some deprecated functions
This commit is contained in:
@@ -27,7 +27,7 @@ $i = 0;
|
||||
if ($handle = opendir($rrddir)) {
|
||||
while (false !== ($file = readdir($handle))) {
|
||||
if ($file != '.' && $file != '..') {
|
||||
if (eregi('app-shoutcast-'.$app['app_id'], $file)) {
|
||||
if (stripos($file, 'app-shoutcast-'.$app['app_id'])) {
|
||||
array_push($files, $file);
|
||||
}
|
||||
}
|
||||
@@ -35,8 +35,8 @@ if ($handle = opendir($rrddir)) {
|
||||
}
|
||||
|
||||
foreach ($files as $id => $file) {
|
||||
$hostname = eregi_replace('app-shoutcast-'.$app['app_id'].'-', '', $file);
|
||||
$hostname = eregi_replace('.rrd', '', $hostname);
|
||||
$hostname = str_ireplace('app-shoutcast-'.$app['app_id'].'-', '', $file);
|
||||
$hostname = str_ireplace('.rrd', '', $hostname);
|
||||
list($host, $port) = explode('_', $hostname, 2);
|
||||
$rrd_filenames[] = $rrddir.'/'.$file;
|
||||
$rrd_list[$i]['filename'] = $rrddir.'/'.$file;
|
||||
|
||||
@@ -15,7 +15,7 @@ $x = 0;
|
||||
if ($handle = opendir($rrddir)) {
|
||||
while (false !== ($file = readdir($handle))) {
|
||||
if ($file != '.' && $file != '..') {
|
||||
if (eregi('app-shoutcast-'.$app['app_id'], $file)) {
|
||||
if (stripos($file, 'app-shoutcast-'.$app['app_id'])) {
|
||||
array_push($files, $file);
|
||||
}
|
||||
}
|
||||
@@ -23,8 +23,8 @@ if ($handle = opendir($rrddir)) {
|
||||
}
|
||||
|
||||
foreach ($files as $id => $file) {
|
||||
$hostname = eregi_replace('app-shoutcast-'.$app['app_id'].'-', '', $file);
|
||||
$hostname = eregi_replace('.rrd', '', $hostname);
|
||||
$hostname = str_ireplace('app-shoutcast-'.$app['app_id'].'-', '', $file);
|
||||
$hostname = str_ireplace('.rrd', '', $hostname);
|
||||
list($host, $port) = explode('_', $hostname, 2);
|
||||
$rrd_filenames[] = $rrddir.'/'.$file;
|
||||
$rrd_list[$i]['filename'] = $rrddir.'/'.$file;
|
||||
|
||||
@@ -10,7 +10,7 @@ $files = array();
|
||||
if ($handle = opendir($rrddir)) {
|
||||
while (false !== ($file = readdir($handle))) {
|
||||
if ($file != '.' && $file != '..') {
|
||||
if (eregi('app-shoutcast-'.$app['app_id'], $file)) {
|
||||
if (stripos($file, 'app-shoutcast-'.$app['app_id']) !== false) {
|
||||
array_push($files, $file);
|
||||
}
|
||||
}
|
||||
@@ -45,8 +45,8 @@ if (isset($total) && $total === true) {
|
||||
}
|
||||
|
||||
foreach ($files as $id => $file) {
|
||||
$hostname = eregi_replace('app-shoutcast-'.$app['app_id'].'-', '', $file);
|
||||
$hostname = eregi_replace('.rrd', '', $hostname);
|
||||
$hostname = str_ireplace('app-shoutcast-'.$app['app_id'].'-', '', $file);
|
||||
$hostname = str_ireplace('.rrd', '', $hostname);
|
||||
list($host, $port) = explode('_', $hostname, 2);
|
||||
$graphs = array(
|
||||
'shoutcast_bits' => 'Traffic Statistics - '.$host.' (Port: '.$port.')',
|
||||
|
||||
@@ -157,7 +157,7 @@ echo ' </div>
|
||||
//From default.php - This code is not part of above license.
|
||||
if ($config['enable_syslog']) {
|
||||
$sql = "SELECT *, DATE_FORMAT(timestamp, '".$config['dateformat']['mysql']['compact']."') AS date from syslog ORDER BY seq DESC LIMIT 20";
|
||||
$query = mysql_query($sql);
|
||||
|
||||
echo('<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
@@ -196,8 +196,6 @@ echo('<div class="container-fluid">
|
||||
P.device_id AND P.user_id = " . $_SESSION['user_id'] . " ORDER BY `datetime` DESC LIMIT 0,15";
|
||||
}
|
||||
|
||||
$data = mysql_query($query);
|
||||
|
||||
echo('<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
|
||||
@@ -699,8 +699,8 @@ function get_smokeping_files($device) {
|
||||
if ($handle = opendir($smokeping_dir)) {
|
||||
while (false !== ($file = readdir($handle))) {
|
||||
if ($file != '.' && $file != '..') {
|
||||
if (eregi('.rrd', $file)) {
|
||||
if (eregi('~', $file)) {
|
||||
if (stripos($file, '.rrd') !== false) {
|
||||
if (strpos($file, '~') !== false) {
|
||||
list($target,$slave) = explode('~', str_replace('.rrd', '', $file));
|
||||
$target = str_replace('_', '.', $target);
|
||||
$smokeping_files['in'][$target][$slave] = $file;
|
||||
|
||||
2
irc.php
2
irc.php
@@ -416,7 +416,7 @@ class ircbot {
|
||||
|
||||
private function chkdb() {
|
||||
if (!is_resource($this->sql)) {
|
||||
if (($this->sql = mysql_connect($this->config['db_host'], $this->config['db_user'], $this->config['db_pass'])) != false && mysql_select_db($this->config['db_name'])) {
|
||||
if (($this->sql = mysqli_connect($this->config['db_host'], $this->config['db_user'], $this->config['db_pass'])) != false && mysqli_select_db($this->sql, $this->config['db_name'])) {
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -25,7 +25,7 @@ $cmd2 = shell_exec($ntpdc.' -c iostats');
|
||||
$vars = array();
|
||||
$vars2 = array();
|
||||
$vars = explode(',', $cmd);
|
||||
$vars2 = eregi_replace(' ', '', $cmd2);
|
||||
$vars2 = str_replace(' ', '', $cmd2);
|
||||
$vars2 = explode("\n", $vars2);
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user