Page 1 of 1

Tracker Block Mod

PostPosted: Sat Jul 08, 2006 1:25 pm
Author: mos-firefox
Ok, I tried my best to follow the tutorial on creating a new block. http://integramod.com/forum/kb.php?mode=article&k=6

I created the 4 files with 'tracker' as the common name and uploaded them. I'm quite certain I didn't do it right since nothing is showing in the ACP or anywhere else.

Below is what I would like to add to a block and make it editable through the ACP, if needed. The data required to create the display is coming from an external source so I don't think much editing would be necessary.

This is the original file as found, unedited, except for the clan ID number which I changed to 1242.
Code: Select all
 <?phpif (eregi("block-AAO_Stats.php", $_SERVER['PHP_SELF'])) {     Header("Location]['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://aaotracker.4players.de/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. Prints all data the XML receives.// print_r($claninfo);//print_r($clanstats);// print_r($playerstats);  // CODE ADDED BY TRU (www.orcclan.us) or Contact VIA MSN at [url=mailto:KenDog123@hotmail.com]KenDog123@hotmail.com[/url]  $playerkills=$playerstats[$key][PLAYERKILLS];  $playerkia=$playerstats[$key][PLAYERDEATHS];      // Player's Fragrate is determined by PLAYERKILLS divided by PLAYERDEATHS.    if($playerstats[$key][PLAYERSTATUS]=="1") $statuspic="ponline.gif";  else $statuspic="poffline.gif";    if (round(($playerkills/$playerkia),2) <1> 2) {  $font = "#009900";  }  else {  $font = "#FFCC00";  }  // $frpercent = (round(($playerkills/$playerkia),2) * 100) - 100;  // Displays the Parsed XML Data. You can edit if you know what you are doing. $content .= "<tr><td><font>$playerhonor</font></td><td><font><a>$playername</a></font></td><td><font>" . round(($playerkills/$playerkia),2) . "</font></td><td><img></td></tr>";$content .= "";  }  // Closes the table.$content .= "</table>";// CODE ADDITION ENDED?>  

It should be really easy for anyone that knows what they're doing (unlike me) to make the necessary files. I've read everything here and in the manual. Big learning curve for our websites new webmaster (me).

I'm trying though - honestly.

Of course, I'll check this topic... but you can also use my email for any file changes you have made. http://mos-squad.com/portal.php

Btw, heres what it does:
http://img134.imageshack.us/img134/2003/minitracker4eq.jpg

PostPosted: Tue Jul 11, 2006 6:56 pm
Author: mos-firefox
No takers?

Re: Tracker Block Mod

PostPosted: Tue Jul 11, 2006 9:33 pm
Author: Teelk
Sorry for not replying sooner mos-firefox. I did read this post a few days ago and copied the code to try and help you out. Unfortunately, I've been busy with the IM 1.4.1 beta that I haven't had time to look at it.

The good news is that I've already done an AAO tracker block in the past, I just have to find it again... I'll take a look and see if I can find it.

Re: Tracker Block Mod

PostPosted: Tue Jul 11, 2006 9:42 pm
Author: Teelk
Ok, found it.

Just copy it to your site following the directory structure in the file.

There is a bit of editing on your part, however. You'll need to open /blocks/blocks_imp_tracker.php and edit the following...
Code: Select all
/***********************************//*         Edit Below              *//***********************************/$aa = "1"; //Do you have a game server? 1-yes 2-no 3-hide$aaip = "69.28.242.81"; //Game Server IP$aaport = "1716"; //Game Server Port  $aao = "2"; //AAO Tracker? 1-yes 2-no 3-hide$aaotracker = "xxxx"; //This is the number at the end of the URL for your clan stats  $ts = "1"; //Do you have a TeamSpeak server? 1-yes 2-no 3-hide$tsip = "69.28.242.80"; //Your TS IP$tsport = "8771"; //Port number  $irc = "1"; //Do you have an IRC server/channel? 1-yes 2-no 3-hide$ircserver = "irc.americasarmy.com"; //This is the IRC Server$ircchannel = "cdw"; //This is your IRC Channel (no "#")  $twl = "2"; //Do you have a TWL account? 1-yes 2-no 3-hide$teamwarfare = "your_team"; //The end of your URL after "?team="
...with the info of your clan.

Hope this is what you're lookin' for.

PostPosted: Fri Jul 14, 2006 12:58 pm
Author: mos-firefox
I sincerely appreciate you taking the time to find and upload those blocks Teelk.

Not quite was I was looking to do...
On the right of this website, approx 1/2 down is the list of players and their online/offline game status.
http://10thclan.us/ <-- see Clan AA Tracker block

That's what the coding up above is supposed to be doing but I can't get it to work...
hence, the post asking for help.

Re: Tracker Block Mod

PostPosted: Fri Jul 14, 2006 6:36 pm
Author: Drop-Forged
I couldnt get that to work either.

For my stats blocks I inserted a .html file, that had a frame including the .php file.

[url=http]Click Here for the example[/url]

I put mine in the Center so that it was wide enough to fit the longer usernames.

Re: Tracker Block Mod

PostPosted: Sat Jul 15, 2006 6:58 am
Author: a_lunatic
I just tryed to get this 1 to work properly but couldn't & it needs all users names & ID's in the target & there ID in the img src intemplatesfisubiceblockstracker_block.tpl
& u shouldn't have to do now they have got a new way for clans to show there status here's the link for it [url=http]aaotracker.com[/url]

I got it to work this way here is the link [url=http]IM Archive Site[/url]
also got ts work the same way [url=http]IM Archive Site[/url]

any Q's just ask here's a pic of it

[flash=,:33vvnndh]http://img90.imageshack.us/img90/2692/aaastatusqr1.jpg[/flash:33vvnndh]