collapse

* Simple Portal Archived Forum

This is an Archive Forum.

The content in this forum may be out-of-date or have been superseded by newer information, and links in forum pages to other sites may not work.
This forum contains archives for future reference.

Visit our thread at Simple Machines Forum for current support.

SMF 2.1 users: EhPortal is a ported version of Simple Portal specifically designed for the SMF 2.1 branch.
Please visit web-develop.ca to download EhPortal and for its support.

* User Info

 
 
Welcome, Guest. Please login or register.

* Who's Online

  • Dot Guests: 387
  • Dot Hidden: 0
  • Dot Users: 0

There aren't any users online.

* Shoutbox

Refresh History
  • Shoutbox is not for support!
  • {OCS}MasterSeal: Yup, Still adore SP
    April 21, 2019, 07:08:06 PM
  • {OCS}MasterSeal: STILL love SP :)
    November 24, 2018, 05:05:50 AM
  • ♦ Ninja ZX-10RR ♦: <3 aegersz
    September 13, 2018, 03:36:09 PM
  • aegersz: I STILL <3 LOVE SimplePortal
    September 13, 2018, 07:11:39 AM
  • 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

* Recent Posts

Adding Forums Button to Nav bar by jirapon
[August 01, 2019, 09:07:12 AM]


Re: Board Icons by ♦ Ninja ZX-10RR ♦
[July 30, 2019, 04:03:41 PM]


MOVED: Czech translation???? by ♦ Ninja ZX-10RR ♦
[July 30, 2019, 03:04:51 PM]


Board Icons by jirapon
[July 30, 2019, 07:28:44 AM]


Re: Thankyou Simpleportal, by ♦ Ninja ZX-10RR ♦
[July 29, 2019, 09:41:29 AM]

Welcome to SimplePortal.net! You can download SimplePortal from the Downloads Area!

Author Topic: Staff List  (Read 17291 times)

0 Members and 2 Guests are viewing this topic.

Offline Racketydoo

  • Semi Newbie
  • *
  • Posts: 5
  • SMF Version: 2.0.11
  • SP Version: 2.3.6
Staff List
« on: May 01, 2016, 07:43:26 PM »
I've been trying to use a couple of SP blocks/mods to identify a non-moderator group to the Staff List.

Using [Block] Show Members (in staff block style) seemed easiest to me, so I added the block. It populates a single member from a multiple-member membergroup and then cuts off at the first divider.

My understanding of code being non-existent and my ability to trouble shoot being very, very limited, I deleted the block and instead installed New Staff Block.

I uploaded it via the Package Manager, added membergroups 2 and 8 and it (apparently) worked perfectly - the right members were displayed in the box with the correct avatar - all seemed well.  However, the following day I found 4k+ errors in the Error Log of the same two errors:
8: Undefined index: id
File: /Forum/Sources/PortalBlocks.php
Line: 2378

2: Illegal string offset 'group'
File: /Forum/Sources/PortalBlocks.php
Line: 2371

If anyone would be willing to point me in the right direction to either get the Show Members block or the New Staff block working correctly, I'd be most appreciative.  :thumbsup:

Many thanks.

(PS: I also tried Add Membergroups to the Staff Block Plugin but there was an issue with installation so I followed the, "Don't proceed if you have no clue what you're doing" advisory and didn't proceed any further with it.  ;D)

Simple Portal 2.3.6
SMF 2.0.11
« Last Edit: May 01, 2016, 07:59:54 PM by Racketydoo »

Offline ♦ Ninja ZX-10RR ♦

  • Spammer Hammer
  • Support
  • *
  • Posts: 1193
  • Gender: Male
  • Sniper Legends
    • Virtual Interactive Games Entertainment™
  • SMF Version: 2.0.13
  • SP Version: 2.3.6
  • Elkarte Version: 1.0.6
Re: Staff List
« Reply #1 on: May 01, 2016, 08:45:39 PM »
Hi,

try this one: http://simpleportal.net/index.php?topic=14168.0
Also, thank you for putting in so many details! It really helps us help you! :)

Regards
Have you tried SimplePortal Documentation before asking? ;)
F.A.Q.  English Support  |  Blocks Support
Fancy Feature idea ?!  |  Blocks Requests
Themes & Graphics

? My job! ?No PMs for support unless it's a paid request. Thank you! :)#OpIsis

Offline Racketydoo

  • Semi Newbie
  • *
  • Posts: 5
  • SMF Version: 2.0.11
  • SP Version: 2.3.6
Re: Staff List
« Reply #2 on: May 01, 2016, 11:52:44 PM »
Thank you for your reply, Ninja.

Unfortunately though, the link you gave me was the first option I tried.  :|

It populates one member from a multi-member membergroup, but the block cuts off at the first divider underneath that member. As a result I can't determine if it is populating with more than one member after that divider.

I'm not attached to any particular block or plugin to achieve the end result. If it can produce the result of adding non-moderator members/membergroups  to the staff list block in some form (within my limited capabilities) I'd see that as a win.  :nervous-happy:

Many thanks for trying to help me. I appreciate it.
« Last Edit: May 01, 2016, 11:55:27 PM by Racketydoo »

Offline ♦ Ninja ZX-10RR ♦

  • Spammer Hammer
  • Support
  • *
  • Posts: 1193
  • Gender: Male
  • Sniper Legends
    • Virtual Interactive Games Entertainment™
  • SMF Version: 2.0.13
  • SP Version: 2.3.6
  • Elkarte Version: 1.0.6
Re: Staff List
« Reply #3 on: May 02, 2016, 11:19:58 AM »
*facepalm* congratulations to me for the most stupid reply since I registered ;D
Sorry man, I was really sleepy and in a hurry when I replied, so I probably either misclicked the link or didn't check it correctly or whatever :/ If you post your FULL  code block then I may have a look, you probably missing a comma or something like that.
Also, what is your php version? https://mediatemple.net/community/products/dv/204643880/how-can-i-create-a-phpinfo.php-page
Have you tried SimplePortal Documentation before asking? ;)
F.A.Q.  English Support  |  Blocks Support
Fancy Feature idea ?!  |  Blocks Requests
Themes & Graphics

? My job! ?No PMs for support unless it's a paid request. Thank you! :)#OpIsis

Offline Racketydoo

  • Semi Newbie
  • *
  • Posts: 5
  • SMF Version: 2.0.11
  • SP Version: 2.3.6
Re: Staff List
« Reply #4 on: May 02, 2016, 03:12:35 PM »
It's all good! I was glad to receive a reply.  :thumbsup:

My PHP version: PHP 5.3.29

1. For the block by Maizono:
I copied the code directly from here: Show Members in staff block. I pasted it into a new php block.
Code: [Select]
<?php

/**
 * @block Show Members
 * @author Rhode Fey (Sayaka Maizono)
 * @version 1.0.2
*/

/*
Usage:
fill the array with group ids of the groups you want to show.
Example for showing just one group, from group 1;
$groups_to_use = array(1);
Example for showing three groups, from group 1, 3, and 8
$groups_to_use = array(1, 3, 8);
*/

$groups_to_use = array(1);

/*
Usage:
fill the array with member ids you don't want to show up.
Example for hiding one member, user #1
$members_to_ignore = array(1);
Example for hiding multiple members, user #1, #3, and #8
$members_to_ignore = array(1, 3, 8);
*/

$members_to_ignore = array();

/*
 *
*/

global $smcFunc$sourcedir$scripturl$modSettings$txt;

// These are strings for errors...
$txt['no_groups'] = 'No groups have been defined! Please refer to the comments in the Block code!';
$txt['no_members'] = 'No members have been found...';

$groups = array();
foreach (
$groups_to_use as $group)
$groups[] = (int) $group;
$groups array_unique($groups);

$ignored_members = array();
foreach (
$members_to_ignore as $id)
$ignored_members[] = (int) $id;
$ignored_members array_unique($ignored_members);

if (empty(
$groups))
{
echo '
<span class="smalltext" style="color: red;">
'
$txt['no_groups'] . '
</span>'
;

return;
}

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

$member_list = array();
while (
$row $smcFunc['db_fetch_assoc']($request))
{
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 '';
}

$member_list[$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'],
'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);

if (empty(
$member_list))
{
echo '
<span class="smalltext" style="color: red;">
'
$txt['no_members'] . '
</span>'
;

return;
}

ksort($member_list);
$member_count count($member_list);
$count 0;

echo 
'
<table class="sp_fullwidth">'
;

foreach (
$member_list as $member)
{
if (!empty($ignored_members))
if (in_array($member['id'], $ignored_members))
return;

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

echo '
</table>'
;
}

?>

Looking at it again today, I can see by using the preview function that the block is correctly populating multiple members from various multi-member lists. The issue seems to be how it displays, not how it populates: the divider is cutting off the block after the first member is listed.

2. For the mod by Grafitus:
I installed the zip file. I did see similar issues described within the thread but assumed file newstaffblock_1.1.zip contained the fix (that link is the zip link, btw). As I say, this works perfectly at the front end, but returns the errors I posted.

Thank you for your help again, Ninja.  :nervous-happy:

Offline ♦ Ninja ZX-10RR ♦

  • Spammer Hammer
  • Support
  • *
  • Posts: 1193
  • Gender: Male
  • Sniper Legends
    • Virtual Interactive Games Entertainment™
  • SMF Version: 2.0.13
  • SP Version: 2.3.6
  • Elkarte Version: 1.0.6
Re: Staff List
« Reply #5 on: May 02, 2016, 04:46:18 PM »
Which groups do you want it to show up? Site URL to see it live?
Have you tried SimplePortal Documentation before asking? ;)
F.A.Q.  English Support  |  Blocks Support
Fancy Feature idea ?!  |  Blocks Requests
Themes & Graphics

? My job! ?No PMs for support unless it's a paid request. Thank you! :)#OpIsis

Offline emanuele

  • Developer
  • *
  • Posts: 293
Re: Staff List
« Reply #6 on: May 03, 2016, 03:04:53 AM »
However, the following day I found 4k+ errors in the Error Log of the same two errors:
8: Undefined index: id
File: /Forum/Sources/PortalBlocks.php
Line: 2378

2: Illegal string offset 'group'
File: /Forum/Sources/PortalBlocks.php
Line: 2371
These two errors are from the Show Members in staff block by Maizono, not from Grafitus New Staff Block.

Clean up the error log, remove Maizono block and re-install Grafitus one.

Offline ccbtimewiz

  • Hero Member
  • *****
  • Posts: 2185
  • Gender: Male
  • $("div.content:dd").hide();
  • SMF Version: None
  • SP Version: None
  • Elkarte Version: None
  • EhPortal Version: None
Re: Staff List
« Reply #7 on: May 25, 2016, 10:16:54 PM »
If desired, I will gladly assist you in adjusting my custom staff block for your particular need if you have difficulties with editing the PHP.