Clan Adverts

PHP Web Host - Quality Web Hosting For All PHP Applications

www.clan-themes.co.uk :: View topic - bf2142 tracker, how for phpnuke ?

 Welcome To Clan Themes 

As the board grows please remember the Search Option and we hope you find our community useful.

We also monitor Private Messages to stop members from abusing our sites system.
If you are asking for assistance please provide your site link and nuke version, Thanks.

bf2142 tracker, how for phpnuke ?
Goto page 1, 2  Next

12 Replies / 3301 Views


Post new topic   Reply to topic  

   www.clan-themes.co.uk Forum Index » General PhpNuke

View previous topic :: View next topic


Hippie
Reputation: 461.7
Local time: 1:32 AM


Status: Offline
0.03 posts per day
Medals: 0

Joined: May 18, 2007
Last Visit: 08 Jun 2007
Posts: 17
Points: 388 

Post bf2142 tracker, how for phpnuke ? Posted: Tue May 29, 2007 5:59 pm   

Example this site:

http://www.tbcts.com/

on the middle right has a bf2 and bf2142 tracker.
I'd like the bf2142 tracker on my nuke site, but I am new to phpnuke overall and have noidea how to get the code to work yet alone where to put it and how, whether its a block or module or both.

Someone experienced here could help please step by step ?
I think it would be a block others would like as well..

code is this:

Code:
<php>$name,"attrs"=>$attrs);
 array_push($stack,$tag);
}

function BF2142cdata($parser, $BF2142cdata) {
 global $stack;

 $stack[count($stack)-1]['BF2142cdata'] .= $BF2142cdata;   
}

function BF2142endTag($parser, $name) {
 global $stack;

 $stack[count($stack)-2]['children'][] = $stack[count($stack)-1];
 array_pop($stack);
}


// Parse XML

$stack = array();
$claninfo = array();
$clanstats = array();
$playerstats = array();

$xml_parser = xml_parser_create();
xml_set_element_handler($xml_parser, "BF2142startTag", "BF2142endTag");
xml_set_character_data_handler($xml_parser, "BF2142cdata");

$xmllink="http://bf2142tracker.com/livefeed/xml_clanprofile.php?clanid=$clanid";
$data = xml_parse($xml_parser,file_get_contents($xmllink));
if(!$data) die(sprintf("XML error: %s at line %d", xml_error_string(xml_get_error_code($xml_parser)), xml_get_current_line_number($xml_parser)));

xml_parser_free($xml_parser);


// Get Data

 // Get Clan Profile Data
 for($i = 0; $i < sizeof($stack[0][children][0][children]); $i++) {
  $valname=$stack[0][children][0][children][$i][name];
  $claninfo[$valname]=$stack[0][children][0][children][$i][BF2142cdata];
 }

 // Get Clan Stats Data
 for($i = 0; $i < sizeof($stack[0][children][1][children]); $i++) {
  $valname=$stack[0][children][1][children][$i][name];
  $clanstats[$valname]=$stack[0][children][1][children][$i][BF2142cdata];
 }

 // Get Player Data
 for($i = 0; $i < sizeof($stack[0][children][2][children]); $i++) {
  for($x = 0; $x <sizeof> $value) {
 $playername=$playerstats[$key][PLAYERNAME];
 $playerurl=$playerstats[$key][PLAYERSTATSURL];
 
 if($playerstats[$key][PLAYERRANK]!="") $playerrank=$playerstats[$key][PLAYERRANK];
 else $playerrank=0;
 

 if($playerstats[$key][PLAYERSTATUS]=="1") $statuspic="ponline.gif";
 else $statuspic="poffline.gif";

 $content .="<img border="0\" src="./images/bf2142tracker/$statuspic\" width="42\" height="16\"><div><img border="0\" src="./images/bf2142tracker/ranksmall_$playerrank.gif\" width="16\" height="16\"><a>$playername</a><br></div>";
}
?>


Code is found on the official tracker site:

http://bf2142tracker.com/thread.php?threadid=727&sid=e0899745fe4272c19221deb22a257cc3&threadview=0&hilight=&hilightuser=&page=3
 

 
View user's profileSend private message Reply with quote

Scorpion
Reputation: 471.1
Local time: 6:32 AM
Location: 30 miles from Carentan
blank.gif

Status: Offline
0.41 posts per day
Medals: 3 (View more...)
Dedicated User (Amount: 1)
Very Important Person
Very Important Person
Joined: Dec 09, 2006
Last Visit: 04 Apr 2008
Posts: 295
Points: 31063 

Post Posted: Wed May 30, 2007 4:09 pm   

Ok, the trackers for bf2 and bf2142 work off xml links.

You would first have to register your clan at either site ( 2 or 2142 ) and then your clan will get an id number example in the block code = $clanid="791";

What this does is links to the tracker site of your choice and then displays your members stats in a block.

There are variations to what can be displayed in the block. Honor, rank, kills and so on...

I know this as the Ammerica's Army Ops Tracker that is available in the Clubs downloads works exactly the same way ( the 3 sites are run by the same people ...bf2, bf2142 and America's Army Ops trackers )


So to conclude.... get over to bf2142 or bf2 tracker and register your clan.... once you get an id number, replace it in the example code and add the block file to your sites block folder, then activate.

If you get any problems with the display of the block or it's content, then give me a shout and i'll help you out the best i can.

Note: If you try to display both the bf2 and the bf2142 tracker block, they conflict and neither will display.

You can get around this by making one of the blocks an iframe display, so they would then both show on ya site.

Hope this answers ya question.

Scorps
 

 
View user's profileSend private messageSend e-mailVisit poster's websiteMSN Messenger Reply with quote

OzButcher
Reputation: 464.4
Local time: 2:32 PM

australia.gif

Status: Offline
0.24 posts per day
Medals: 1 (View more...)
Site Supporter (Amount: 1)

Joined: Jan 16, 2007
Last Visit: 26 Feb 2008
Posts: 164
Points: 250 

View user's profileSend private messageVisit poster's websiteMSN Messenger Reply with quote


OzButcher
Reputation: 464.4
Local time: 2:32 PM

australia.gif

Status: Offline
0.24 posts per day
Medals: 1 (View more...)
Site Supporter (Amount: 1)

Joined: Jan 16, 2007
Last Visit: 26 Feb 2008
Posts: 164
Points: 250 

View user's profileSend private messageVisit poster's websiteMSN Messenger Reply with quote

Ped
Reputation: 336.9
votes: 17
Local time: 7:32 AM
Location: Great British Empire
uk.gif

Status: Offline
2.35 posts per day
Medals: 2 (View more...)
Dedicated User (Amount: 1)
Clan Themes Theme Guru
Clan Themes Theme Guru
Joined: Nov 13, 2006
Last Visit: 01 Dec 2008
Posts: 1765
Points: 15745 

Post Posted: Thu May 31, 2007 11:57 am   

Nice find Lads

I have added it to the downloads, his instructions were okay but i cleaned it up and put ALL the images in to a better place and a few other bits n bobs

you can grab it HERE

Embarrased
 

 
View user's profileSend private messageSend e-mailVisit poster's website Reply with quote

Scorpion
Reputation: 471.1
Local time: 6:32 AM
Location: 30 miles from Carentan
blank.gif

Status: Offline
0.41 posts per day
Medals: 3 (View more...)
Site Supporter (Amount: 1)
Very Important Person
Very Important Person
Joined: Dec 09, 2006
Last Visit: 04 Apr 2008
Posts: 295
Points: 31063 

Post Posted: Fri Jun 01, 2007 10:23 am   

Oz, as you can see from this site The Artists Clan, I've been working on the tracker system for a couple of weeks now and pritty much anything is posible with nuke as you know Wink

Once I'm finally finished with converting the America's Army Ops Tracker over to sql, then I'll have a go at the BF2142 module.

Scorps
 

 
View user's profileSend private messageSend e-mailVisit poster's websiteMSN Messenger Reply with quote




OzButcher
Reputation: 464.4
Local time: 2:32 PM

australia.gif

Status: Offline
0.24 posts per day
Medals: 1 (View more...)
Site Supporter (Amount: 1)

Joined: Jan 16, 2007
Last Visit: 26 Feb 2008
Posts: 164
Points: 250 

View user's profileSend private messageVisit poster's websiteMSN Messenger Reply with quote

Scorpion
Reputation: 471.1
Local time: 6:32 AM
Location: 30 miles from Carentan
blank.gif

Status: Offline
0.41 posts per day
Medals: 3 (View more...)
Dedication (Amount: 1)
Very Important Person
Very Important Person
Joined: Dec 09, 2006
Last Visit: 04 Apr 2008
Posts: 295
Points: 31063 

Post Posted: Sat Jun 02, 2007 12:12 pm   

Unfortunately there isn't that much info to post from the BF2142 stats live feed - http://bf2142tracker.com/livefeed/xml_clanprofile.php?clanid=2028

As you can see Oz it's pritty limited atm so not realy worth making a module BUT this is what can be produced from what is available so far -



The warning error comes from the fact that your globaltime and your playertime are zero :--(

I'll keep you posted tho bud Wink
 

 
View user's profileSend private messageSend e-mailVisit poster's websiteMSN Messenger Reply with quote

OzButcher
Reputation: 464.4
Local time: 2:32 PM

australia.gif

Status: Offline
0.24 posts per day
Medals: 1 (View more...)
Site Supporter (Amount: 1)

Joined: Jan 16, 2007
Last Visit: 26 Feb 2008
Posts: 164
Points: 250 

View user's profileSend private messageVisit poster's websiteMSN Messenger Reply with quote




TB_DFW
Reputation: 468
Local time: 4:32 PM

blank.gif

Status: Offline
0.04 posts per day
Medals: 0

Joined: Apr 09, 2007
Last Visit: 01 Dec 2008
Posts: 27
Points: 965 

Post Posted: Sun Jun 03, 2007 1:38 pm   

Shop Purchases:
Multi Gaming (Warrior) Theme

If you're talking about the player stats updating Oz... Unlike AATracker where they automatically update, the 2142 stats need to be updated by the player every time they play through their personal stats link... This has got something to do with reducing the amount of queries to EA & therefore hopefully stopping EA from blocking the site.

So I'd assume it's the same as the BF2 stats tracker where it has to querie the EA Db and then shows the updated info. Would it be possible to add a script to get it to automatically send the querie so that they stay up-to-date?
 

 
View user's profileSend private message Reply with quote

OzButcher
Reputation: 464.4
Local time: 2:32 PM

australia.gif

Status: Offline
0.24 posts per day
Medals: 1 (View more...)
Site Supporter (Amount: 1)

Joined: Jan 16, 2007
Last Visit: 26 Feb 2008
Posts: 164
Points: 250 

View user's profileSend private messageVisit poster's websiteMSN Messenger Reply with quote

mia_undertaker
Reputation: 452
Local time: 1:32 AM