Skip to content

Commit

Permalink
# DONE: check if config vars are set
Browse files Browse the repository at this point in the history
Signed-off-by: LukasWestholt <[email protected]>
# DONE: (default) lang to en
# DONE: empty config vars: error not created cache
# DONE: empty config file creates weathericons/.png
# DONE: without ts server connection the text is "0/"
# DONE: better check for file
# DONE: better creation of file
# DONE: alert
# DONE: ipdata timeout? date?
# DONE: fix error: 'Frankfurt am Main' if start without api keys (problem in ipdata)
# DONE: fix error: weather icon is missing when script starts without file permission to /weathericons
# DONE: "server" file empty creation, if ts3 not setup
# DONE: german "du bist hier auf dem Server zum . mal"
# DONE: what happens if the api keys are wrong?
# DONE: $config['banner']['background'] exists check
# DONE: fallback city
# DONE: show city without weather
  • Loading branch information
LukasWestholt committed May 10, 2020
1 parent 0694fc0 commit e458f93
Show file tree
Hide file tree
Showing 6 changed files with 405 additions and 186 deletions.
4 changes: 4 additions & 0 deletions .idea/php.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 17 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,21 @@

<hr>

#### Installation
Put the whole BannerTS3\ directory into your webspace.

Rename the <code>config.php.dist</code> file to <code>config.php</code> and put your values in it.
You will need an API token by https://ipinfo.io/account and an API token by https://openweathermap.org/api.
And for the data request from your ts3 server you will need your login credential for the query login.
You need "Host IP", "Port Server", "Port Query", "Login Query", "Password Query".

Make sure that the "cache/" folder has the permission the read/write and create new folders (0777).

That is all.



#### Function
- Caching
- Username
- Admins online
- Channel online
Expand All @@ -18,7 +31,9 @@
- Ping server
- Time
- Date
- Weather system
- Weather system (get the location of the user by IP-API)
- Caching of ipadress/location relationship for less api usage
- Caching of ts3server data for less data requests to the server

#### Changelog in v 1.4
- I have rewritten the whole code. Big update. New features. Better Apis.
Expand Down
13 changes: 13 additions & 0 deletions class/ts3admin.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -4197,6 +4197,19 @@ function setName($newName) {
return $this->getData('boolean', 'clientupdate client_nickname='.$this->escapeText($newName));
}

/**
* setName
*
* Sets your nickname in server query
*
* @author Lukas Westholt
* @return boolean success
*/
function getName() {
$this->loadQueryData();
return $this->runtime['bot_name'];
}

/**
* tokenAdd
*
Expand Down
29 changes: 18 additions & 11 deletions config.php.dist
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,35 @@
# #
# Created by xman8830 #
# #
########################################
########################################

########################################
# #
# Version by Lukas Westholt #
# #
########################################
date_default_timezone_set('Europe/Berlin');//Time zone
########################################
$config = [];
$config['cache_name'] = 'server'; //Name cache
$config['ipinfo_token'] = ''; //https://ipinfo.io/account
// put your values here in
date_default_timezone_set('Europe/Berlin'); //time zone
$config['apikey_ipinfo'] = ''; //https://ipinfo.io/account
$config['apikey_openweathermap'] = ''; //https://openweathermap.org/api
$config['ts3']['host'] = ''; //Host IP
$config['ts3']['host'] = ''; //Host IP or 'localhost'
$config['ts3']['login_port'] = ''; //Port Server
$config['ts3']['query_port'] = ''; //Port Query
$config['ts3']['login'] = ''; //Login Query
$config['ts3']['password'] = ''; //Password Query
$config['ts3']['timeout'] = 2; //Timeout in seconds for TS3 connection, maybe you need to increase the timeout
$config['ts3']['cachetime'] = 30; //Time in seconds after which the ts3 cache should be reloaded.
$config['ts3']['nickname'] = 'loading-server-banner-service'; //Nickname of the ts3 query
$config['ts3']['admingroups'] = array(6); //id admins groups example: id:6

$config['settings'] = 'auto'; // "auto" - refresh website or "bot" - screen bot refresh
$config['lang'] = 'en'; //Language pl/en/de

$config['banner']['format'] = 'png'; //format png/jpg
$config['banner']['background'] = 'img/banner.png'; //path to background png/jpg
$config['img']['found_nick'] = 'unknown'; //Nick if not found nick

$config['banner']['format'] = 'png'; //Format png/jpg
$config['banner']['background'] = 'img/banner.png'; //link to background png/jpg
$admingroups = array(6); //id admins groups
$config['img']['found_nick'] = 'unknown';// Nick if not found nick
$config['lang'] = 'en';//Language pl/en/de
$config['cache_name'] = 'server'; //Name of cache file
$config['ip_cachetime'] = 604800; //Time in seconds: Renew ip-location-relationship Default: 1 Week
$config['fallback_city'] = 'Berlin'; //Your displayed city when no one can be calculated
Loading

0 comments on commit e458f93

Please sign in to comment.