Jump to content

I may be well off but i am trying


far2slow

Recommended Posts

I am new to coding so please understand before you slate me to much

This is the code i am working on what i am trying to do is grab the members from  group  18 and list them

At the moment i cant get it to work so any help would be great thank you

 

 

 

{
global $context, $scripturl, $txt, $settings, $user_info, $modSettings, $smcFunc, $options ;

    // Get members 
         $query_members = $smcFunc['db_query']('', '
            SELECT mem.id_member, mem.id_group, mem.real_name, mem.usertitle, 
               IFNULL(lo.log_time, 0) AS is_online,
               IFNULL(a.id_attach, 0) AS id_attach, a.filename, a.attachment_type
            FROM {db_prefix}members AS mem
               LEFT JOIN {db_prefix}log_online AS lo ON (lo.id_member = mem.id_member)
               LEFT JOIN {db_prefix}attachments AS a ON (a.id_member = mem.id_member)
            WHERE mem.id_group = 18 ' . (!empty($modSettings['team_additional_groups']) ? 'OR FIND_IN_SET({int:id_group}, mem.additional_groups)' : '') . '
            ORDER BY mem.real_name ASC',
            array(
               'id_group' => $row['id_group'],
            )
         );
      }

      // Looping through the members.
      while ($profile = $smcFunc['db_fetch_assoc']($query_members))
      {
     
            $context [$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'],
            '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',
            ),
         );

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

{

echo '
<table width="100%" border="0">
  <tr>';
    foreach ($data as $member)
        {
         
echo '		
<td>
<div align="left" style="padding-left: 20px;"> <img src="', $member['online']['image_href'], '" alt="', $member['online']['link'], '" /> <span class="smalltext">', $member['link']; 
        
    	
        echo ' </div>
	}

</td>
  </tr>';
  
  
  echo '	 
  <tr>
    <td> </td>
  </tr>
</table>';


} 
}

Link to comment
Share on other sites

  • 2 weeks later...
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.