Jump to content

Recommended Posts

do i need the json in the array for this to call each member or will it call it for each one ? if so how

i dont think the line  'vbgtxyrr'=> $profile['id_member'] . $row['gamer_xbgt'], is right yet

      // Looping through the members.
      while ($profile = $smcFunc['db_fetch_assoc']($query_members))
      {
             $context['display_groups'][$row['place']][$row['id_group']]['members'][$type][] = array(
            'id' => $profile['id_member'],
            'group_id' => $profile['id_group'],
            'name' => '<span style="color: ' . $row['online_color'] . ';">' . $profile['real_name'] . '</span>',
            'colorless_name' => $profile['real_name'],

		'vbgtxyrr'=> $profile['id_member'] . $row['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',
            ),
         );

      }
      $smcFunc['db_free_result']($query_members);
   }
   $smcFunc['db_free_result']($request);

$gamertag = 'vbgtxyrr';
$url = "http://www.oldgamerz.co.uk/xboxapi/xboxapi.php?gamertag=".urlencode($gamertag);
$output = file_get_contents($url);
$json = json_decode(utf8_encode($output), true);
if($json === null) die("Error parsing JSON response (error #".json_last_error().").");
$xboxonline = $json['response'][0]['user']['is_online'];
$xboxonline_status = $json['response'][0]['user']['online_status'];  
      

Link to comment
https://forums.phpfreaks.com/topic/242481-do-i-have-to-have-the-json-in-the-array/
Share on other sites

any help with this?

 

 

$gamertag = 'vbgtxyrr';
$url = "http://www.oldgamerz.co.uk/xboxapi/xboxapi.php?gamertag=".urlencode($gamertag);
$output = file_get_contents($url);
$json = json_decode(utf8_encode($output), true);
if($json === null) die("Error parsing JSON response (error #".json_last_error().").");
$xboxonline = $json['response'][0]['user']['is_online'];
$xboxonline_status = $json['response'][0]['user']['online_status'];

is the  the json

 

// Looping through the members.
      while ($profile = $smcFunc['db_fetch_assoc']($query_members))
      {
             $context['display_groups'][$row['place']][$row['id_group']]['members'][$type][] = array(
            'id' => $profile['id_member'],
            'group_id' => $profile['id_group'],
            'name' => '<span style="color: ' . $row['online_color'] . ';">' . $profile['real_name'] . '</span>',
            'colorless_name' => $profile['real_name'],
    'vbgtxyrr'=> $profile['id_member'] . $row['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',
            ),
         );

      }

 

this loops through the mebers i have called from the database

 

so how can i do it so i can loop each member through the json

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.