first off hi : but in need a bit of help with a array problem

the problem is the line ‘group_id’ => $profile[‘id_group’], gets the xbox id but when i ask the second bit off code to do the json its not in the array so how do i get around this any help would be great i wouln’t usualy ask but i have spent alot of time trying to get this to work

first part of the code is the array

[code] // Looping through the members.
while ($profile = $smcFunc’db_fetch_assoc’)
{

        $context['display_groups'][$row['place']][$row['id_group']]['members'][$type][] = array(
        'id' => $profile['id_member'],
        
        'name' => '<span style="color: ' . $row['online_color'] . ';">' . $profile['real_name'] . '</span>',
        'colorless_name' => $profile['real_name'],
		'gamername' => $profile['gamer_xbgt'],
        'href' => $scripturl . '?action=profile;u=' . $profile['id_member'],
        'link' => '<a href="' . $scripturl . '?action=profile;u=' . $profile['id_member'] . '"><span style="color: ' . $row['online_color'] .             ';">' . $profile['real_name'] . '</span></a>',
        'title' => $profile['usertitle'],
        'online' => array(
           'label' => $txt[$profile['is_online'] ? 'online' : 'offline'],
            $txt[$profile['is_online'] ? 'online' : 'offline'] . '</a>',
              'image_href' => $settings['images_url'] . '/' . ($profile['is_online'] ? 'useron' : 'useroff') . '.gif',
        ),
     );[/code]

this bit is not in the array

[code] $gamertag = $member[‘gamername’];
$url = “http://www.oldgamerz.co.uk/xboxapi/xboxapi.php?gamertag=”.urlencode($gamertag);
$output = file_get_contents($url);
$json = json_decode(utf8_encode($output), true);

          $xboxonline = $json['response'][0]['user']['is_online'];
		  $xboxonline_status = $json['response'][0]['user']['online_status'];[/code]

then this is to print the data out

foreach ($group['members'] as $pos => $data) { foreach ($data as $member) { echo ' <tr class="windowbg2"> <td align="center">'; echo ' </td> <td align="left" style="padding: 0mm"> <div align="left" style="padding-left: 20px;"> <img src="', $member['online']['image_href'], '" alt="', $member['online']['link'], '" /> <span class="smalltext">', $member['link'], ' ' ; if ($xboxonline == "0") echo '<span style="color: red">Off line</span>'; else echo '<span style="color: green">Online</span>'; echo ' ', $xboxonline_status; echo'</span><br />';

i have sorted this now

Sponsor our Newsletter | Privacy Policy | Terms of Service