forked from xman8830/BannerTS3
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
this is my vesion of BannerTS3 by xman8830 https://github.com/xman8830/BannerTS3
- Loading branch information
1 parent
517d154
commit b990ebd
Showing
33 changed files
with
333 additions
and
532 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# Auto detect text files and perform LF normalization | ||
* text=auto |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Not Found | ||
The requested URL <?php echo $_SERVER["REQUEST_URI"];?> was not found on this server. | ||
|
||
<?php echo $_SERVER["SERVER_SOFTWARE"];?> Server at <?php echo $_SERVER["HTTP_HOST"]; ?> Port 80 |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,4 @@ | ||
Not Found | ||
The requested URL <?php echo $_SERVER["REQUEST_URI"];?> was not found on this server. | ||
|
||
<?php echo $_SERVER["SERVER_SOFTWARE"];?> Server at <?php echo $_SERVER["HTTP_HOST"]; ?> Port 80 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
<?php | ||
require_once __DIR__ . "/config.php"; | ||
$ip = getenv('HTTP_CLIENT_IP') ?: getenv('HTTP_X_FORWARDED_FOR') ?: getenv('HTTP_X_FORWARDED') ?: getenv('HTTP_FORWARDED_FOR') ?: getenv('HTTP_FORWARDED') ?: getenv('REMOTE_ADDR'); | ||
$adminonline = 0; | ||
$nick = $config['img']['found_nick']; | ||
if ($config['settings'] == 'auto') { | ||
require_once __DIR__ . "/class/ts3admin.class.php"; | ||
$files = array_diff(scandir('cache'), array('..', '.', 'fulls', 'thumbs')); | ||
if (!empty($config['cache_name']) or $config['cache_name'] != '') { | ||
if (!in_array($config['cache_name'] ,$files)) { | ||
if(touch('./cache/'.$config['cache_name'])) { | ||
if(chmod('./cache/'.$config['cache_name'], 0777)) { | ||
$cache = 'success'; | ||
} else { | ||
alert ('The folder and the cache file were created, no access rights were granted'); | ||
exit; | ||
} | ||
} else { | ||
alert ('Not created <b>cache</b>'); | ||
exit; | ||
} | ||
} else { | ||
$srv = ''; | ||
if (!file_exists('cache/'.$config['cache_name']) || filemtime('cache/'.$config['cache_name']) + 1 * 30 < time()) {; | ||
$query = new ts3admin($config['ts3']['host'], $config['ts3']['query_port'], 2); | ||
$query->connect(); | ||
$query->login($config['ts3']['login'],$config['ts3']['password']); | ||
$query->selectServer($config['ts3']['login_port']); | ||
$srv = []; | ||
$srv['server'] = $query->getElement('data', $query->serverInfo()); | ||
$srv['groups'] = $query->getElement('data', $query->serverGroupList()); | ||
$srv['clients'] = $query->getElement('data', $query->clientList('-uid -away -voice -times -groups -info -icon -country -ip')); | ||
$srv['channel'] = $query->getElement('data', $query->channelList()); | ||
$srv['banlist'] = $query->getElement('data', $query->banList()); | ||
|
||
@file_put_contents('cache/'.$config['cache_name'], json_encode($srv)); | ||
} else { | ||
$srv = file_get_contents('cache/'.$config['cache_name']); | ||
$srv = json_decode($srv, true); | ||
} | ||
|
||
} | ||
} else { | ||
alert ('cache name not found in config.php'); | ||
exit; | ||
} | ||
} elseif ($config['settings'] == 'bot') { | ||
$ts3 = file_get_contents('cache/'.$config['cache_name']); | ||
$srv = json_decode($ts3, true); | ||
} | ||
if ($weather['status']) { | ||
//$json = file_get_contents('https://api.xman8830.ovh/weather?key='.$config['apikey'].'&ip=' . $ip); | ||
//$data = json_decode($json, true); | ||
//$weathericonfile = 'weathericon/' . $data['icon'] . '.png'; | ||
} | ||
foreach ($srv['clients'] as $client) { | ||
$groups = explode(',', $client['client_servergroups']); | ||
echo $groups; | ||
if ($client["connection_client_ip"] == $ip) { | ||
$nick = $client['client_nickname']; | ||
} | ||
foreach ($admingroups as $group) { | ||
if (in_array($group, $groups)) { | ||
$adminonline++; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,4 @@ | ||
Not Found | ||
The requested URL <?php echo $_SERVER["REQUEST_URI"];?> was not found on this server. | ||
|
||
<?php echo $_SERVER["SERVER_SOFTWARE"];?> Server at <?php echo $_SERVER["HTTP_HOST"]; ?> Port 80 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,4 @@ | ||
Not Found | ||
The requested URL <?php echo $_SERVER["REQUEST_URI"];?> was not found on this server. | ||
|
||
<?php echo $_SERVER["SERVER_SOFTWARE"];?> Server at <?php echo $_SERVER["HTTP_HOST"]; ?> Port 80 |
Oops, something went wrong.