SimplePortal

Customization => Blocks and Modifications => Topic started by: grafitus on May 03, 2011, 02:30:37 PM

Title: New Staff Block
Post by: grafitus on May 03, 2011, 02:30:37 PM
Many people already wanted to do it; adding new groups, excluding some of members...

(http://simpleportal.net/index.php?action=dlattach;topic=8765.0;attach=5088;image)

New Staff Block allows those:
+ displaying entered groups (separated with commas)
+ excluding entered members (separated with commas)
+ sorting in ascending (by default, sort entered groups IDs -- thanks to Sinan for this)

Before I forget, it works with SMF 2.0 versions.

If you want this; install attached mod file via Package Manager, and you'll see the Sun. 8)
Title: Re: New Staff Block
Post by: slop_chute on May 27, 2011, 09:08:20 PM

I tried this out with my local xampp install.

Installed via package manager with no errors

SMF2.0 RC5
SP 2.3.3

MODS:
1.    Aeva ~ Auto-Embed Video & Audio    7.1
2.    Clean Thread Icons    1.0
3.    Gamer IDs    1.02    
4.    Join date and Location in Posts    1.1
5.    Member Awards    2.2.3    
6.    MessagePreviewOnHover    1.7
7.    newstaffblock    1.0
8.    Simple .htaccess Bot Blocker Mod    1.1
9.    SimplePortal    2.3.3

When I configure and deploy the block I get these errors...

Code: [Select]
http://localhost/prod/index.php?
8: Undefined index: group
File: C:/xampp/htdocs/prod/Sources/PortalBlocks.php
Line: 2376

http://localhost/prod/index.php?
8: Undefined index: link
File: C:/xampp/htdocs/prod/Sources/PortalBlocks.php
Line: 2375

http://localhost/prod/index.php?
8: Undefined index: id_group
File: C:/xampp/htdocs/prod/Sources/PortalBlocks.php
Line: 2375

http://localhost/prod/index.php?
8: Undefined index: group
File: C:/xampp/htdocs/prod/Sources/PortalBlocks.php
Line: 2376

http://localhost/prod/index.php?
8: Undefined index: link
File: C:/xampp/htdocs/prod/Sources/PortalBlocks.php
Line: 2375

http://localhost/prod/index.php?
8: Undefined index: id_group
File: C:/xampp/htdocs/prod/Sources/PortalBlocks.php
Line: 2375

http://localhost/prod/index.php?
8: Undefined index: id
File: C:/xampp/htdocs/prod/Sources/PortalBlocks.php
Line: 2360

http://localhost/prod/index.php?
2: array_multisort() [<a href='function.array-multisort'>function.array-multisort</a>]: Array sizes are inconsistent
File: C:/xampp/htdocs/prod/Sources/PortalBlocks.php
Line: 2350

Not sure what the snag is...

Thanks
Title: Re: New Staff Block
Post by: Old Fossil on May 29, 2011, 11:44:45 AM
Did you fill in the block which from the image says Untitled?
Title: Re: New Staff Block
Post by: slop_chute on May 29, 2011, 04:50:58 PM
Sure did... I even have tried several group combos. This image was just from the last attempt and I just left at the default text.  Also removed and re-installed more than once via pkg manager. .

Thanks
Title: Re: New Staff Block
Post by: SrMorte on June 02, 2011, 04:00:43 PM
With happens the same thing.

Only appears one member icon and nothing more.

The version of my SMF is 2.0 RC4 and the SP is 2.3.3
Title: Re: New Staff Block
Post by: slop_chute on June 02, 2011, 04:25:23 PM
With happens the same thing.

Only appears one member icon and nothing more.

The version of my SMF is 2.0 RC4 and the SP is 2.3.3

Do you get the same errors?

Title: Re: New Staff Block
Post by: SrMorte on June 02, 2011, 04:46:15 PM
The same erros (Error in line XXX or YYY, didn't appear nothing about that)

But the block appear like your block

(http://simpleportal.net/index.php?action=dlattach;topic=8765.0;attach=5122;image)

Didn't work. If you whant i can post here a printscreen.

(Sorry the possible bad english)
Title: Re: New Staff Block
Post by: slop_chute on June 03, 2011, 07:42:44 AM
The same erros (Error in line XXX or YYY, didn't appear nothing about that)

But the block appear like your block

(http://simpleportal.net/index.php?action=dlattach;topic=8765.0;attach=5122;image)

Didn't work. If you whant i can post here a printscreen.

(Sorry the possible bad english)

Did you look in your error log?  These errors did not pop up until I went to the portal. Since you have the same issue I would suspect you have the same errors. 

If I get time I might try a fresh install and see what happens but at this point I have moved on..
Title: Re: New Staff Block
Post by: SrMorte on June 03, 2011, 12:52:56 PM
I've searched the error log, and are in the same lines and files.

Everything is the same.
Title: Re: New Staff Block
Post by: grafitus on June 05, 2011, 12:08:21 PM
Sorry for the delay. I had done a mistake. To resolve:

First, install the mod. Then in ./Sources/PortalBlocks.php:
Code: (Find) [Select]
foreach ($staff_list as $staff)
Code: (Replace) [Select]
foreach ($staff_list as $group)
foreach ($group as $staff)

I'll fix the package within a few days.
Title: Re: New Staff Block
Post by: slop_chute on June 06, 2011, 07:41:40 AM
Sorry for the delay. I had done a mistake. To resolve:

First, install the mod. Then in ./Sources/PortalBlocks.php:
Code: (Find) [Select]
foreach ($staff_list as $staff)
Code: (Replace) [Select]
foreach ($staff_list as $group)
foreach ($group as $staff)

I'll fix the package within a few days.

Ah... Okay -  Thank you..
Title: Re: New Staff Block
Post by: RvG on June 06, 2011, 08:14:13 AM
thanks I've been waiting for this one... will it be included on the SP 2.4?
Title: Re: New Staff Block
Post by: grafitus on June 06, 2011, 10:25:16 AM
will it be included on the SP 2.4?
I hope, maybe...
Title: Re: New Staff Block
Post by: K4Lku on June 26, 2011, 05:27:54 PM
Can this be made scrollable?
Title: Re: New Staff Block
Post by: grafitus on June 26, 2011, 05:46:29 PM
I think you should give width to block body.
Title: Re: New Staff Block
Post by: Yngwiedis on July 01, 2011, 05:25:30 AM
How can i make the members on this block to be displayed with their membergroups color ?

Thank you very very much.
Title: Re: New Staff Block
Post by: grafitus on July 01, 2011, 07:12:01 AM
Enabling 'Colored Member Links' setting from Admin > SimplePortal > General Settings is enough.
Title: Re: New Staff Block
Post by: Yngwiedis on July 01, 2011, 08:37:36 AM
This is already enabled... In the default Staff Block all the members are colored ok.
But not after i install this mod...
Title: Re: New Staff Block
Post by: Yngwiedis on July 02, 2011, 11:41:19 PM
So ? Can we do something about the colors ?
Title: Re: New Staff Block
Post by: Yngwiedis on July 08, 2011, 12:40:21 PM
Anyone ?
Title: Re: New Staff Block
Post by: Yngwiedis on July 13, 2011, 11:49:48 PM
I am still waiting...
Title: Re: New Staff Block
Post by: Yngwiedis on July 16, 2011, 03:19:36 AM
I make upgrade to SMF 2.0 Final and still i dont see any membergroup colors in the new staff block.
Colors are displayed fine in the default staff block.

Please give me some help...
Title: Re: New Staff Block
Post by: Yngwiedis on July 20, 2011, 10:37:23 AM
Some help please ?
Title: Re: New Staff Block
Post by: Yngwiedis on July 23, 2011, 05:46:30 AM
Anyone ?
Title: Re: New Staff Block
Post by: Yngwiedis on July 28, 2011, 01:28:11 AM
Come on guys... I need some help here...
Title: Re: New Staff Block
Post by: †PedeAlaface† on July 29, 2011, 12:22:49 AM

I tried this out with my local xampp install.

Installed via package manager with no errors

SMF2.0 RC5
SP 2.3.3

MODS:
1.    Aeva ~ Auto-Embed Video & Audio    7.1
2.    Clean Thread Icons    1.0
3.    Gamer IDs    1.02    
4.    Join date and Location in Posts    1.1
5.    Member Awards    2.2.3    
6.    MessagePreviewOnHover    1.7
7.    newstaffblock    1.0
8.    Simple .htaccess Bot Blocker Mod    1.1
9.    SimplePortal    2.3.3

When I configure and deploy the block I get these errors...

Code: [Select]
http://localhost/prod/index.php?
8: Undefined index: group
File: C:/xampp/htdocs/prod/Sources/PortalBlocks.php
Line: 2376

http://localhost/prod/index.php?
8: Undefined index: link
File: C:/xampp/htdocs/prod/Sources/PortalBlocks.php
Line: 2375

http://localhost/prod/index.php?
8: Undefined index: id_group
File: C:/xampp/htdocs/prod/Sources/PortalBlocks.php
Line: 2375

http://localhost/prod/index.php?
8: Undefined index: group
File: C:/xampp/htdocs/prod/Sources/PortalBlocks.php
Line: 2376

http://localhost/prod/index.php?
8: Undefined index: link
File: C:/xampp/htdocs/prod/Sources/PortalBlocks.php
Line: 2375                     



what kinds of errors?


http://localhost/prod/index.php?
8: Undefined index: id_group
File: C:/xampp/htdocs/prod/Sources/PortalBlocks.php
Line: 2375

http://localhost/prod/index.php?
8: Undefined index: id
File: C:/xampp/htdocs/prod/Sources/PortalBlocks.php
Line: 2360

http://localhost/prod/index.php?
2: array_multisort() [<a href='function.array-multisort'>function.array-multisort</a>]: Array sizes are inconsistent
File: C:/xampp/htdocs/prod/Sources/PortalBlocks.php
Line: 2350

Not sure what the snag is...

Thanks
Title: Re: New Staff Block
Post by: Yngwiedis on July 31, 2011, 11:12:41 AM
I am still waiting...
Title: Re: New Staff Block
Post by: Yngwiedis on August 02, 2011, 09:12:34 PM
Can we get some help for this block or not ?
Title: Re: New Staff Block
Post by: Old Fossil on August 02, 2011, 10:10:49 PM
Er you do realise there is such a word as patience?

As you should know like sm.org sp is all voluntarily done.

Title: Re: New Staff Block
Post by: Blue on August 02, 2011, 10:15:32 PM
Can we get some help for this block or not ?

Hum... patience is a virtue, you know? I will see what I can do tomorrow.
Title: Re: New Staff Block
Post by: Yngwiedis on August 03, 2011, 01:24:29 AM
Er you do realise there is such a word as patience?

As you should know like sm.org sp is all voluntarily done.

I can have patience and i know that everything here is voluntarilly done.
But... Dont you think that a whole month for some help is way too much ?
The creator of the block is online every day (from what i see) thats why i ask for help every day.
Anyway...


Thank you very much for your interest Blue. I will wait for your post...
Title: Re: New Staff Block
Post by: Yngwiedis on August 07, 2011, 11:49:06 AM
Up...
Title: Re: New Staff Block
Post by: Blue on August 07, 2011, 02:19:41 PM
Up...

My test server is down.. I can only help you if I can test it myself
Title: Re: New Staff Block
Post by: Yngwiedis on August 07, 2011, 02:35:20 PM
OK.  Just dont forget me.

Thank you very much.
Title: Re: New Staff Block
Post by: Blue on August 07, 2011, 07:54:22 PM
Replace PortalBlocks with the one attached.

When I have the time I'll make an install package with the upgraded version of "New Staff Block" made by graphitus
Title: Re: New Staff Block
Post by: Yngwiedis on August 07, 2011, 08:00:08 PM
The only change you do is that line ?

Code: [Select]
m.id_member, m.real_name, m.avatar, m.id_group, mg.group_name, mg.online_color,
Title: Re: New Staff Block
Post by: Blue on August 07, 2011, 08:01:49 PM
That line and this one:

Code: [Select]
'link' => '<a style="color: ' . $row['online_color'] . ';" href="' . $scripturl . '?action=profile;u=' . $row['id_member'] . '">' . $row['real_name'] . '</a>',
Title: Re: New Staff Block
Post by: Yngwiedis on August 07, 2011, 08:05:34 PM
OK. Now everything is working perfect.

Thank you very very much Blue :)
Title: Re: New Staff Block
Post by: Blue on August 07, 2011, 10:33:14 PM
I'm glade I could help ;)
Title: Re: New Staff Block
Post by: Farjo on September 25, 2011, 01:18:11 PM
Thank you for this block - a mod of a mod :)

However I cannot get this to work and just can't work out why. The group I want to add, which is a regular one, is number 15 I assume from its address:
index.php?action=admin;area=membergroups;sa=members;group=15
But when I put "15" into the Groups to Display field and click preview I get nowt!

There is one member of this group and there is nothing in the Exclude Members box. If anyone can suggest where I may be going wrong I'll be grateful :)
Title: Re: New Staff Block
Post by: stapler2025 on December 20, 2011, 06:27:38 PM
Thanks for this mod of a mod.  One request/question I have is, how can I make it to where it order's based upon what I put in the box?  I don't want it to sort anything, and even with the sort box unchecked, it continues to sort in whatever fashion it wishes.
Title: Re: New Staff Block
Post by: Buta on February 02, 2012, 12:22:49 PM
Thank you for this block - a mod of a mod :)

However I cannot get this to work and just can't work out why. The group I want to add, which is a regular one, is number 15 I assume from its address:
index.php?action=admin;area=membergroups;sa=members;group=15
But when I put "15" into the Groups to Display field and click preview I get nowt!

There is one member of this group and there is nothing in the Exclude Members box. If anyone can suggest where I may be going wrong I'll be grateful :)

I have a same problem, please help
I have a group Donator and ID group is 13, when i enter 13 in Groups to display, i got nothing

No errors in error log

Please help me,
Sorry for my bad english
Title: Re: New Staff Block
Post by: andy on April 16, 2012, 05:33:36 AM
Would be nice to have an option to just add member IDs.
I had problems with another staff mod as it required a new group making and caused some permissions problems.
Often staff are a small group of people so nice not to have to worry about making groups but just add the IDs of certain people.
Title: Re: New Staff Block
Post by: mehrtadbir on January 22, 2014, 08:19:51 PM
Thank you all, But there was an error


8: Undefined index: id
/home/xxx/domains/xxx/public_html/Sources/PortalBlocks.php
Line:2356

Code: [Select]
2336:
);
2337:
}
2338:
$smcFunc['db_free_result']($request);
2339:
2340:
if ($sort_asc)
2341:
ksort($staff_list);
2342:
else
2343:
{
2344:
$groups = array_flip($groups);
2345:
ksort($groups);
2346:
array_multisort($groups, SORT_ASC, $staff_list);
2347:
}
2348:
$staff_count = count($staff_list);
2349:
$count = 0;
2350:
$icons = array(1 => 'admin', 'gmod', 'lmod');
2351:
2352:
if (!empty($colorids) && sp_loadColors($colorids) !== false)
2353:
{
2354:
foreach ($staff_list as $k => $p)
2355:
{
==>2356:
if (!empty($color_profile[$p['id']]['link']))
2357:
$staff_list[$k]['link'] = $color_profile[$p['id']]['link'];
2358:
}
2359:
}
2360:
2361:
echo '
2362:
<table class="sp_fullwidth">';
2363:
2364:
foreach ($staff_list as $group)
2365:
foreach ($group as $staff)
2366:
echo '
2367:
<tr>
2368:
<td class="sp_staff sp_center">', !empty($staff['avatar']['href']) ? '
2369:
<a href="' . $scripturl . '?action=profile;u=' . $staff['id'] . '" rel="nofollow"><img src="' . $staff['avatar']['href'] . '" alt="' . $staff['name'] . '" width="40" /></a>' : '', '
2370:
</td>
2371:
<td class="sp_staff_info', $staff_count != ++$count ? ' sp_staff_divider' : '', '">
2372:
', sp_embed_image(!empty($icons[$staff['id_group']]) ? $icons[$staff['id_group']] : 'user'), ' ', $staff['link'], '<br />
2373:
', $staff['group'], '
2374:
</td>
2375:
</tr>';
2376:
Title: Re: New Staff Block
Post by: WhiteEagle on December 18, 2014, 07:23:44 PM
Thank you for this block - a mod of a mod :)

However I cannot get this to work and just can't work out why. The group I want to add, which is a regular one, is number 15 I assume from its address:
index.php?action=admin;area=membergroups;sa=members;group=15
But when I put "15" into the Groups to Display field and click preview I get nowt!

There is one member of this group and there is nothing in the Exclude Members box. If anyone can suggest where I may be going wrong I'll be grateful :)

I have a same problem, please help
I have a group Donator and ID group is 13, when i enter 13 in Groups to display, i got nothing

No errors in error log

Please help me,
Sorry for my bad english

I have this error as well. I want to use it to display my Folding at Home Team Members (id 9), and so when I put in 9, I get nothing, and I'm a member of that group!
Title: Re: New Staff Block
Post by: ThatCrazyGuy on May 01, 2015, 09:11:21 PM
Sorry for the necropost but I was hoping someone would be able to help with this. I'm trying to remove the those 16x16 icons that appear next to the staff member's name. Does anyone know how to do that?

Any help would be greatly appreciated.
Title: Re: New Staff Block
Post by: ♦ Ninja ZX-10RR ♦ on May 04, 2015, 07:30:44 PM
ThatCrazyGuy,

Add this bit at the bottom of your {yourthemename}/css/portal.css
Code: [Select]
#sp_block_12 tr td.sp_staff_info.sp_staff_divider img { display: none; }Replace "12" with the ID of your block. You can see the ID of your block by either using the inspect element function on your browser, but also while editing the block in the URL itself, you will see an "id=XX". That's your ID :)
Tested.

Regards
Title: Re: New Staff Block
Post by: LittleFang on September 10, 2018, 12:09:04 PM
The archive is corrupt, there are no files in the package to install.
Title: Re: New Staff Block
Post by: ♦ Ninja ZX-10RR ♦ on September 13, 2018, 08:30:33 AM
The archive is corrupt, there are no files in the package to install.
Yeah sadly it's because of this: https://simpleportal.net/index.php?topic=14500.0