Jump to content

[BF4] Stats webpage for XpKiller's Stats Logger Plugin


tyger07

Recommended Posts

Originally Posted by SharpSabre*:

 

My server changed IP, now my stats list two servers, is it possible to merge the stats from the old server to the new server?

 

Sorry if this has been asked before, I have searched the thread and am unable to find an answer.

 

cheers

neg

yea , just delete server on row 2 on -> DBName > "tpl_server" and change ip of row 1 at that table .
* Restored post. It could be that the author is no longer active.
Link to comment
  • Replies 1.7k
  • Created
  • Last Reply

Originally Posted by ty_ger07*:

 

My server changed IP, now my stats list two servers, is it possible to merge the stats from the old server to the new server?

 

Sorry if this has been asked before, I have searched the thread and am unable to find an answer.

 

cheers

neg

You searched the wrong thread. :ohmy:

 

My webpage stats code isn't responsible for controlling the data. XpKiller's plugin is responsible for that.

 

Here is an answer in XpKiller's thread:

myrcon.net/...chat-guid-stats-and-mapstats-logger#entry45736

* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by ty_ger07*:

 

How can i add Image resize for banner ? as

In image-banner.php, there is some code which loads in the map image and resizes it. You could use that information as inspiration.

Code:

$map_img = imagecreatefrompng('../images/maps/' . $map . '.png'); 
$resize_map = imagecreatetruecolor(100, 56);
imagecopyresampled($resize_map, $map_img, 0, 0, 0, 0, 100, 56, 200, 113);
$map_img is the image resource being loaded in. $resize_map is created as an empty placeholder of the correct size for storing into. imagecopyresampled resizes $map_img and copies it into $resize_map.

 

You would have to do something similar to the whole image output towards the end of image-banner.php.

* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by uncut1980berlin*:

 

Hello,

i've got some problems and i don't know how to fix it.

 

http://www.fad-multigaming.de/bf4ser...p_p=home&sid=1

 

Error Code at Chat:

Warning: strtotime() [function.strtotime]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/Berlin' for 'CET/1.0/no DST' instead in /var/www/web184/html/bf4serverstats/common/chat/chat-live.php on line 403

 

Warning: date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/Berlin' for 'CET/1.0/no DST' instead in /var/www/web184/html/bf4serverstats/common/chat/chat-live.php on line 403

 

Error Code at server info -> average player graphic

 

Maybe someone can help me - thanks a lot

* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by SharpSabre*:

 

In image-banner.php, there is some code which loads in the map image and resizes it. You could use that information as inspiration.

Code:

$map_img = imagecreatefrompng('../images/maps/' . $map . '.png'); 
$resize_map = imagecreatetruecolor(100, 56);
imagecopyresampled($resize_map, $map_img, 0, 0, 0, 0, 100, 56, 200, 113);
$map_img is the image resource being loaded in. $resize_map is created as an empty placeholder of the correct size for storing into. imagecopyresampled resizes $map_img and copies it into $resize_map.

 

You would have to do something similar to the whole image output towards the end of image-banner.php.

I need to resize Banner , no it's object :biggrin: as ...&width=200&height=50

 

in all functions , i need to image url , but it's a ghost :biggrin:

 

what is wrong ?

list($width_orig, $height_orig) = getimagesize($base);

$resize_banner = imagecreatetruecolor($widthSize, $heightSize);

imagecopyresampled($resize_banner, $base, 0, 0, 0, 0, $widthSize, $heightSize, $width_orig, $height_orig);

* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by ty_ger07*:

 

I need to resize Banner , no it's object :biggrin: as ...&width=200&height=50

 

in all functions , i need to image url , but it's a ghost :biggrin:

 

what is wrong ?

It would probably be easiest to save the image output and then load it back in. For instance, the graph is saved to a folder and then loaded back in.

Here is how the graph image is saved in image-banner.php:

Code:

$myPicture->render("./graph_cache/banner_sid{$sid}.png");
So taking the same approach, towards the end of image-banner.php, change this:

Code:

imagepng($base);
imagedestroy($base);
to this:

Code:

$save = './graph_cache/banner_sid' . $sid . '.png';
imagepng($base, $save);
Then, load that image back in to resize it.
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by ty_ger07*:

 

Hello,

i've got some problems and i don't know how to fix it.

 

http://www.fad-multigaming.de/bf4ser...p_p=home&sid=1

 

Error Code at Chat:

Warning: strtotime() [function.strtotime]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/Berlin' for 'CET/1.0/no DST' instead in /var/www/web184/html/bf4serverstats/common/chat/chat-live.php on line 403

 

Warning: date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/Berlin' for 'CET/1.0/no DST' instead in /var/www/web184/html/bf4serverstats/common/chat/chat-live.php on line 403

 

Error Code at server info -> average player graphic

 

Maybe someone can help me - thanks a lot

You are missing the date.timezone in your server's php.ini file.

 

It should be in your php.ini file similar to this:

date.timezone = America/New_York

 

If you don't have access to php.ini, ask your server host to do it for you.

* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by SharpSabre*:

 

It would probably be easiest to save the image output and then load it back in. For instance, the graph is saved to a folder and then loaded back in.

Here is how the graph image is saved in image-banner.php:

Code:

$myPicture->render("./graph_cache/banner_sid{$sid}.png");
So taking the same approach, towards the end of image-banner.php, change this:

Code:

imagepng($base);
imagedestroy($base);
to this:

Code:

$save = './graph_cache/banner_sid' . $sid . '.png';
imagepng($base, $save);
Then, load that image back in to resize it.
Thanks.

I can't open "/graph_cache/banner_sid1.png" No access , why ? how to get !

* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by ty_ger07*:

 

Thanks.

I can't open "/graph_cache/banner_sid1.png" No access , why ? how to get !

There are multiple spots in the file where "imagepng($base); imagedestroy($base);" were located due to different image outputs for different error messages in the event that there was an error to display. You probably were just editing the wrong one.

 

No problem though, because I have implemented the change for you and it is available in the update which I just released.

 

Here is before resize:

http://open-web-community.com/bf4stats/player-stats/common/server-banner/image-banner.png_sid=2

Code:

http://open-web-community.com/bf4stats/player-stats/common/server-banner/image-banner.png_sid=2
Here is after resize:

http://open-web-community.com/bf4stats/player-stats/common/server-banner/image-banner.png_sid=2&w=472&h=80

Code:

http://open-web-community.com/bf4stats/player-stats/common/server-banner/image-banner.png_sid=2&w=472&h=80
NOTE: You should try to maintain the original aspect ratio between width and height in order to show the best image quality. If you resize the image in a different aspect ratio which causes it to stretch in one direction or the other, the image quality will be affected to a much worse degree.

 

The default size is 560 x 95 pixels which is a width to height aspect ratio of approximately 5.89 : 1.

 

Here is an example of poor image quality caused by not maintaining a similar aspect ratio:

http://open-web-community.com/bf4stats/player-stats/common/server-banner/image-banner.png_sid=2&h=200

Code:

http://open-web-community.com/bf4stats/player-stats/common/server-banner/image-banner.png_sid=2&h=200
If you want to view the code, it is here:

https://github.com/tyger07/BF4-Serve...age-banner.php

* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by ty_ger07*:

 

Update Released!

 

http://tyger07.github.io/BF4-Server-Stats/

 

Change:

- Added optional query string parameters to resize server banner image output as requested

 

 

Additional information:

See one post previous

 

Please note:

The banner image cache directory changed name from ./common/server-banner/graph?cache/ and became ./common/server-banner/cache/.

Please make sure that you either pull the updated code off of github in its entirety or manually make that new directory if you choose to manually update the files on your server.

* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by SharpSabre*:

 

Awesome.. Very Thanks

imagedestroy($base); it's very important , i had a overflow of RAM's capacity (system hang) :P

 

I found a php file that to do small it, just,, but yours is very better and nice.

 

And look this for ratio :

Code:

widthMax = 560;
heightMax = 95;
function Resize(image)
{
    if (image.width >= image.height)
    {
      // for don't get larger
      //  if (image.width <= widthMax && image.height <= heightMax)
      //   return image;  // no resizing required
        wRatio = widthMax / image.width;
        hRatio = heightMax/ image.height;
    }
    else
    {
    // for don't get larger
    //    if (image.height <= widthMax && image.width <= heightMax)
    //       return image; // no resizing required
        wRatio = heightMax/ image.width;
        hRatio = widthMax / image.height;
    }

    // hRatio and wRatio now have the scaling factors for height and width.
    // You want the smallest of the two to ensure that the resulting image
    // fits in the desired frame and maintains the aspect ratio.
    resizeRatio = Min(wRatio, hRatio);

    newHeight = image.Height * resizeRatio;
    newWidth = image.Width * resizeRatio;

    // Now call function to resize original image to [newWidth, newHeight]
    // and return the result.
}
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by ty_ger07*:

 

imagedestroy($base); it's very important , i had a overflow of RAM's capacity (system hang) :P

Noted

 

EDIT: Fix uploaded to GitHub

https://github.com/tyger07/BF4-Serve...f51ee9b334b81b

 

And look this for ratio :

...

I could have my code maintain aspect ratio on its own, but I didn't want to box in people's options; just in case they want a funky sized image for some reason.
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by 397Seth*:

 

Hi,

 

I get the following error when visiting maps section:

Code:

Notice: Undefined index: Gamemode in C:\xampp2\htdocs\Projekte\bf4-aktuell\common\maps\maps.php on line 222

Notice: Undefined index: Gamemode in C:\xampp2\htdocs\Projekte\bf4-aktuell\common\maps\maps.php on line 222

Notice: Undefined index: Gamemode in C:\xampp2\htdocs\Projekte\bf4-aktuell\common\maps\maps.php on line 222

Notice: Undefined index: Gamemode in C:\xampp2\htdocs\Projekte\bf4-aktuell\common\maps\maps.php on line 222

Notice: Undefined index: Gamemode in C:\xampp2\htdocs\Projekte\bf4-aktuell\common\maps\maps.php on line 222

Notice: Undefined index: Gamemode in C:\xampp2\htdocs\Projekte\bf4-aktuell\common\maps\maps.php on line 222

Notice: Undefined index: Gamemode in C:\xampp2\htdocs\Projekte\bf4-aktuell\common\maps\maps.php on line 222

Notice: Undefined index: Gamemode in C:\xampp2\htdocs\Projekte\bf4-aktuell\common\maps\maps.php on line 222

Notice: Undefined index: Gamemode in C:\xampp2\htdocs\Projekte\bf4-aktuell\common\maps\maps.php on line 222

Notice: Undefined index: Gamemode in C:\xampp2\htdocs\Projekte\bf4-aktuell\common\maps\maps.php on line 222

Notice: Undefined index: Gamemode in C:\xampp2\htdocs\Projekte\bf4-aktuell\common\maps\maps.php on line 222

Notice: Undefined index: Gamemode in C:\xampp2\htdocs\Projekte\bf4-aktuell\common\maps\maps.php on line 222

Notice: Undefined index: Gamemode in C:\xampp2\htdocs\Projekte\bf4-aktuell\common\maps\maps.php on line 222

Notice: Undefined index: Gamemode in C:\xampp2\htdocs\Projekte\bf4-aktuell\common\maps\maps.php on line 222

Notice: Undefined index: Gamemode in C:\xampp2\htdocs\Projekte\bf4-aktuell\common\maps\maps.php on line 222

Notice: Undefined index: Gamemode in C:\xampp2\htdocs\Projekte\bf4-aktuell\common\maps\maps.php on line 222
AND

 

Code:

Notice: Undefined index: Gamemode in C:\xampp2\htdocs\Projekte\bf4-aktuell\common\maps\maps-tab.php on line 82

Notice: Undefined index: Gamemode in C:\xampp2\htdocs\Projekte\bf4-aktuell\common\maps\maps-tab.php on line 82

Notice: Undefined index: Gamemode in C:\xampp2\htdocs\Projekte\bf4-aktuell\common\maps\maps-tab.php on line 82

Notice: Undefined index: Gamemode in C:\xampp2\htdocs\Projekte\bf4-aktuell\common\maps\maps-tab.php on line 82

Notice: Undefined index: Gamemode in C:\xampp2\htdocs\Projekte\bf4-aktuell\common\maps\maps-tab.php on line 82

Notice: Undefined index: Gamemode in C:\xampp2\htdocs\Projekte\bf4-aktuell\common\maps\maps-tab.php on line 82

Notice: Undefined index: Gamemode in C:\xampp2\htdocs\Projekte\bf4-aktuell\common\maps\maps-tab.php on line 82

Notice: Undefined index: Gamemode in C:\xampp2\htdocs\Projekte\bf4-aktuell\common\maps\maps-tab.php on line 82

Notice: Undefined index: Gamemode in C:\xampp2\htdocs\Projekte\bf4-aktuell\common\maps\maps-tab.php on line 82

Notice: Undefined index: Gamemode in C:\xampp2\htdocs\Projekte\bf4-aktuell\common\maps\maps-tab.php on line 82

Notice: Undefined index: Gamemode in C:\xampp2\htdocs\Projekte\bf4-aktuell\common\maps\maps-tab.php on line 82

Notice: Undefined index: Gamemode in C:\xampp2\htdocs\Projekte\bf4-aktuell\common\maps\maps-tab.php on line 82

Notice: Undefined index: Gamemode in C:\xampp2\htdocs\Projekte\bf4-aktuell\common\maps\maps-tab.php on line 82

Notice: Undefined index: Gamemode in C:\xampp2\htdocs\Projekte\bf4-aktuell\common\maps\maps-tab.php on line 82

Notice: Undefined index: Gamemode in C:\xampp2\htdocs\Projekte\bf4-aktuell\common\maps\maps-tab.php on line 82

Notice: Undefined index: Gamemode in C:\xampp2\htdocs\Projekte\bf4-aktuell\common\maps\maps-tab.php on line 82
Does anybody has a clue why? It worked fined in previous versions.
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by ty_ger07*:

 

Hi,

 

I get the following error when visiting maps section:

Code:

Notice: Undefined index: Gamemode in C:\xampp2\htdocs\Projekte\bf4-aktuell\common\maps\maps.php on line 222

Notice: Undefined index: Gamemode in C:\xampp2\htdocs\Projekte\bf4-aktuell\common\maps\maps.php on line 222

Notice: Undefined index: Gamemode in C:\xampp2\htdocs\Projekte\bf4-aktuell\common\maps\maps.php on line 222

Notice: Undefined index: Gamemode in C:\xampp2\htdocs\Projekte\bf4-aktuell\common\maps\maps.php on line 222

Notice: Undefined index: Gamemode in C:\xampp2\htdocs\Projekte\bf4-aktuell\common\maps\maps.php on line 222

Notice: Undefined index: Gamemode in C:\xampp2\htdocs\Projekte\bf4-aktuell\common\maps\maps.php on line 222

Notice: Undefined index: Gamemode in C:\xampp2\htdocs\Projekte\bf4-aktuell\common\maps\maps.php on line 222

Notice: Undefined index: Gamemode in C:\xampp2\htdocs\Projekte\bf4-aktuell\common\maps\maps.php on line 222

Notice: Undefined index: Gamemode in C:\xampp2\htdocs\Projekte\bf4-aktuell\common\maps\maps.php on line 222

Notice: Undefined index: Gamemode in C:\xampp2\htdocs\Projekte\bf4-aktuell\common\maps\maps.php on line 222

Notice: Undefined index: Gamemode in C:\xampp2\htdocs\Projekte\bf4-aktuell\common\maps\maps.php on line 222

Notice: Undefined index: Gamemode in C:\xampp2\htdocs\Projekte\bf4-aktuell\common\maps\maps.php on line 222

Notice: Undefined index: Gamemode in C:\xampp2\htdocs\Projekte\bf4-aktuell\common\maps\maps.php on line 222

Notice: Undefined index: Gamemode in C:\xampp2\htdocs\Projekte\bf4-aktuell\common\maps\maps.php on line 222

Notice: Undefined index: Gamemode in C:\xampp2\htdocs\Projekte\bf4-aktuell\common\maps\maps.php on line 222

Notice: Undefined index: Gamemode in C:\xampp2\htdocs\Projekte\bf4-aktuell\common\maps\maps.php on line 222
AND

 

Code:

Notice: Undefined index: Gamemode in C:\xampp2\htdocs\Projekte\bf4-aktuell\common\maps\maps-tab.php on line 82

Notice: Undefined index: Gamemode in C:\xampp2\htdocs\Projekte\bf4-aktuell\common\maps\maps-tab.php on line 82

Notice: Undefined index: Gamemode in C:\xampp2\htdocs\Projekte\bf4-aktuell\common\maps\maps-tab.php on line 82

Notice: Undefined index: Gamemode in C:\xampp2\htdocs\Projekte\bf4-aktuell\common\maps\maps-tab.php on line 82

Notice: Undefined index: Gamemode in C:\xampp2\htdocs\Projekte\bf4-aktuell\common\maps\maps-tab.php on line 82

Notice: Undefined index: Gamemode in C:\xampp2\htdocs\Projekte\bf4-aktuell\common\maps\maps-tab.php on line 82

Notice: Undefined index: Gamemode in C:\xampp2\htdocs\Projekte\bf4-aktuell\common\maps\maps-tab.php on line 82

Notice: Undefined index: Gamemode in C:\xampp2\htdocs\Projekte\bf4-aktuell\common\maps\maps-tab.php on line 82

Notice: Undefined index: Gamemode in C:\xampp2\htdocs\Projekte\bf4-aktuell\common\maps\maps-tab.php on line 82

Notice: Undefined index: Gamemode in C:\xampp2\htdocs\Projekte\bf4-aktuell\common\maps\maps-tab.php on line 82

Notice: Undefined index: Gamemode in C:\xampp2\htdocs\Projekte\bf4-aktuell\common\maps\maps-tab.php on line 82

Notice: Undefined index: Gamemode in C:\xampp2\htdocs\Projekte\bf4-aktuell\common\maps\maps-tab.php on line 82

Notice: Undefined index: Gamemode in C:\xampp2\htdocs\Projekte\bf4-aktuell\common\maps\maps-tab.php on line 82

Notice: Undefined index: Gamemode in C:\xampp2\htdocs\Projekte\bf4-aktuell\common\maps\maps-tab.php on line 82

Notice: Undefined index: Gamemode in C:\xampp2\htdocs\Projekte\bf4-aktuell\common\maps\maps-tab.php on line 82

Notice: Undefined index: Gamemode in C:\xampp2\htdocs\Projekte\bf4-aktuell\common\maps\maps-tab.php on line 82
Does anybody has a clue why? It worked fined in previous versions.
Ahah!

 

Yup, Gamemode is not defined in the query any more because it is not needed.

 

I will need to remove those useless lines.

Code:

$Mode = $Map_r['Gamemode'];
		// convert mode to friendly name
		if(in_array($Mode,$mode_array))
		{
			$GameMode = array_search($Mode,$mode_array);
		}
		// this mode is missing!
		else
		{
			$GameMode = $Mode;
		}
Feel free to remove those lines in your code if you wish until I get a chance to push an update to GitHub.
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by DarkZerO_AT*:

 

having a problem

as you can see in my signature, your statspage is adding a wrong flag to the server

there should be a flag from germany

i dont know why this is happening but i would be happy if you can tell me how to fix that :smile:

* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by ty_ger07*:

 

having a problem

as you can see in my signature, your statspage is adding a wrong flag to the server

there should be a flag from germany

i dont know why this is happening but i would be happy if you can tell me how to fix that :smile:

The error is caused by ip-api.com providing the wrong country information.

 

You can manually override ip-api.com.

&cc= : (optional) two letter country code designator of server location flag (default: null)

http://serverstats.rsb-clan.de/banner/banner.png_sid=1&cc=DE

Code:

http://serverstats.rsb-clan.de/banner/banner.png_sid=1&cc=DE
By the way, if you update your code to the current version, you will be able to resize the server banner image in your signature so that the bottom doesn't get cut off by this forum.
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by DarkZerO_AT*:

 

The error is caused by ip-api.com providing the wrong country information.

 

You can manually override ip-api.com.

 

 

http://serverstats.rsb-clan.de/banner/banner.png_sid=1&cc=DE

Code:

http://serverstats.rsb-clan.de/banner/banner.png_sid=1&cc=DE
By the way, if you update your code to the current version, you will be able to resize the server banner image in your signature so that the bottom doesn't get cut off by this forum.
oh yeah i should read better, ive seen that override code actually, sorry :P

 

right i should do that, how to update, just overwrite all the files?

 

 

EDIT: and another thing which just came to my mind, can i change the URL which is linked to the server URL from battlelog?

* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by ty_ger07*:

 

right i should do that, how to update, just overwrite all the files?

Correct. Preferably, delete all the old files and paste the new files in as you did when you first used my code. Overwriting isn't as good because it leaves old/useless/renamed files and folders.

 

and another thing which just came to my mind, can i change the URL which is linked to the server URL from battlelog?

Can you please explain better? Which URL do you want to change where? There are multiple URLs to Battlelog in multiple places. There are also other URLs which don't link to Battlelog which maybe you want to start linking to Battlelog?
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by DarkZerO_AT*:

 

Can you please explain better? Which URL do you want to change where? There are multiple URLs to Battlelog in multiple places. There are also other URLs which don't link to Battlelog which maybe you want to start linking to Battlelog?

i just want to link the banner which is in my signature to battlelog

i know i can change it manually but could that be done by default too?

in my signature i changed it to our homepage instead of the serverstats page

* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by ty_ger07*:

 

http://ip-api.com/#5.101.165.121 - this one is not our fault :smile:

I don't know who "you" are.

 

http://ip-api.com/json/5.101.165.121

 

Hmm... Interesting. Then where is the fault? Maybe file_get_contents is disabled on the user's web server and that is causing it to revert to the less accurate method?

 

Code:

// try API
$json = @file_get_contents('http://ip-api.com/json/' . $server_ip);
$data = @json_decode($json,true);
$location = $data['countryCode'];
// if above API failed ...
// use less accurate method by querying database for players with similar IP address as Server's IP address
if($location == '')
{
	// loop through the query removing last character one at a time until a match is found
	// set server location to most similar player's location
	while(@mysqli_num_rows($Location_q) == 0 && strlen($server_ip) > 1)
	{
		// query for server info
		$Location_q = @mysqli_query($BF4stats,"
			SELECT `CountryCode`
			FROM `tbl_playerdata`
			WHERE `IP_Address` LIKE '{$server_ip}%'
			LIMIT 1
		");
		// drop the last character from the server ip for another loop
		$server_ip = substr($server_ip, 0, -1);
		// continuing to do broader and broader search with each pass...
	}
	// set the variable based on results of above query loop
	$Location_r = @mysqli_fetch_assoc($Location_q);
	$location = strtoupper($Location_r['CountryCode']);
	// add those characters back to $server_ip
	$server_ip = $s_explode[0];
}
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by vladc*:

 

I don't know who "you" are.

Hi, I operate ip-api.com

 

http://ip-api.com/json/5.101.165.121

 

Hmm... Interesting. Then where is the fault? Maybe file_get_contents is disabled on the user's web server and that is causing it to revert to the less accurate method?

That is likely. You should add more error handling to your script.
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by ty_ger07*:

 

Hi, I operate ip-api.com

Wow, very cool.

That is likely. You should add more error handling to your script.

Yes, probably. But I am torn because the output of that file is an image and I don't know how to output error messages without either breaking the image or showing the ugly error message in every image for the whole world to see.

 

Maybe I could show a little colored box somewhere which indicates that the location method fell back on the inaccurate method without going out and saying it in an ugly way.

* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by Prophet731*:

 

@ty_get07

 

You should try out guzzle in your application. Shouldn't be hard to integrate and it provides exceptions on HTTP request errors. You can throw a try..catch block around the image generation and if an HTTP exception occurs you can handle it with maybe a blank flag indicating to the user that it couldn't load the country information so an override would be required to show the flag, your $_GET['cc']. I use guzzle in my app and its great.

* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by ty_ger07*:

 

I incorporated a rudimentary solution to at least help identify the problem.

 

Update released!

 

Change:

- Added visual indicator of server location uncertainty to server banner image in the case that the server's location is not known and is instead guessed.

 

 

Basically, all it does is overlay a question mark over the flag image to help convey that no result was received from ip-api.com for whatever reason.

 

But, as usual, if you manually specify the desired country code with the &cc=.. URL query string, ip-api.com won't be used, you will see whichever flag you desire, and there will be no question mark over the flag.

* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by DarkZerO_AT*:

 

heyo

 

running into a small issue

the &cc=de override is working perfectly fine here in the forum

but it isnt working on our homepage for some strange reason

 

as soon as i add the override to the banner on our homepage it wont show the image anymore, instead it only shows the code

i really dont know whats wrong with that and i am not saying its the fault of your statspage but i dont know where i could put this one (homepage linked on the banner in my signature)

* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by ty_ger07*:

 

heyo

 

running into a small issue

the &cc=de override is working perfectly fine here in the forum

but it isnt working on our homepage for some strange reason

 

as soon as i add the override to the banner on our homepage it wont show the image anymore, instead it only shows the code

i really dont know whats wrong with that and i am not saying its the fault of your statspage but i dont know where i could put this one (homepage linked on the banner in my signature)

Maybe it has something to do with the way the webpage is encoding the link. What is the engine running your webpage? How do you add the link into the webpage?

 

 

If you enable allow_url_fopen in your php.ini file, you shouldn't need "&cc=DE" anymore at all. That's up to you though.

* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by DarkZerO_AT*:

 

Maybe it has something to do with the way the webpage is encoding the link. What is the engine running your webpage? How do you add the link into the webpage?

 

 

If you enable allow_url_fopen in your php.ini file, you shouldn't need "&cc=DE" anymore at all. That's up to you though.

ok i enabled "allow_url_fopen" now and its working

duh why didnt anyone tell me that earlier? :P

 

i added the banner as standard bbcode since our "news" plugin can use that

our page is powered by ILCH clan script (if thats what you meant by "engine")

* Restored post. It could be that the author is no longer active.
Link to comment

Archived

This topic is now archived and is closed to further replies.




  • Our picks

    • Game Server Hosting:

      We're happy to announce that EZRCON will branch out into the game server provider scene. This is a big step for us so please having patience if something doesn't go right in this area. Now, what makes us different compared to other providers? Well, we're going with the idea of having a scaleable server hosting and providing more control in how you set up your server. For example, in Minecraft, you have the ability to control how many CPU cores you wish your server to have access to, how much RAM you want to use, how much disk space you want to use. This type of control can't be offered in a single service package so you're able to configure a custom package the way you want it.

      You can see all the available games here. Currently, we have the following games available.

      Valheim (From $1.50 USD)


      Rust (From $3.20 USD)


      Minecraft (Basic) (From $4.00 USD)


      Call of Duty 4X (From $7.00 USD)


      OpenTTD (From $4.00 USD)


      Squad (From $9.00 USD)


      Insurgency: Sandstorm (From $6.40 USD)


      Changes to US-East:

      Starting in January 2022, we will be moving to a different provider that has better support, better infrastructure, and better connectivity. We've noticed that the connection/routes to this location are not ideal and it's been hard getting support to correct this. Our contract for our two servers ends in March/April respectively. If you currently have servers in this location you will be migrated over to the new provider. We'll have more details when the time comes closer to January. The new location for this change will be based out of Atlanta, GA. If you have any questions/concerns please open a ticket and we'll do our best to answer them.
      • 5 replies
    • Hello All,

      I wanted to give an update to how EZRCON is doing. As of today we have 56 active customers using the services offered. I'm glad its doing so well and it hasn't been 1 year yet. To those that have services with EZRCON, I hope the service is doing well and if not please let us know so that we can improve it where possible. We've done quite a few changes behind the scenes to improve the performance hopefully. 

      We'll be launching a new location for hosting procon layers in either Los Angeles, USA or Chicago, IL. Still being decided on where the placement should be but these two locations are not set in stone yet. We would like to get feedback on where we should have a new location for hosting the Procon Layers, which you can do by replying to this topic. A poll will be created where people can vote on which location they would like to see.

      We're also looking for some suggestions on what else you would like to see for hosting provider options. So please let us know your thoughts on this matter.
      • 4 replies
    • Added ability to disable the new API check for player country info


      Updated GeoIP database file


      Removed usage sending stats


      Added EZRCON ad banner



      If you are upgrading then you may need to add these two lines to your existing installation in the file procon.cfg. To enable these options just change False to True.

      procon.private.options.UseGeoIpFileOnly False
      procon.private.options.BlockRssFeedNews False



       
      • 2 replies
    • I wanted I let you know that I am starting to build out the foundation for the hosting services that I talked about here. The pricing model I was originally going for wasn't going to be suitable for how I want to build it. So instead I decided to offer each service as it's own product instead of a package deal. In the future, hopefully, I will be able to do this and offer discounts to those that choose it.

      Here is how the pricing is laid out for each service as well as information about each. This is as of 7/12/2020.

      Single MySQL database (up to 30 GB) is $10 USD per month.



      If you go over the 30 GB usage for the database then each additional gigabyte is charged at $0.10 USD each billing cycle. If you're under 30GB you don't need to worry about this.


      Databases are replicated across 3 zones (regions) for redundancy. One (1) on the east coast of the USA, One (1) in Frankfurt, and One (1) in Singapore. Depending on the demand, this would grow to more regions.


      Databases will also be backed up daily and retained for 7 days.




      Procon Layer will be $2 USD per month.


      Each layer will only allow one (1) game server connection. The reason behind this is for performance.


      Each layer will also come with all available plugins installed by default. This is to help facilitate faster deployments and get you up and running quickly.


      Each layer will automatically restart if Procon crashes. 


      Each layer will also automatically restart daily at midnight to make sure it stays in tip-top shape.


      Custom plugins can be installed by submitting a support ticket.




      Battlefield Admin Control Panel (BFACP) will be $5 USD per month


      As I am still working on building version 3 of the software, I will be installing the last version I did. Once I complete version 3 it will automatically be upgraded for you.





      All these services will be managed by me so you don't have to worry about the technical side of things to get up and going.

      If you would like to see how much it would cost for the services, I made a calculator that you can use. It can be found here https://ezrcon.com/calculator.html

       
      • 11 replies
    • I have pushed out a new minor release which updates the geodata pull (flags in the playerlisting). This should be way more accurate now. As always, please let me know if any problems show up.

       
      • 9 replies
×
×
  • Create New...

Important Information

Please review our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.