Announcement

Join us on Discord: https://discord.gg/nf43FxS
NM156
The H4xor Mod
+161|5934|North Texas
UPDATE:
Changes: June 8, 2006
* Fixed the formatting for BF2s compare link
* BF2s compare now supports up to 8 players
* Removed the 'frame buster' javascript snippet
* Added an option to replace the Country flag for those that are inncorrect. (See config.php for help)
View the Standalone Leader Board.

Un-zip to a folder of your choice, and upload it to your server.

Open the config.php script, and customize the leader board as you see fit. All the formatting, text, colors, etc, are defined in this file. I tried to make things as simple as possible, for those that aren't familiar with PHP coding. Read the comments for explanations!

To change the language, open the localization.php script to convert the text. All the text displayed in the leader board is in this file. You shouldn't have to edit the API, or the index.php script. (Unless you want to mod it yourself)

If you want to run a cron job, point it to the xmlcron.php script. You should not execute this more than once every two hours! For example:

Code:

* */2 * * * /usr/bin/php /home/<username>/public_html/subfolder/xmlcron.php >/dev/null
The original API has been modified a bit, nothing too extensive though. I've added curl support, to replace the wrapper Chuy used in his version. I'm still using the file cache system, rather than an SQL option. You may have to manually chmod the cache folder to 777, in case the API doesn't.

You can get the script here: msc-mlb-standalone.zip
You can get the Nuke module here: msc-mlb-nuke.zip

Any comments or suggestions? This is the thread.
NM156
The H4xor Mod
+161|5934|North Texas
There is also a PHP Nuke module for those wanting that instead.

You can get the module here: msc-mlb-nuke.zip

Enjoy!
chuyskywalker
Admin
+2,439|5935|"Frisco"

Remind me to look at this tomorrow and include the curl detection support into the base class -- I had someone complain that they needed that just yesterday.
-=XTRA=-Shorty<314>
Member
+0|5765|germany
The Leaderboard script msc-mlb-standalone.zip is very good! I have two questions about it:

1. Can I show there somehow the online state (when the player is online), like the original Leaderboard from http://bf2s.com/ page with a green dot?
2. Is that possible to configure it to show another Stats in it like some Aviator stats? Any documentation there?

Sorry for my english, I'm a german, pls don't look at mistakes

grettings

-=XTRA=-Shorty Webmaster of www.flyingshorty.com

P.S.: Hey chuyskywalker : This is the best Stats page in the whole web! I linked your page!

Last edited by -=XTRA=-Shorty<314> (2006-01-15 12:56:43)

Viper007Bond
Moderator Emeritus
+236|5893|Portland, OR, USA

I can handle answering #1:

No, BF2S doesn't provide that data. Here is an example feed to give you an idea of the data it gets:

Code:

<?xml version="1.0" encoding="iso-8859-1"?>
<players>
    <player 
        nick=")-SiN-(_Viper007Bond" 
        pid="44260977" 
        rank="7" 
        score="22987" 
        kills="8161" 
        deaths="3592" 
        time="571988" 
        country="US" 
        wins="600" 
        losses="215" 
        link="http://bf2s.com/player/44260977/" 
        /> 
</players>
You can however sign up for a service at like Game-Monitor.com that will give you that data.
https://bf3s.com/sigs/044900892044e7fc95e599e832a086ae9bcd7efb.png
NM156
The H4xor Mod
+161|5934|North Texas
Thank you Shorty, your English is just fine. As Viper said, the XML feed doesn't include the online player status. Game-Monitor.com has a very affordable package, that you can subscribe to. $24.95US/yr for 50 players... not too bad. My clan is going to sign up for it, and I'll write some code to include it my leader board code.

The aviator stats are not included in the XML feed. As it is, it's pretty basic, which is what Chuy intended it to be.
ReVmAn
Member
+0|5760|Where politics is not needed
Thnx NM156 for the code. Been playing around with it today and works gr8.
Thank you for sharing this!!
dkturner
Member
+0|5736
Hi.  I uploaded the unzipped files and chmod'ed the cache folder to 777.  When I try to load the page (default setup, with no changes), I get the following error:

"Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, admin and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.


Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request. "

Any ideas on why this may happen?  I have run .php scripts before with no problems including vwar and phpbb.  Any help would be appreciated.  Thanks.
NM156
The H4xor Mod
+161|5934|North Texas
More than likely you don't have cURL support. I knew better than to not have a fall back..

I'll have to fix that, and upload it.
dkturner
Member
+0|5736

NM156 wrote:

More than likely you don't have cURL support. I knew better than to not have a fall back..

I'll have to fix that, and upload it.
Thanks so much for the quick reply.  I look forward to the new version.
tecnomuzik
Member
+1|5746|Chicago
Hey NM156....  Thanks for your help getting my stats board up and runnin smooth!  I couldn't have done it without you.  Right now our stats board displays on its own seperate page - index.php.   Is there a way to get the stats board to display on our site but on a page with the same layout as the rest of the site? 

Our site URL is:  http://gtoclan.kicks-ass.net   and our stats are here:  http://gtoclan.kicks-ass.net/stats/index.php

On the main page the link "Clan Stats" takes you to the leader board, but I'd like to display on a page that looks just like the main site, but have the stats in the middle.  Is this possible and how?

Many Thanks!
tlex3
Member
+0|5736
Thanks for a GREAT STATS SCRIPT and for hosting everyone's BF2 Stats...

Here's our stats page:
http://www.projectacez.com/phpnuke/modules.php?name=Acez_BF2_Stats

I'm still playing with it but its a start...

Its my pleasure to donate $$ to a great site!!!

Many Thanks!!!

|Acez|TLEX3

Last edited by tlex3 (2006-02-13 17:26:27)

SgtTech
Member
+0|5732
First, Great Script!

Secondly, what do I need to update to accomodate the new ranks from the recent 1.2 patch?  I have one member already that is 1st Lieutenant, and several more on there way there quickly.  I managed to get the correct image to show up for his rank, the problem I'm having is with the progress bar for him.

Any help is greatly appreciated.

Last edited by SgtTech (2006-02-16 18:20:42)

NM156
The H4xor Mod
+161|5934|North Texas
Thank you!

I'm in the process of updating the code. The new rank code is easy enough.. but I have to fix the cURL only option. As I've found out, not everyone has this available on their servers.
dkturner
Member
+0|5736
I got a little further now.  The script now runs, but gives me the following error:

"Your cache directory (/home/sites/site68/web/clan/leader/cache) exists, but is not world writable (777). I couldn't make it so. Please do this by hand.  Cache testing failed. You must keep a local cache of the XML data around."

I know the obvious thing is that the 777 chmod is not setup, but the folder is set to 777.  Any ideas?

Thanks.
brainded
Member
+1|5743|Columbia, MO
Great job with this code, both Chuy and NM156!  We had to make a couple of minor tweaks because of some display issues on our site, but it's rolling just fine now.  Our Web guy built a Nuke Block out of it too, if anyone's inteterested.  Check it out here: http://www.momaxxlan.org/modules.php?name=BF2s-Leaderboard

Looking forward to the new updates, even though we are in no danger of needing the higher ranks displayed yet.
NM156
The H4xor Mod
+161|5934|North Texas
I've updated the code for the new ranks. See the original post for the links!

Some Additions/Changes: Feb 23, 2006
* Added curl support by default, sockets as backup. (You need one of the two for this code to work)
* Added new ranking system requirements
* 'Score Per Hour' was added by request
* Removed ASP style tags(not all hosts have these enabled) ie: <?=$var?>
* Added alternate name support for cleaner display (see config.php for info)

See my clan's leader board for the 'alternate name' example: http://www.mscwar.com/bf2lb/
tlex3
Member
+0|5736
Great work as usual NM!!! I'm using it now...
http://www.projectacez.com/phpnuke/modules.php?name=Acez_BF2_Stats

More donations header your way NM!!!


Thanks again!!!
Onji
Member
+0|5791
Thanks so much NM, works great! I love the alternate naming feature. We have it up and running here: http://www.lamerc.com/bf2/stats.php
NM156
The H4xor Mod
+161|5934|North Texas
Cool, glad you guys like it! If there's anything I can add to it, let me know.

Thanks!
dkturner
Member
+0|5736
I can't figure this out.  I have chmod'ed my cache folder to 777, and I still get the following error:

"Your cache directory (/home/sites/site68/web/clan/leader/cache) exists, but is not world writable (777). I couldn't make it so. Please do this by hand.  Cache testing failed. You must keep a local cache of the XML data around."

What am I missing here?  Is it something wrong with the host I am using?  Any help is appreciated.  Thanks.
NM156
The H4xor Mod
+161|5934|North Texas
Damn I forgot about your post, sorry about that. Some hosts won't let you chmod files/directories. My clan's web host is like this(HostGator.. MF's).

Anyway, are you sure that the cache folder is world writeable(0777)? Did you do this via FTP? If so, you may have to create the text file manually, and upload it to the cache directory. To do this, open up the config.php script, and set the $mlb->debug var to true, then upload it. Refresh the page, and view the page source code, and scroll towards the bottom. You'll be looking for something that looks like the following:

Cache file ( /home/sites/site68/web/clan/leader/cache/e47242ca47d49fbf2a446d88782e733a.txt ) is too old.

If this isn't in the page source, then paste the following into the index.php script (AFTER $mlb->get($grouppid);):

echo "File name: " . $mlb->cachedir . "/". md5($grouppid) . ".txt";
This should give you the name of the file you need to upload.

Create this file locally, and upload it to your cache folder. The actual name of the text file will differ from the one I posted here in orange.

I'm about to head out the door, so I'll check back with you later this evening.
dkturner
Member
+0|5736
I added that line to the index.php file, and created and uploaded a blank .txt file with the name it gave me.  I am still getting the cache 777 error.  I uploaded the script package via WS FTP Pro, and have verified that the entire cache folder is still 777.  The only other thing that I find strange, if I leave the .htaccess file in the directory, I get the following error:

"Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, admin and inform them of the time the error occurred, and anything you might have done that may have caused the error.  More information about this error may be available in the server error log.  Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request. "

If I remove the .htaccess file, I get:
"Your cache directory (/home/sites/site68/web/clan/leader/cache) exists, but is not world writable (777). I couldn't make it so. Please do this by hand.  Cache testing failed. You must keep a local cache of the XML data around."

Is this connected??

I appreciate your help on this.  Thanks.

Last edited by dkturner (2006-02-23 10:12:47)

|NFG|Ranger
Member
+0|5747
Hello, has anyone gotten this to work on Mambo or Joomla? I tried inserting the code as a module which didn't work. I also tried using a wrapper but, instead of opening within my page my leaderboard page opens instead. I have gotten it to work as a standalone. Any help would be greatly appreciated. Thanks, Chris.
duffry
Moderator Emeritus
+148|5927|Cheshire, UK

NM156 wrote:

Cool, glad you guys like it! If there's anything I can add to it, let me know.
Very nice work sir, real asset to the community.


What I particularly like about your clan leaderboard is the column sorting.
I have uploaded a trial of your code (no prefs set) and notice that this isn't a feature.

Any plans to release this on the world too?
Understand if you don't want to but would really appreciate it if you did.

Thanks again, keep it up.
d.

Board footer

Privacy Policy - © 2021 Jeff Minard