Jump to content

thephoneguy87

New Members
  • Posts

    4
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

thephoneguy87's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. After playing with it it just doesnt seem this method is very effective. I think i am going to pull the data inta a database every 5 minutes
  2. http://purewebz.com/delta2/index.php Thats the current output with code as shown in my most recent post. I havent even moved to styling that was just so i could see it better .
  3. That doesnt work actually. It just doesnt show the data for that one part of it. I recoded the main part a bit maybe that will help. Thanks for trying . <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> </head> <body> <table border="2" cellspacing="2" cellpadding="2"> <tr> <th><font face="Arial, Helvetica, sans-serif">Tag</font></th> <th><font face="Arial, Helvetica, sans-serif">Online?</font></th> <th><font face="Arial, Helvetica, sans-serif">Game</font></th> <th><font face="Arial, Helvetica, sans-serif">URL</font></th> <th><font face="Arial, Helvetica, sans-serif">Gamertag</font></th> <th><font face="Arial, Helvetica, sans-serif">Add</font></th> <th><font face="Arial, Helvetica, sans-serif">Send MSG</font></th> </tr> <?php $hostname='----'; $username='-----'; $password='-----'; $dbname='------'; mysql_connect($hostname,$username,$password); @mysql_select_db($dbname) or die( "Unable to select database"); $query="SELECT * FROM gamertags"; $result=mysql_query($query); $num=mysql_numrows($result); mysql_close(); $i=0; while ($i < $num) { $f1=mysql_result($result,$i,"first"); $i++; $xml = simplexml_load_file("http://xboxapi.duncanmackenzie.net/gamertag.ashx?GamerTag=".urlencode($f1)); { foreach( $xml->PresenceInfo as $lvl1 ) { $status = 'Status: '.$lvl1->Info.'<br />'; $online = 'Online/Offline: '.$lvl1->StatusText.'<br />'; $Game = 'Game: '.$lvl1->Title.'<br />'; $sex = 'Likes Sex: Yes'.'<br />'; } } { foreach( $xml->Gamertag as $lvl2 ) { $tag = 'Gamertag: '.$lvl2.'<br />'; } } { foreach( $xml->ProfileUrl as $lvl3 ) { $url = "<a href=\"$lvl3\">Profile url</a>".'<br />'; } } { $add = ("<a href=\"http://live.xbox.com/profile/FriendsMgmt.aspx?gt=".urlencode($f1)."&act=Add\">Add as friend</a>".'<br />'); $msg = ("<a href=\"http://live.xbox.com/profile/MessageCenter/SendMessage.aspx?gt=".urlencode($f1)."\">$Send Message</a>".'<br />'); } // Spot for styled data here { // echo $status,$online,$Game,$sex,$tag,$url,$add,$msg; ?> <tr> <td><font face="Arial, Helvetica, sans-serif"><? echo $status; ?></font></td> <td><font face="Arial, Helvetica, sans-serif"><? echo $online; ?></font></td> <td><font face="Arial, Helvetica, sans-serif"><? echo $Game; ?></font></td> <td><font face="Arial, Helvetica, sans-serif"><? echo $sex; ?></font></td> <td><font face="Arial, Helvetica, sans-serif"><? echo $tag; ?></font></td> <td><font face="Arial, Helvetica, sans-serif"><? echo $add; ?></font></td> <td><font face="Arial, Helvetica, sans-serif"><? echo $msg; ?></font></td> </tr> <? } } ?> </table> </body> </html>
  4. I cant figure out how to order by a set paramater ie in my script online/offline. I was told by a wise man (salathe) that i could put all the data into an array and then loop back and output. however i do not know how to do this. Any help would be greatly appreciated. <?php $hostname='*****'; $username='*****'; $password='*****'; $dbname='*****'; mysql_connect($hostname,$username,$password); @mysql_select_db($dbname) or die( "Unable to select database"); $query="SELECT * FROM gamertags"; $result=mysql_query($query); $num=mysql_numrows($result); mysql_close(); $i=0; while ($i < $num) { $f1=mysql_result($result,$i,"first"); $i++; $xml = simplexml_load_file("http://xboxapi.duncanmackenzie.net/gamertag.ashx?GamerTag=".urlencode($f1)); { foreach( $xml->PresenceInfo as $lvl1 ) { echo 'Status: '.$lvl1->Info.'<br />'; echo 'Online/Offline: '.$lvl1->StatusText.'<br />'; echo 'Game: '.$lvl1->Title.'<br />'; echo 'Likes Sex: Yes'.'<br />'; } } { foreach( $xml->Gamertag as $lvl2 ) { echo 'Gamertag: '.$lvl2.'<br />'; } } { foreach( $xml->ProfileUrl as $lvl3 ) { echo 'Page Url: '."<a href=\"$lvl3\">Profile url</a>".'<br />'; } } { echo("<a href=\"http://live.xbox.com/profile/FriendsMgmt.aspx?gt=".urlencode($f1)."&act=Add\">Add as friend</a>".'<br />'); echo("<a href=\"http://live.xbox.com/profile/MessageCenter/SendMessage.aspx?gt=".urlencode($f1)."\">$Send Message</a>".'<br /><br />'); } } ?>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.