collapse collapse

* User Info

 
 
Welcome, Guest. Please login or register.
Did you miss your activation email?

* Who's Online

  • Dot Guests: 111
  • Dot Hidden: 1
  • Dot Users: 1

There aren't any users online.

* Shoutbox

Refresh History
  • Shoutbox is not for support!
  • aegersz: o LOVE you guys - Simple Portal rocks !
    May 09, 2018, 05:18:59 AM
  • Chen Zhen: our apologies for the site being down.. please read server issues topic
    March 22, 2018, 05:32:38 AM
  • {OCS}MasterSeal: LOL PLEASE forget I just posted that. I found the answer in my own dang post back in 2015. lol sorry!
    July 04, 2017, 10:47:55 PM
  • {OCS}MasterSeal: I know this SB isnt' for support, but I just have a general question. Who would I contact to find out where SP stores its block info? Is it DB driven or files? I searched the site but came up with nothing. probably my fault any insight is appreciated.
    July 04, 2017, 10:43:36 PM
  • ♦ Ninja ZX-10RR ♦: Excuse me but what does Simpleportal have to deal with that?
    February 05, 2017, 08:21:14 PM
  • WhiteEagle: of course IMHO that site appears to be dead :(
    February 04, 2017, 01:08:05 PM
  • WhiteEagle: If I can get that, then I'll use it for that site...
    February 04, 2017, 01:07:35 PM
  • WhiteEagle: decided to not use SMF for any projects, unless I can get a copy of the premium version of the fanfiction archive plugin
    February 04, 2017, 01:06:54 PM
  • expertdecisions: cloudflare
    January 28, 2017, 08:01:47 AM
  • aegersz: SM release 2.0.13 !
    January 12, 2017, 06:00:13 AM
  • raffo: Tks Emanuele, even if I didn't understand the fix :D
    November 07, 2016, 02:01:20 AM
  • emanuele: [link]
    November 01, 2016, 12:43:50 PM
  • emanuele: raffo: the English support board is a good place. ;)
    November 01, 2016, 12:43:38 PM
  • raffo: Where can I find the fix for the shoutbox?
    November 01, 2016, 05:06:09 AM
  • {OCS}MasterSeal: To the SP team, I make a point to come here and thank you as much as possible for your work.  so again, THANK YOU!
    October 28, 2016, 10:38:05 AM
  • emanuele: That's indeed funny, the limit is present only in the patch and not the full install.
    October 22, 2016, 06:14:58 PM
  • phantomm: and from what I see only patch is broken, full install package is fine
    October 21, 2016, 03:44:44 PM
  • phantomm: they say it for over 3 weeks now..
    October 21, 2016, 03:43:52 PM
  • aegersz: SMF say that bug fix 2.0.13 is coming soon ...
    October 19, 2016, 06:46:12 PM
Welcome to SimplePortal.net! You can download SimplePortal from the Downloads Area!

Author Topic: a neato staff list  (Read 1165 times)

0 Members and 1 Guest are viewing this topic.

Offline owenenene

  • Semi Newbie
  • *
  • Posts: 5
  • SMF Version: None
  • SP Version: 2.3.6
  • Elkarte Version: None
a neato staff list
« on: January 13, 2017, 04:56:28 AM »
What I'm currently using:

Code: [Select]
<?php
{
global $smcFunc$sourcedir$scripturl$modSettings$color_profile$settings;

$block_parameters = array(
'lmod' => 'check',
);

if ($return_parameters)
return $block_parameters;

require_once($sourcedir '/Subs-Members.php');

if (empty($parameters['lmod']))
{
$request $smcFunc['db_query']('''
SELECT id_member
FROM {db_prefix}moderators AS mods'
,
array(
)
);
$local_mods = array();
while ($row $smcFunc['db_fetch_assoc']($request))
$local_mods[$row['id_member']] = $row['id_member'];
$smcFunc['db_free_result']($request);

if (count($local_mods) > 10)
$local_mods = array();
}
else
$local_mods = array();

$global_mods membersAllowedTo('moderate_board'0);
$admins membersAllowedTo('admin_forum');

$all_staff array_merge($local_mods$global_mods$admins);
$all_staff array_unique($all_staff);

$request $smcFunc['db_query']('''
SELECT
m.id_member, m.real_name, m.avatar, mg.group_name,
a.id_attach, a.attachment_type, a.filename
FROM {db_prefix}members AS m
LEFT JOIN {db_prefix}attachments AS a ON (a.id_member = m.id_member)
LEFT JOIN {db_prefix}membergroups AS mg ON (mg.id_group = CASE WHEN m.id_group = {int:reg_group_id} THEN m.id_post_group ELSE m.id_group END)
WHERE m.id_member IN ({array_int:staff_list})'
,
array(
'staff_list' => $all_staff,
'reg_group_id' => 0,
)
);
$staff_list = array();
$colorids = array();
while ($row $smcFunc['db_fetch_assoc']($request))
{
$colorids[$row['id_member']] = $row['id_member'];

if ($modSettings['avatar_action_too_large'] == 'option_html_resize' || $modSettings['avatar_action_too_large'] == 'option_js_resize')
{
$avatar_width = !empty($modSettings['avatar_max_width_external']) ? ' width="' $modSettings['avatar_max_width_external'] . '"' '';
$avatar_height = !empty($modSettings['avatar_max_height_external']) ? ' height="' $modSettings['avatar_max_height_external'] . '"' '';
}
else
{
$avatar_width '';
$avatar_height '';
}

if (in_array($row['id_member'], $admins))
$row['type'] = 1;
elseif (in_array($row['id_member'], $global_mods))
$row['type'] = 2;
else
$row['type'] = 3;

$staff_list[$row['type'] . '-' $row['id_member']] = array(
'id' => $row['id_member'],
'name' => $row['real_name'],
'link' => '<a href="' $scripturl '?action=profile;u=' $row['id_member'] . '">' $row['real_name'] . '</a>',
'group' => $row['group_name'],
'type' => $row['type'],
'avatar' => array(
'name' => $row['avatar'],
'image' => $row['avatar'] == '' ? ($row['id_attach'] > '<img src="' . (empty($row['attachment_type']) ? $scripturl '?action=dlattach;attach=' $row['id_attach'] . ';type=avatar' $modSettings['custom_avatar_url'] . '/' $row['filename']) . '" alt="" class="avatar" border="0" />' '') : (stristr($row['avatar'], 'http://') ? '<img src="' $row['avatar'] . '"' $avatar_width $avatar_height ' alt="" class="avatar" border="0" />' '<img src="' $modSettings['avatar_url'] . '/' htmlspecialchars($row['avatar']) . '" alt="" class="avatar" border="0" />'),
'href' => $row['avatar'] == '' ? ($row['id_attach'] > ? (empty($row['attachment_type']) ? $scripturl '?action=dlattach;attach=' $row['id_attach'] . ';type=avatar' $modSettings['custom_avatar_url'] . '/' $row['filename']) : '') : (stristr($row['avatar'], 'http://') ? $row['avatar'] : $modSettings['avatar_url'] . '/' $row['avatar']),
'url' => $row['avatar'] == '' '' : (stristr($row['avatar'], 'http://') ? $row['avatar'] : $modSettings['avatar_url'] . '/' $row['avatar'])
),
);
}
$smcFunc['db_free_result']($request);

ksort($staff_list);
$staff_count count($staff_list);
$count 0;
$icons = array(=> 'admin''gmod''lmod');

if (!empty($colorids) && sp_loadColors($colorids) !== false)
{
foreach ($staff_list as $k => $p)
{
if (!empty($color_profile[$p['id']]['link']))
$staff_list[$k]['link'] = $color_profile[$p['id']]['link'];
}
}

echo '
<style style="text/css">
.img-circle {
    border-radius: 50%;
opacity: 1;
filter: alpha(opacity=100);
}
.img-circle:hover {
opacity: 0.5;
filter: alpha(opacity=50);
}
   .hoverTable{
width:15%; 
                margin:auto;
border-collapse:collapse;
}
</style>
<img src="http://gameguides.pro/b/images/stafflist.png" width="" alt="Staff List" style="display: block; margin: auto; " /><br>
<table class="hoverTable">'
;

foreach (
$staff_list as $staff)         {                 if (empty($staff['avatar']['href']))                 $staff['avatar']['href'] = $settings['default_theme_url'] . '/images/sp/default_avatar.gif'; echo ' <tr> <td class="sp_staff sp_center">', !empty($staff['avatar']['href']) ? ' <a href="' $scripturl '?action=profile;u=' $staff['id'] . '"><img class="img-circle"; src="' $staff['avatar']['href'] . '" alt="' $staff['name'] . '" width="50" /></a>' ''' </td> <td class="sp_staff_info'$staff_count != ++$count '' '''"> <span style="font-size:17px">&nbsp;'$staff['link'], '</span><br /> <span style="font-size:12px">&nbsp;&nbsp;'$staff['group'], '</span><br><br></td></tr>';         } echo ' </table>';
}

Live example: http://www.gameguides.pro/f/staff-list/

The code is a bit of a mess, sorry.. :(

What i'm after is a more visually, aesthetically appealing staff list. So any edits to the CSS, etc will be more then welcome. What i would also like is the custom field I added to profiles "about me" (eg. http://www.gameguides.pro/f/profile/Turtt/), to also be displayed next to the staff member.

So what I would like is: profile picture, profile name, rank, about me. (whatever order, just make it look nice :P)

Any help, if you can create it for me, it is more then welcome :)

I will be posting all custom blocks, custom pages, etc. to my website and I will reference the code back to this website if it's okay with you guys :) I'm sure I'm not the only person here after a neato staff list :)