Jump to content

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


Recommended Posts

Originally Posted by TheBoomplayer*:

 

It is likely a DNS issue where you will need to wait.

 

Usually domain name and subdomain creations/changes take 4-6 hours to be available to route to your computer's browser. Since the code is internally referring to various subdirectories of that subdomain, it would manifest itself as a multifaceted issue (even if you manually use the correct ip address in your browser).

 

I think that it will work fine once the subdomain route is established by the DNS (domain name service host resolution). I think you will just have to wait a while and then try again.

 

Does it work fine in a sub-directory of http://silver-revenge.de/?

Yes it is a subdomain of my clan website http://silver-revenge.de
* Restored post. It could be that the author is no longer active.
Link to post

Originally Posted by ty_ger07*:

 

No, the same problem it don`t load the website

 

www.silver-revenge.de/server

It is quite hard for me to troubleshoot further with no idea what you do or do not have. If you remove the database connection details from config.php, does it display the page with an error that it was unable to connect to the database?
* Restored post. It could be that the author is no longer active.
Link to post

Originally Posted by ty_ger07*:

 

As I already said, php code is in english. There is no such thing as french php. It will always be in english. Just translate any echoed text to french. For example, translate "echo 'home page';" to "echo 'in french';".

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

Originally Posted by Kinsman*:

 

If it is up to date, then it must be getting updated by some method or another. Usually PHP code is only executed when a user looks at it and therefore you have to look at the player's stats page in my code to update the user's signature image. Perhaps ezstats makes a task to update all user's signatures every time any single page is looked at.

As always you nailed it, I totally forgot there is a cron job to update the sigs!!!

 

http://www.junglewraiths.net/ezStats...signatures.php

 

Could I do the same to update ours here?

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

Originally Posted by TheBoomplayer*:

 

It is quite hard for me to troubleshoot further with no idea what you do or do not have. If you remove the database connection details from config.php, does it display the page with an error that it was unable to connect to the database?

It works now. I dont now why_! But Thank`s ;-)
* Restored post. It could be that the author is no longer active.
Link to post

Originally Posted by Kinsman*:

 

Ok, I think I'm done, well until Tyger adds more things that I need to roll in anyhow. :tongue:

 

various tweaks in no particular order, css, spacing of scoreboard (remove long country names), retain top 10 on index, retain server ranks (add gameid to both), extra columns for home, clan and potw pages. Add playtime to player page (replace suicide), sum up dogtags, replace metabans link with globalstats link, tweak sigs with more useful (to me) information, remove "" from sig url.

 

http://jw.servegame.org/bf4stats/index.php

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

Originally Posted by ty_ger07*:

 

Haha, never a waste of time! You've done an awesome job. :biggrin:

 

1 last question, is it possible that we can use a cron job to update the sigs every few days?

As always, you can do whatever you want to do.
* Restored post. It could be that the author is no longer active.
Link to post

Originally Posted by Kinsman*:

 

Ah let me rephrase, is there a file that I could call every few days that would update all the sigs via a cron job?

 

For instance would running player.php do the trick, or would it need to be functions.php?

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

Originally Posted by ty_ger07*:

 

Ah let me rephrase, is there a file that I could call every few days that would update all the sigs via a cron job?

 

For instance would running player.php do the trick, or would it need to be functions.php?

The function signature is the function which makes the signature images. It won't do anything unless you provide it with the necessary arguments.

 

In the most basic terms, you would need a file with this info:

 

Code:

<_php

// include config.php contents
require_once('./config/config.php');

// include functions.php contents
require_once('./common/functions.php');

// connect to the stats database
$BF4stats = @mysqli_connect(HOST, USER, PASS, NAME, PORT);
@mysqli_select_db($BF4stats, NAME);

// this game ID
// probably is 1
$GameID = 1;

// open directory to read file contents
if($handle = opendir('./signature/cache/'))
{
	// loop through the directory while reading each file name
	while(false !== ($entry = readdir($handle)))
	{
		// only work on the file if the file contains '.png'
		if(!(stripos($entry, '.png') === false))
		{
			// remove characters we don't want
			$filename = preg_replace('/PID/','',$entry);
			$filename = preg_replace('/FAV0.png/','',$filename);
			$PlayerID = preg_replace('/FAV1.png/','',$filename);
			// do the signature function with the player's rank
			signature($PlayerID, 0, $clan_name, $BF4stats, $GameID);
			// do the signature function with the player's favority weapon
			signature($PlayerID, 1, $clan_name, $BF4stats, $GameID);
		}
	}
}
_>
That should work as long as you put that code in the root directory.

 

When you do it all in one lump sum though, it might take a while and time out. In my test on my server, only 271 files update before the server times out.

 

PID20FAV1.png updated

PID20FAV0.png updated

PID1540FAV0.png updated

PID2FAV1.png updated

PID2FAV0.png updated

PID1FAV0.png updated

PID1FAV1.png updated

PID2303FAV0.png updated

PID2000FAV0.png updated

PID2000FAV1.png updated

PID2303FAV1.png updated

PID871FAV0.png updated

PID871FAV1.png updated

PID2604FAV0.png updated

PID2251FAV0.png updated

PID2251FAV1.png updated

PID1869FAV0.png updated

PID1869FAV1.png updated

PID3880FAV0.png updated

PID3880FAV1.png updated

PID784FAV0.png updated

PID784FAV1.png updated

PID3401FAV0.png updated

PID3401FAV1.png updated

PID2308FAV0.png updated

PID2308FAV1.png updated

PID217FAV0.png updated

PID217FAV1.png updated

PID3586FAV0.png updated

PID3586FAV1.png updated

PID6595FAV0.png updated

PID6595FAV1.png updated

PID1540FAV1.png updated

PID17612FAV0.png updated

PID17612FAV1.png updated

PID9009FAV0.png updated

PID9009FAV1.png updated

PID1207FAV0.png updated

PID1207FAV1.png updated

PID8969FAV0.png updated

PID8969FAV1.png updated

PID791FAV0.png updated

PID791FAV1.png updated

PID5290FAV0.png updated

PID5290FAV1.png updated

PID609FAV0.png updated

PID609FAV1.png updated

PID631FAV0.png updated

PID631FAV1.png updated

PID657FAV0.png updated

PID657FAV1.png updated

PID682FAV0.png updated

PID682FAV1.png updated

PID7224FAV0.png updated

PID7224FAV1.png updated

PID7235FAV0.png updated

PID7235FAV1.png updated

PID735FAV0.png updated

PID735FAV1.png updated

PID769FAV0.png updated

PID769FAV1.png updated

PID788FAV0.png updated

PID788FAV1.png updated

PID8870FAV0.png updated

PID8870FAV1.png updated

PID5668FAV0.png updated

PID5668FAV1.png updated

PID77FAV0.png updated

PID77FAV1.png updated

PID8164FAV0.png updated

PID8164FAV1.png updated

PID99FAV0.png updated

PID99FAV1.png updated

PID2232FAV0.png updated

PID2232FAV1.png updated

PID3319FAV0.png updated

PID3319FAV1.png updated

PID275FAV0.png updated

PID275FAV1.png updated

PID58FAV0.png updated

PID58FAV1.png updated

PID12585FAV0.png updated

PID12585FAV1.png updated

PID4402FAV0.png updated

PID4402FAV1.png updated

PID11276FAV0.png updated

PID11276FAV1.png updated

PID13561FAV0.png updated

PID13561FAV1.png updated

PID1456FAV0.png updated

PID1456FAV1.png updated

PID11884FAV0.png updated

PID11884FAV1.png updated

PID1194FAV0.png updated

PID1194FAV1.png updated

PID120FAV0.png updated

PID120FAV1.png updated

PID12038FAV0.png updated

PID12038FAV1.png updated

PID5460FAV0.png updated

PID5460FAV1.png updated

PID5406FAV0.png updated

PID5406FAV1.png updated

PID110FAV0.png updated

PID110FAV1.png updated

PID1534FAV0.png updated

PID1534FAV1.png updated

PID3388FAV0.png updated

PID3388FAV1.png updated

PID6740FAV0.png updated

PID6740FAV1.png updated

PID656FAV0.png updated

PID656FAV1.png updated

PID3014FAV0.png updated

PID3014FAV1.png updated

PID5386FAV0.png updated

PID5386FAV1.png updated

PID867FAV0.png updated

PID867FAV1.png updated

PID4358FAV0.png updated

PID4358FAV1.png updated

PID11754FAV0.png updated

PID11754FAV1.png updated

PID2865FAV0.png updated

PID2865FAV1.png updated

PID7652FAV0.png updated

PID7652FAV1.png updated

PID1710FAV0.png updated

PID1710FAV1.png updated

PID13110FAV0.png updated

PID13110FAV1.png updated

PID9949FAV0.png updated

PID9949FAV1.png updated

PID17622FAV0.png updated

PID17622FAV1.png updated

PID104FAV0.png updated

PID104FAV1.png updated

PID108FAV0.png updated

PID108FAV1.png updated

PID156FAV0.png updated

PID156FAV1.png updated

PID1660FAV0.png updated

PID1660FAV1.png updated

PID167FAV0.png updated

PID167FAV1.png updated

PID17FAV0.png updated

PID17FAV1.png updated

PID174FAV0.png updated

PID174FAV1.png updated

PID1776FAV0.png updated

PID1776FAV1.png updated

PID2103FAV0.png updated

PID2103FAV1.png updated

PID2107FAV0.png updated

PID2107FAV1.png updated

PID232FAV0.png updated

PID232FAV1.png updated

PID238FAV0.png updated

PID238FAV1.png updated

PID240FAV0.png updated

PID240FAV1.png updated

PID2599FAV0.png updated

PID2599FAV1.png updated

PID2723FAV0.png updated

PID2723FAV1.png updated

PID276FAV0.png updated

PID276FAV1.png updated

PID281FAV0.png updated

PID281FAV1.png updated

PID2866FAV0.png updated

PID2866FAV1.png updated

PID2893FAV0.png updated

PID2893FAV1.png updated

PID3473FAV0.png updated

PID3473FAV1.png updated

PID5383FAV0.png updated

PID5383FAV1.png updated

PID79FAV0.png updated

PID79FAV1.png updated

PID866FAV0.png updated

PID866FAV1.png updated

PID17326FAV0.png updated

PID17326FAV1.png updated

PID17473FAV0.png updated

PID17473FAV1.png updated

PID17645FAV0.png updated

PID17645FAV1.png updated

PID2147FAV0.png updated

PID2147FAV1.png updated

PID2476FAV0.png updated

PID2476FAV1.png updated

PID2553FAV0.png updated

PID2553FAV1.png updated

PID2584FAV0.png updated

PID2584FAV1.png updated

PID2769FAV0.png updated

PID2769FAV1.png updated

PID2774FAV0.png updated

PID2774FAV1.png updated

PID3173FAV0.png updated

PID3173FAV1.png updated

PID3493FAV0.png updated

PID3493FAV1.png updated

PID3588FAV0.png updated

PID3588FAV1.png updated

PID3841FAV0.png updated

PID3841FAV1.png updated

PID3848FAV0.png updated

PID3848FAV1.png updated

PID3969FAV0.png updated

PID3969FAV1.png updated

PID4197FAV0.png updated

PID4197FAV1.png updated

PID436FAV0.png updated

PID436FAV1.png updated

PID4429FAV0.png updated

PID4429FAV1.png updated

PID4847FAV0.png updated

PID4847FAV1.png updated

PID5274FAV0.png updated

PID5274FAV1.png updated

PID5293FAV0.png updated

PID5293FAV1.png updated

PID5311FAV0.png updated

PID5311FAV1.png updated

PID5403FAV0.png updated

PID5403FAV1.png updated

PID5587FAV0.png updated

PID5587FAV1.png updated

PID5788FAV0.png updated

PID5788FAV1.png updated

PID6195FAV0.png updated

PID6195FAV1.png updated

PID6340FAV0.png updated

PID6340FAV1.png updated

PID6791FAV0.png updated

PID6791FAV1.png updated

PID7514FAV0.png updated

PID7514FAV1.png updated

PID7881FAV0.png updated

PID7881FAV1.png updated

PID7945FAV0.png updated

PID7945FAV1.png updated

PID8137FAV0.png updated

PID8137FAV1.png updated

PID8231FAV0.png updated

PID8231FAV1.png updated

PID832FAV0.png updated

PID832FAV1.png updated

PID84FAV0.png updated

PID84FAV1.png updated

PID8546FAV0.png updated

PID8546FAV1.png updated

PID8611FAV0.png updated

PID8611FAV1.png updated

PID8679FAV0.png updated

PID8679FAV1.png updated

PID8803FAV0.png updated

PID8803FAV1.png updated

PID8853FAV0.png updated

PID8853FAV1.png updated

PID8997FAV0.png updated

PID8997FAV1.png updated

PID9020FAV0.png updated

PID9020FAV1.png updated

PID9256FAV0.png updated

PID9256FAV1.png updated

PID9476FAV0.png updated

PID9476FAV1.png updated

PID9776FAV0.png updated

PID9776FAV1.png updated

 

Fatal error: Maximum execution time of 30 seconds exceeded in /home/content/16/11192016/html/bf4stats/player-stats/common/functions.php on line 1141

It would probably be a lot more profitable to just use CptChaos's hack to update only the images necessary when necessary.
* Restored post. It could be that the author is no longer active.
Link to post

Originally Posted by Kinsman*:

 

No no, your almost there! In Ezstats you can set the number of sigs to be updated to whatever you like, I have it on 15 currently. The cron job runs hourly, and updates 15 sigs each time.

 

Where I get totally lost is how it remembers where its up to_?

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

Originally Posted by ty_ger07*:

 

No no, your almost there! In Ezstats you can set the number of sigs to be updated to whatever you like, I have it on 15 currently. The cron job runs hourly, and updates 15 sigs each time.

 

Where I get totally lost is how it remembers where its up to_?

I suppose it reads the file modification time and updates X number of oldest files.

 

http://php.net/filemtime

 

Example:

Code:

<_php

// include config.php contents
require_once('./config/config.php');

// include functions.php contents
require_once('./common/functions.php');

// connect to the stats database
$BF4stats = @mysqli_connect(HOST, USER, PASS, NAME, PORT);
@mysqli_select_db($BF4stats, NAME);

// this game ID
// probably is 1
$GameID = 1;

// create empty array
$times = array();

// open directory to read file contents
if($handle = opendir('./signature/cache/'))
{
	// loop through the directory while reading each file name
	while(false !== ($entry = readdir($handle)))
	{
		// only check the file if the file contains '.png'
		if(!(stripos($entry, '.png') === false))
		{
			// what is the file path and name_
			$file = './signature/cache/' . $entry;
			
			// when this file modified_
			$modified = filemtime($file);
			
			// add this file time to the times array
			$times[] = $modified;
		}
	}
}

// remove duplicates from array
$times = array_unique($times);

// order the array in lowest (earliest) to highest
sort($times); 

// chop off anything after the first 10 times
array_slice($times, 0, 10);

// open directory to read file contents (again)
if($handle = opendir('./signature/cache/'))
{
	// loop through the directory while reading each file name (again)
	while((false !== ($entry = readdir($handle))))
	{
		// what is the file path and name_
		$file = './signature/cache/' . $entry;
		
		// when was it modified_
		$modified = filemtime($file);
		
		// if this file modified time is in the array of oldest files, update the image
		if(in_array($modified, $times))
		{
			
			// only work on the file if the file contains '.png'
			if(!(stripos($file, '.png') === false))
			{
				// remove characters we don't want
				$filename = preg_replace('/PID/','',$entry);
				$filename = preg_replace('/FAV0.png/','',$filename);
				$PlayerID = preg_replace('/FAV1.png/','',$filename);
				
				// do the signature function with the player's rank
				signature($PlayerID, 0, $clan_name, $BF4stats, $GameID);
				
				// do the signature function with the player's favority weapon
				signature($PlayerID, 1, $clan_name, $BF4stats, $GameID);
			}
		}
	}
}
_>
^^ A problem with the above code though is that it will do all files which were modified within the oldest 10 groups of times. If you run the task too often, the times will bunch up and you will have a bunch of files modified at the same time and therefore still update a bunch of files at once.

 

But like I said, CptChaos's solution is much more elegant because it would give you updated information every time it is needed and no images would need to be cached or updated at all.

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

Originally Posted by Jaffaman*:

 

Here's an example:

http://open-web-community.com/test/i...lclanmembers=1

 

In this example, it is looking for stats for PlayerID 1, 2, 3, or 4.

 

clanmembers.php has these queries:

 

Starting on Line 42 (server pagination query):

 

 

Starting on Line 57 (global pagination query):

 

 

Starting on Line 148 (server stats query):

 

 

Starting on Line 164 (global stats query):

 

 

Note that in each of those queries are the lines

 

 

Change those PlayerIDs in all four queries to the PlayerIDs of interest and add as many PlayerIDs as you want separated by 'OR'.

 

 

You can download it here:

http://open-web-community.com/test/B...sTestStats.zip

 

Files changed:

index.php

common/index.php

 

Files added:

clanmembers.php

Great work love it thanks :smile: just one last question when do the player of the week stats get reset/restart ? as i noticed our potw page has not players but TBH i have not been keeping an eye on the to see if players have been added.
* Restored post. It could be that the author is no longer active.
Link to post

Originally Posted by ty_ger07*:

 

Great work love it thanks :smile: just one last question when do the player of the week stats get reset/restart ? as i noticed our potw page has not players but TBH i have not been keeping an eye on the to see if players have been added.

Players of the week could be different every time you look at it. It never "resets". It is always current from this second to the corresponding second 7 days ago. It looks at the sessions table and picks out all the sessions within the last week and organizes them from top to bottom.

 

If you have had players in your server over the last week but no players of the week are showing up, you must have session stats disabled in your plugin.

 

 

By the way, as Kinsman pointed out, if you use the clan members page, I didn't properly edit the column links so that if you click the columns to order them by a different order other than score, it redirects you to the wrong page.

 

myrcon.net/...stats-webpage-for-xpkillers-stats-logger-plugin#entry47344

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

Originally Posted by ty_ger07*:

 

http://lms-bf4-stats.olympe.in/

Where is the error?

You edited the files incorrectly. I can't say what exactly is incorrect since I don't know what you have edited.

 

Your page is echoing config.php out to the world instead of processing it. First delete config.php and edit a new default version of config.php. It looks like you might have accidentally deleted "<_php and>" from the beginning and end of the file.

 

You really should learn HTML, PHP, and CSS if you are planning to edit my files. Otherwise, you take support in your own hands.

 

It is really easy to translate the page to French, but if you don't know how to do it, you should find someone who does.

 

By the way, now anyone who clicks that link will know your database host, username, and password. You should really remove that information quickly.

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

Originally Posted by ty_ger07*:

 

I do not have to change the attributes of the file and I have followed your instructions.

PHP will not echo out like that unless you tell it to. Something has been changed.

 

Delete everything and start over. It is bad for you to leave this information online:

// DATABASE INFORMATION DEFINE('HOST', 'xxx.net'); // database host address DEFINE('PORT', '3306'); // database port - default is 3306 DEFINE('NAME', 'xxx'); // database name DEFINE('USER', 'xxx'); // database user name - sometimes the same as the database name DEFINE('PASS', 'xxx'); // database password // CLAN NAME $clan_name = 'xxx'; // your gaming clan or organization name // PAGE BANNER $banner_image = 'http://les-morales.com/ajout%20images/5ans.jpg'; // your desired page banner // BANNER LINK $banner_url = 'http://les-morales.com/'; // where clicking the banner will take you

You username and password is visible to everyone.
* Restored post. It could be that the author is no longer active.
Link to post

Originally Posted by Jaffaman*:

 

Players of the week could be different every time you look at it. It never "resets". It is always current from this second to the corresponding second 7 days ago. It looks at the sessions table and picks out all the sessions within the last week and organizes them from top to bottom.

 

If you have had players in your server over the last week but no players of the week are showing up, you must have session stats disabled in your plugin.

 

 

By the way, as Kinsman pointed out, if you use the clan members page, I didn't properly edit the column links so that if you click the columns to order them by a different order other than score, it redirects you to the wrong page.

 

myrcon.net/...stats-webpage-for-xpkillers-stats-logger-plugin#entry47344

Thanks a lot i have fixed the clan members page links also it looks like we had session on Yes but save sessiondata to DB No so i have now put that to Yes so it should work :smile:

 

Thanks again for all your hard work.

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

Originally Posted by ty_ger07*:

 

Stays in me that has to find a who(which) translated into French thing(trick); to delete(eliminate), to reinstall, nothing works

I don't understand. Good luck!
* Restored post. It could be that the author is no longer active.
Link to post

Originally Posted by ty_ger07*:

 

Code in first post updated!

 

Change:

- potw.php minor change: group players by player id instead of stats id so that duplicate players aren't shown and full stats go to just one player.

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

Originally Posted by CptChaos*:

 

I've found a bug within the graphs players.php and joinleaves.php. They keep on giving the same statistics, because it doesn't select the latest rows.

 

To fix this, some code should be added in the query:Code:

ORDER BY `TimeRoundStarted` DESC LIMIT {$limit}
, it has to come AFTER the FROM or WHERE clause, see examples below.

 

Updated snippets to compare:

players.php:

Code:

// check if a server was provided
// if so, this is a server stats page
if(isset($_GET['server']) AND !empty($_GET['server']))
{
	$id = mysqli_real_escape_string($BF4stats, $_GET['server']);
	$query  = "SELECT `MinPlayers`, `MaxPlayers`, `AvgPlayers` FROM `tbl_mapstats` WHERE ServerID = ". $id ." ORDER BY `TimeRoundStarted` DESC LIMIT {$limit}";
	$result = mysqli_query($BF4stats, $query);
}
// this must be a global stats page
else
{
	$query  = "SELECT `MinPlayers`, `MaxPlayers`, `AvgPlayers` FROM `tbl_mapstats` ORDER BY `TimeRoundStarted` DESC LIMIT {$limit}";
	$result = mysqli_query($BF4stats, $query);
}
joinsleaves.php:

Code:

// check if a server was provided
// if so, this is a server stats page
if(isset($_GET['server']) AND !empty($_GET['server']))
{
	$id = mysqli_real_escape_string($BF4stats, $_GET['server']);
	$query  = "SELECT `PlayersJoinedServer`, `PlayersLeftServer` FROM `tbl_mapstats` WHERE ServerID = ". $id ." ORDER BY `TimeRoundStarted` DESC LIMIT {$limit}";
	$result = mysqli_query($BF4stats, $query);
}
// this must be a global stats page
else
{
	$query  = "SELECT `PlayersJoinedServer`, `PlayersLeftServer` FROM `tbl_mapstats` ORDER BY `TimeRoundStarted` DESC LIMIT {$limit}";
	$result = mysqli_query($BF4stats, $query);
}
Also, where 1 as where-clause is quite useless.
* Restored post. It could be that the author is no longer active.
Link to post

Originally Posted by 101st-chicago*:

 

nice find, I was just about to post a bug about this

 

I've found a bug within the graphs players.php and joinleaves.php. They keep on giving the same statistics, because it doesn't select the latest rows.

 

To fix this, some code should be added in the query:Code:

ORDER BY `TimeRoundStarted` DESC LIMIT {$limit}
, it has to come AFTER the FROM or WHERE clause, see examples below.

 

Updated snippets to compare:

players.php:

Code:

// check if a server was provided
// if so, this is a server stats page
if(isset($_GET['server']) AND !empty($_GET['server']))
{
	$id = mysqli_real_escape_string($BF4stats, $_GET['server']);
	$query  = "SELECT `MinPlayers`, `MaxPlayers`, `AvgPlayers` FROM `tbl_mapstats` WHERE ServerID = ". $id ." ORDER BY `TimeRoundStarted` DESC LIMIT {$limit}";
	$result = mysqli_query($BF4stats, $query);
}
// this must be a global stats page
else
{
	$query  = "SELECT `MinPlayers`, `MaxPlayers`, `AvgPlayers` FROM `tbl_mapstats` ORDER BY `TimeRoundStarted` DESC LIMIT {$limit}";
	$result = mysqli_query($BF4stats, $query);
}
joinsleaves.php:

Code:

// check if a server was provided
// if so, this is a server stats page
if(isset($_GET['server']) AND !empty($_GET['server']))
{
	$id = mysqli_real_escape_string($BF4stats, $_GET['server']);
	$query  = "SELECT `PlayersJoinedServer`, `PlayersLeftServer` FROM `tbl_mapstats` WHERE ServerID = ". $id ." ORDER BY `TimeRoundStarted` DESC LIMIT {$limit}";
	$result = mysqli_query($BF4stats, $query);
}
// this must be a global stats page
else
{
	$query  = "SELECT `PlayersJoinedServer`, `PlayersLeftServer` FROM `tbl_mapstats` ORDER BY `TimeRoundStarted` DESC LIMIT {$limit}";
	$result = mysqli_query($BF4stats, $query);
}
Also, where 1 as where-clause is quite useless.
* Restored post. It could be that the author is no longer active.
Link to post

Originally Posted by ty_ger07*:

 

I've found a bug within the graphs players.php and joinleaves.php. They keep on giving the same statistics, because it doesn't select the latest rows.

 

To fix this, some code should be added in the query:Code:

ORDER BY `TimeRoundStarted` DESC LIMIT {$limit}
, it has to come AFTER the FROM or WHERE clause, see examples below.

 

Updated snippets to compare:

players.php:

Code:

// check if a server was provided
// if so, this is a server stats page
if(isset($_GET['server']) AND !empty($_GET['server']))
{
	$id = mysqli_real_escape_string($BF4stats, $_GET['server']);
	$query  = "SELECT `MinPlayers`, `MaxPlayers`, `AvgPlayers` FROM `tbl_mapstats` WHERE ServerID = ". $id ." ORDER BY `TimeRoundStarted` DESC LIMIT {$limit}";
	$result = mysqli_query($BF4stats, $query);
}
// this must be a global stats page
else
{
	$query  = "SELECT `MinPlayers`, `MaxPlayers`, `AvgPlayers` FROM `tbl_mapstats` ORDER BY `TimeRoundStarted` DESC LIMIT {$limit}";
	$result = mysqli_query($BF4stats, $query);
}
joinsleaves.php:

Code:

// check if a server was provided
// if so, this is a server stats page
if(isset($_GET['server']) AND !empty($_GET['server']))
{
	$id = mysqli_real_escape_string($BF4stats, $_GET['server']);
	$query  = "SELECT `PlayersJoinedServer`, `PlayersLeftServer` FROM `tbl_mapstats` WHERE ServerID = ". $id ." ORDER BY `TimeRoundStarted` DESC LIMIT {$limit}";
	$result = mysqli_query($BF4stats, $query);
}
// this must be a global stats page
else
{
	$query  = "SELECT `PlayersJoinedServer`, `PlayersLeftServer` FROM `tbl_mapstats` ORDER BY `TimeRoundStarted` DESC LIMIT {$limit}";
	$result = mysqli_query($BF4stats, $query);
}
Also, where 1 as where-clause is quite useless.
Copy.

 

Another issue of course is that user's browsers will cache the image and will display the old one even if a newer one is produced.

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

Originally Posted by CptChaos*:

 

You can give headers along with the image, before PHP sends output.

You just have to set the Expires header to a past date, like this for example:

Code:

header("Expires: Sat, 26 Jul 1997 05:00:00 GMT");
Put this under <_php and you can be sure this header will set.>

 

And a small addition to above; checking if a variable exists and checking if it's not empty seems logic, but checking wheter or not a variable is empty is enough. It returns false when a variable doesn't exist. So if a variable isn't empty, you know it also exists, because without it existence, it can't have (a) value.

 

If you want a better check I suggest to use is_numeric($var) && !empty($var), rather then if($var && !empty($var)).

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • 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.