far2slow Posted July 25, 2011 Share Posted July 25, 2011 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>'; } } Quote Link to comment Share on other sites More sharing options...
jacvio Posted August 4, 2011 Share Posted August 4, 2011 Its quite a big chunk of code, do you get any error message when running the code? that might help a bit, php usually gives usefull error messages. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.