Clan Adverts

Sponsors

CT on Facebook

Latest Product

User Box

Anonymous
38.107.179.217
Nickname:

Password:

Security Code
Security Code
Type Security Code


PND Downloads Feed

Phpnuke Downloads
How to Delete or Reset yo...
How to Delete or Reset your PHPNuke Admin Account
Lost your admin password ?  Cant login to your admin account ?This sh...
Back Online & Stuff
Back Online & Stuff
Look at us with our nifty website back up and running… Seriousl...
How to edit the admins in...
How to edit the admins in the forums
Here is a way to make someone admin in your forums on your Evo site. I...
Demo Splash Screen
Demo Splash Screen
Ped @ Clan Themes has released a simple splash screen entrance hack. ...
Free Phpnuke Business The...
Free Phpnuke Business Theme 6
This is the 6th Business theme for Phpnuke that Clan Themes has releas...
Tricked Out Slider
Tricked Out Slider
We have seen some great new things come out of Tricked Out News and th...

Custom Work

PHP Nuke Custom Work

www.clanthemes.com :: View topic - Battletracker for bc2
Battletracker for bc2

4 Replies / 927 Views


Post new topic   Reply to topic  

   www.clanthemes.com Forum Index » Blocks

View previous topic :: View next topic


Zyrix
Reputation: 482.6 Add RepSubtract Rep
Local time: 11:20 PM
Location: In the great capital of Sweden; STOCKHOLM
sweden.gif

Rocket Noob
Rocket Noob

0.01 posts per day
Medals: 0

Joined: May 04, 2007
Last Visit: 05 Nov 2010
Posts: 24
Points: 1461 

Post Battletracker for bc2 Posted: Tue Apr 20, 2010 4:23 pm

Shop Purchases:
Battlefield: Bad Company 2 Theme

Hi!

I wonder if there is a block for BadCompany 2, or if somebody can create one. I have one for bf2, but I don't seem to get it right.
Battletracker.com offer XML/RSS Feeds for Clans.
I am using PHPNuke-Clan 4.5

Code:
http://battletracker.com/clanfeed/bc2/xxx/claninfo.xml
(you put in your own clanid where xxx is)


The block I have looks like this:
Code:
<?php

if (eregi("block-bf2clanprofile.php", $_SERVER['PHP_SELF'])) {

Header("Location: index.php");

die();

}



global $user, $cookie, $prefix, $db, $user_prefix, $stack;



$clanid="xxxx";



function startTag($parser, $name, $attrs) {

global $stack;



$tag=array("name"=>$name,"attrs"=>$attrs);

array_push($stack,$tag);

}



function cdata($parser, $cdata) {

global $stack,$i;



if(trim($cdata)) {



$stack[count($stack)-1]['cdata']=$cdata;

}



}



function endTag($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, "startTag", "endTag");

xml_set_character_data_handler($xml_parser, "cdata");



$xmllink="http://bf2tracker.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][cdata];

}



// 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][cdata];

}



// Get Player Data

for($i = 0; $i < sizeof($stack[0][children][2][children]); $i++) {

for($x = 0; $x < sizeof($stack[0][children][2][children][$i][children]); $x++) {

$valname=$stack[0][children][2][children][$i][children][$x][name];

$value=$stack[0][children][2][children][$i][children][$x][cdata];

if($valname=="PLAYERID") $pid=$value;

$playerstats[$pid][$valname]=$value;

}

}



// Now we have 3 arrays with all stats and infos

// print_r($claninfo);

// print_r($clanstats);

// print_r($playerstats);





// Displays Header Image

$content .= "<center><a href=\"http://www.bf2tracker.com/bf2_clanprofile.php?clanid=5328\" target=\"_blank\" ><img src=\"./stats/images/EGDogTags.png\" border=\"0\" alt=\"UppFor members playerstatus\"></a></center><br><br>";



// Display Clan Info

$content .="<Marquee Behavior='Scroll' Direction='Up' Height='200' Width='100%' ScrollAmount='2' ScrollDelay='1' onMouseOver='this.stop()' onMouseOut='this.start()'>";









foreach($playerstats as $key => $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 .="<a target=\"_blank\" href=\"$playerurl\"><font size=\"2\" color=\"#FFFFFF\">$playername</font></a><br><img border=\"0\" src=\"./stats/images/ranksmall_$playerrank.gif\" width=\"60\" height=\"16\"><img border=\"0\" src=\"./stats/images/$statuspic\" width=\"42\" height=\"16\"><BR><br>";

}

$content .="</marquee>";



//echo $content;

?>


On line 17 you find $clanid="xxxx"; This is where you put in your clan id.

Someone please

/Zyrix
 

 
View user's profileSend private message Reply with quote

Joe67
Reputation: 38.1 Add RepSubtract Rep
Local time: 6:20 PM

blank.gif

OMG
OMG

0.14 posts per day
Medals: 0

Joined: Aug 03, 2009
Last Visit: 12 Sep 2011
Posts: 130
Points: 16602 

Post Battletracker for bc2 Posted: Tue Apr 20, 2010 9:18 pm

Shop Purchases:
Multi-T3 Multi Gaming Theme · Clan Roster 2.0

this might be of some use,scroll down

http://evolution-xtreme.com/modules.php?name=Downloads
 

 
View user's profileSend private message Reply with quote

Zyrix
Reputation: 482.6 Add RepSubtract Rep
Local time: 11:20 PM
Location: In the great capital of Sweden; STOCKHOLM
sweden.gif

Rocket Noob
Rocket Noob

0.01 posts per day
Medals: 0

Joined: May 04, 2007
Last Visit: 05 Nov 2010
Posts: 24
Points: 1461 

Post Battletracker for bc2 Posted: Wed Apr 21, 2010 12:36 pm

Shop Purchases:
Battlefield: Bad Company 2 Theme

Thx, did not see that before. Smiley
Wonder if it will work on NukePNC?

But the thing I would like the most is a scrolling block on mainpage.
 

 
View user's profileSend private message Reply with quote


Zyrix
Reputation: 482.6 Add RepSubtract Rep
Local time: 11:20 PM
Location: In the great capital of Sweden; STOCKHOLM
sweden.gif

Rocket Noob
Rocket Noob

0.01 posts per day
Medals: 0

Joined: May 04, 2007
Last Visit: 05 Nov 2010
Posts: 24
Points: 1461 

Post Battletracker for bc2 Posted: Fri Apr 23, 2010 3:14 pm

Shop Purchases:
Battlefield: Bad Company 2 Theme

Can anyone tell me if I can use one of the two modules to my nukePNC?
Before I try the "wrong" one and risk to get everything messed up Confused

I have tried to change the data in the block I submitted in my first post, but when I activate it, the site only shows the blocks in the left side.

Sorry, but I am not so very good in php code Bad HAir Day
 

 
View user's profileSend private message Reply with quote

Ped
Reputation: 63.4 Add RepSubtract Rep
votes: 35
Local time: 11:20 PM
Location: Great British Empire
uk.gif

Site Founder
Site Founder

2.33 posts per day
Medals: 2 (View more...)
Super Dedicated User (Amount: 1)
Theme Guru
Theme Guru
Joined: Nov 13, 2006
Last Visit: 09 Feb 2012
Posts: 4461
Points: 181063 

Post Re: Battletracker for bc2 Posted: Fri Apr 23, 2010 8:31 pm

Shop Purchases:
Clan Roster 2.0 · Bad Company 2 Vietnam Xtreme Theme

Well PNC is based on a variant of Nuke 7.6

Out of the 2 versions available I would try the Ravens Nuke version, It might work but dont hold ya breath.
 

 
View user's profileSend private messageSend e-mail Reply with quote
Post new topic   Reply to topic  
   www.clanthemes.com Forum Index » Blocks


 
4 Replies / 927 Views
Page 1 of 1
All times are GMT
Display posts from previous:   
 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum