SimplePortal

Development => Feature Requests => Topic started by: ARG on November 30, 2011, 12:20:51 PM

Title: Staff List Block Layout
Post by: ARG on November 30, 2011, 12:20:51 PM
I was not sure where to post this since I am not allowed to start a new topic in Block Modifications and Custom Coding seemed to have similar topics redirected here.

Is there something that can be done to insert staff members horizontally and in ID order such as for use in a Footer block?
Example in attachment.

 ;)
Title: Re: Staff List Block Layout
Post by: AngelinaBelle on November 30, 2011, 12:29:46 PM
That seems a natural request, now that we've got that wider bottom block.
That should certainly be possible.  The template for that is right in PortalBlocks.php.

I wonder if I can interest any of our customizers in this?
Title: Re: Staff List Block Layout
Post by: ARG on November 30, 2011, 12:33:53 PM
Now that I know where it is maybe I can come up with something. If i do I will post it here.

Thanx.  ;)
Title: Re: Staff List Block Layout
Post by: [SiNaN] on November 30, 2011, 01:25:44 PM
I'll consider this as an improvement to the Staff List block. Here's how you can change it now:

Sources/PortalBlocks.php

Code: (Find) [Select]
echo '
<table class="sp_fullwidth">';

foreach ($staff_list as $staff)
echo '
<tr>
<td class="sp_staff sp_center">', !empty($staff['avatar']['href']) ? '
<a href="' . $scripturl . '?action=profile;u=' . $staff['id'] . '"><img src="' . $staff['avatar']['href'] . '" alt="' . $staff['name'] . '" width="40" /></a>' : '', '
</td>
<td class="sp_staff_info', $staff_count != ++$count ? ' sp_staff_divider' : '', '">
', sp_embed_image($icons[$staff['type']]), ' ', $staff['link'], '<br />
', $staff['group'], '
</td>
</tr>';

echo '
</table>';

Code: (Replace) [Select]
echo '
<table>
<tr>';

foreach ($staff_list as $staff)
echo '
<td class="sp_staff sp_center">', !empty($staff['avatar']['href']) ? '
<a href="' . $scripturl . '?action=profile;u=' . $staff['id'] . '"><img src="' . $staff['avatar']['href'] . '" alt="' . $staff['name'] . '" width="40" /></a>' : '', '
</td>
<td class="sp_staff_info">
', sp_embed_image($icons[$staff['type']]), ' ', $staff['link'], '<br />
', $staff['group'], '
</td>';

echo '
</tr>
</table>';
Title: Re: Staff List Block Layout
Post by: ARG on November 30, 2011, 03:21:09 PM
Lol, it took me a while but that is almost same thing that I came up with only I added a center align.

http://associationamerica.com/index.php?action=forum

You're just too quick.  :D

Code: [Select]
echo '
<table border="0" align="center">
<tr>';
        foreach ($staff_list as $staff)
    echo '
<td class="sp_staff sp_center">', !empty($staff['avatar']['href']) ? '
<a href="' . $scripturl . '?action=profile;u=' . $staff['id'] . '"><img src="' . $staff['avatar']['href'] . '" alt="' . $staff['name'] . '" width="40" /></a>' : '', '
</td>
<td class="sp_staff_info">
', sp_embed_image($icons[$staff['type']]), ' ', $staff['link'], '<br />
', $staff['group'], '
    </td>';
    echo '
</tr>
</table>';


Edit: Oh, plus I removed the dotted border at the bottom to clean it up a bit.
Title: Re: Staff List Block Layout
Post by: Marjorie on December 01, 2011, 01:22:38 AM
Oh my!!! You are just too true to be good. How do you manage to write and research on such wonderful things? You have inspired me to work harder now. I shall try as much as possible to enjoy life to the fullest and be satiated with the wonderful things that are around me, which I have been unaware of until now.
SimplePortal 2.3.8 © 2008-2024, SimplePortal