Jump to content

a bit of help with this would be great


far2slow

Recommended Posts

ok this bit of code its displying it eather center or in a column not sure what but i want it to display on the left

 

{

global $context, $scripturl, $settings, $txt, $modSettings;

 

// start to show the data we want.

echo '

<table align="centre" border="0" cellpadding="4" cellspacing="0" width="100%">

<tr>';

 

// Let's list the group members .

$i = 1;

 

echo '

<td width="100%" valign="top">

<span class="upperframe"><span></span></span>';

 

 

foreach ($context['display_groups'][$i] as $id => $group)

{

 

echo '

<table align="left" cellspacing="0" cellpadding="4" width="100%">';

 

 

// show the team image

echo '

<td align="left">' . $group['image'];

 

 

// list the members.

foreach ($group['members'] as $pos => $data)

{

foreach ($data as $member)

{

echo '

<tr class="windowbg">

<td>';

 

echo '

</td>

<td align="left" style="padding: 0mm">

<div align="left" style="padding-left: 5px;">

<img src="', $member['online']['image_href'], '" alt="', $member['online']['label'], '" /> <span class="smalltext">', $member['link'], '</span><br />';

 

// A bit of a browser-side fix...

echo '

<div style="padding: 2px; clear: both;"></div>';

 

}

 

echo '

</table>

<br/>';

}

unset($group);

 

}

 

echo '

</tr>

</table>';

 

}

Link to comment
https://forums.phpfreaks.com/topic/242125-a-bit-of-help-with-this-would-be-great/
Share on other sites


<?php

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

      

   // Grab all the team groups!
   $request = $smcFunc['db_query']('', '
      SELECT mg.id_group, mg.group_name, mg.online_color, mg.stars, t.place, t.roworder
      FROM ({db_prefix}membergroups AS mg, {db_prefix}team AS t)
      WHERE mg.id_group = 18
      ORDER BY t.roworder', array()
   );



   while ($row = $smcFunc['db_fetch_assoc']($request))
   {
      $row['stars'] = empty($row['stars']) ? array('', '') : explode('#', $row['stars']);

      $context['display_groups'][$row['place']][$row['id_group']] = array(
         'name' => $row['group_name'],
         'color' => $row['online_color'],
         'image' => str_repeat('<img src="' . str_replace('$language', $context['user']['language'], isset($row['stars'][1]) ? $settings['images_url'] . '/' . $row['stars'][1] : '') . '" alt="*" border="0" />', empty($row['stars'][0]) || empty($row['stars'][1]) ? 0 : $row['stars'][0]),
         'members' => array(),
         'place' => $row['place'],
      );

      if ($row['id_group'] == 3)
      {
         $query_members = $smcFunc['db_query']('', '
            SELECT
               mem.id_member, mem.id_group, mem.real_name, mem.avatar, mem.last_login, mem.usertitle, b.name, b.id_board,
               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, {db_prefix}moderators AS o, {db_prefix}boards AS b)
               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 o.id_member = mem.id_member
               AND b.id_board = o.id_board
               AND ' . $user_info['query_see_board'] . ''
         );
      }
      else
      {
         $query_members = $smcFunc['db_query']('', '
            SELECT
               mem.id_member, mem.id_group, mem.real_name, mem.avatar, mem.last_login, 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 = {int:id_group} ' . (!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))
      {
      
        // Check if the member is lead.
      
      
      
            $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'],
            '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'],
         
            'last_login' => timeformat($profile['last_login']),
            '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',
            ),
         );


         // Let's make sure the member array is sorted properly, if they want us to.
         if (isset($modSettings['team_showleaders']))
            @ksort($context['display_groups'][$row['place']][$row['id_group']]);
      }
      $smcFunc['db_free_result']($query_members);
   }
   $smcFunc['db_free_result']($request);

   

   $context['tpm_write'] =
'VGVhbSBQYWdlIHYzLjUgJmNvcHk7IDxhIGhyZWY9Imh0dHA6Ly9kcmVhbS1wb3J0YWwubmV0Ij5jY2J0aW1ld2l6PC9hPg==';
}








{
global $context, $scripturl, $settings, $txt, $modSettings;

// start to show the data we want.
echo '
<table align="centre" border="0" cellpadding="4" cellspacing="0" width="100%">
	<tr>';

// Let's list the group members .
 $i = 1;

		echo '
		<td width="100%" valign="top">
			<span class="windowbg"><span></span></span>
			';

		foreach ($context['display_groups'][$i] as $id => $group)
		{

			echo '
			<table align="left" cellspacing="0" cellpadding="4" width="100%">';


			// show the team image
			echo '
				<td align="left">' . $group['image'];


				// list the members.
				foreach ($group['members'] as $pos => $data)
				{
					foreach ($data as $member)
					{
						echo '
					<tr class="windowbg">
						<td>';

						echo '
						</td>
						<td align="left" style="padding: 0mm">
							<div align="left" style="padding-left: 5px;">
								<img src="', $member['online']['image_href'], '" alt="', $member['online']['label'], '" /> <span class="smalltext">', $member['link'], '</span><br />';

						// A bit of a browser-side fix...
						echo '
				<div style="padding: 2px; clear: both;"></div>';
}


			echo '
			</table>
			<br/>';

		unset($group);
		}


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



Archived

This topic is now archived and is closed to further replies.

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