aTi|Sanders
Hold your Fire, I forgot my gun!
+0|6977
if ($deaths == 0) {
$kd = "Go Play more!";
} else {
$kd =  number_format($kills/$deaths, 2);
}

That should eleminate anyone with 0 deaths from the start.

Last edited by aTi|Sanders (2005-11-10 10:17:01)

midgetspy
Member
+3|7038
Chuy:

Mine should work as well - maybe I should have added brackets for clarity:

$kd = $kills / (($deaths == 0) ? 1 : $deaths);

(and yes, ternary operations are great ;-P)

Nic

Last edited by midgetspy (2005-11-10 10:26:26)

aTi|Sanders
Hold your Fire, I forgot my gun!
+0|6977
I put a new little template i did in fireworks and sliced in fireworks "Speed job" on the stats script i did. Its in the download now for the stats script i did.

heres a demo http://ati-gaming.com/bf2stats/

download it here http://ati-gaming.com/bf2stats/bf2stats.zip

P.S. i added another field for your site. So be sure to put your link in. Its right under the PID's

Last edited by aTi|Sanders (2005-11-10 12:58:07)

NM156
The H4xor Mod
+161|7056|North Texas

chuyskywalker wrote:

Also, I will be changing the XML feed this weekend. So be on the lookout.
What's in store for the changes? I'm assuming you're adding more stats. Will it be dynamic, i.e., can we pick what we want in the feed, like the old EA stats server?
riptide2k
Member
+7|6975|Zurich, Switzerland

chuyskywalker wrote:

Also, I will be changing the XML feed this weekend. So be on the lookout.
Can't wait to see what's new..
chuyskywalker
Admin
+2,439|7057|"Frisco"

No, I'm probably just going to include the raw'er' data. Like kills, deaths, timeplayed, total score instead of SPM, KDR, etc.

I feel like making customizeable columns would, essentially, be providing a raw feed to my database. And as unready for the storm of use that EA saw, I would be moreso unable to stop those flood gates.
V@no
Member
+-1|6956
Hey guys, u were talking about K/D ratio in decimal number, but what about fraction type ( 1:2 )?

IMO it will be easier to "understand" that way (unless ofcourse you already used to decimal ratio)
chuyskywalker
Admin
+2,439|7057|"Frisco"

the A:B ratios are, in fact, not easier to understand. How about this one:

2231:231 vs. 8347:983

Obviously, We can see that this person has a good KD, but how good is it? How easy is it to compare the two? Write them as a decimal:

9.6 vs. 8.4

Isn't that easier? Less brain power needed to compared relative values because by making it a fractional ratio, you also reduce it to a simple multiplier.

HOWEVER, if you want to do it your way, you'll be right able to. The XML feed will simply include total kills and total deaths. If you choose to use that for making one ratio over the other it totally your business.
Avicus|PSK
Member
+0|6952
Actually I think the easiest way to see it would be how many kills for every "SINGLE" death.

Example

3 kills : 1 death
or
2.78 kills : 1 death

which is the same as the decimal feature that is on there, it is just understood that it is to 1 death.
KaZaMa
Member
+0|7039|Asturias
go chuyskywalker!! go!! xD and thanks.
NM156
The H4xor Mod
+161|7056|North Texas

chuy wrote:

No, I'm probably just going to include the raw'er' data. Like kills, deaths, timeplayed, total score instead of SPM, KDR, etc.
The only ones I'd care to see are Country, Kills, Deaths, Wins, and Losses. Anything else would be gravy.

chuy wrote:

I feel like making customizeable columns would, essentially, be providing a raw feed to my database. And as unready for the storm of use that EA saw, I would be moreso unable to stop those flood gates.
I fully understand that. The only reason I asked, is I'm working on a Nuke module, that would include an SQL option, with XML cache being the default. With the DB option, there has to be code to check field names, that correspond with the XML stat names. If you start changing things on your end, it'll mess things up. Was just thinking ahead is all..
riptide2k
Member
+7|6975|Zurich, Switzerland
I was on the lookout the whole weekend.. where's the new XML feed..?
aTi|Sanders
Hold your Fire, I forgot my gun!
+0|6977
NM i was going to do a SQL version and intergrate it into Clan Command Center as a mod. Though i keep running into the issue of auto updates. I had it all written and working. Just didnt finnish it.

What the main issue is with doing SQL is you have to write the SQL insert of any new one while at the same time write an if function that if that PID already exists that it should run a update. Though at the same time you must run all this to update when the XML does.

So have fun.
SodaBob
Member
+-1|7053|Indiana, US

aTi|Sanders wrote:

NM i was going to do a SQL version and intergrate it into Clan Command Center as a mod. Though i keep running into the issue of auto updates. I had it all written and working. Just didnt finnish it.

What the main issue is with doing SQL is you have to write the SQL insert of any new one while at the same time write an if function that if that PID already exists that it should run a update. Though at the same time you must run all this to update when the XML does.

So have fun.
All one needs to do is timestamp each update to your SQL database.  Then check the timestamp with the current time.  If it has been less then two hours since the last update, don't grab the new XML, just display the data already in the SQL db.  If it has been more than two hours, let the web page grab the new XML and update the SQL db (updating any existing records and adding anything new).  This works since your IP address can have up to three XML requests every 6 hours, and means that your leaderboard data is never older than 2 hours.

I think I've seen some others already offering ASP/SQL versions of the XML leaderboard, search this topic for their solutions.  If anyone is interested in my ASP/SQL solution for the XML leaderboard, let me know and I'll try to find the time to make it "generic" enough for public use.
NM156
The H4xor Mod
+161|7056|North Texas
What Sanders is referring to, is the field names for the DB. If Chuy decides to change things(history has shown he does.. ), you have to check the XML player attributes with the field names in the DB.

What I'm going to do, is have two fields, one for the timestamp, and a text field to store the serialized array from the feed. That should eliminate any need to check the field names against the DB.

The only problem now, is actually displaying any new content to the leader board. What a pain in the ass... I have a working Nuke module now, just waiting on cha-cha-cha-Chuy to do his thing....
aTi|Sanders
Hold your Fire, I forgot my gun!
+0|6977
no its not about timestamping, if i wanted to limit the time it updated that wouldnt be an issue.

What i wanted to do is:

When the XML feed updates, then it inserts or Updates the current SQL. If you think about the fact that each time you add a PID you will have to insert a new row. Though when you update it will update like so "WHERE pid='$stats['PID']'". That would insure it went into the proper table.

So its a matter of this:

Updateing when the XML does
Checking the time the XML updates
Checking if PID already exists
Updateing IF the PID exists
Inserting if the PID doesnt exist

Basicly giveing you the SQL. All you have to do is call it.

Chuy told me he is changeing the way he outputs so i didnt continue. Also i respected the fact that Chuy asked me not to do it in SQL because some people dont have SQL.
chuyskywalker
Admin
+2,439|7057|"Frisco"

Oh shit. I totally forgot I said I'd do this. My bad... *opens Dreamweaver* ...
chuyskywalker
Admin
+2,439|7057|"Frisco"

aaaaaaaaaaaaaaaaaaaaaaaaand updated!

I've expanded the fields in the XML feed to include a few more goodies (the popular ones that make sense) and the API has also been updated to utilize the new feed (eg, it will infer SPM, KDR, and WLR from the feed items provided.)

You can see all the original links for the update downloads, readme, and examples.
aTi|Sanders
Hold your Fire, I forgot my gun!
+0|6977
New version released.....Ding Ding....come and get it....has all the new toys

heres a demo http://ati-gaming.com/bf2stats/

download it here http://ati-gaming.com/bf2stats/bf2stats.zip
NM156
The H4xor Mod
+161|7056|North Texas
As always, it's appreciated Chuy!
riptide2k
Member
+7|6975|Zurich, Switzerland
Thank you very much for the update, Chuy!

Last edited by riptide2k (2005-11-15 04:41:50)

Lord_Arkhan
Member
+0|6988
Thank You Chuy for the Update!

@aTi|Sanders

Great Job but your Paket is wrong.

Missing in images:

Code:

images/layout/index_r4_c9.jpg
images/layout/index_r2_c6.jpg
images/layout/index_r2_c7.jpg
images/layout/index_r2_c9.jpg
images/layout/index_r4_c2.jpg
See http://www.bf2-nss.de/leaderc.php
aTi|Sanders
Hold your Fire, I forgot my gun!
+0|6977
oh shit! fixing it now and will have a fixed version up in 3 mins.


fixed......

Last edited by aTi|Sanders (2005-11-15 10:21:32)

Fr33
Member
+0|6996
Cool guys thanks alot!

[url]http://www.cyn8.com/bf2statslb[/url]

Edit: Problem I had is understood all working aok!!

Last edited by Fr33 (2005-11-15 15:16:17)

fr8
Member
+0|6961
Great work chuy!

[url]http://www.snel.se/slap/[/url]

Board footer

Privacy Policy - © 2024 Jeff Minard