SimplePortal

Customization => Blocks and Modifications => Topic started by: Chen Zhen on November 26, 2011, 02:58:58 PM

Title: SP - Add membergroups to the staff block - Plug-In
Post by: Chen Zhen on November 26, 2011, 02:58:58 PM
Add membergroups to the Simple Portal staff block

Compatible with Simple Portal v2.3.5 and SMF 1.1x or SMF 2.0x

This will install an extra permission under the heading of SimplePortal onto your SMF Forum.
This permission can be added to any existing membergroup and will allow that membergroup to appear in your Simple Portal staff block.
Title: Re: SP - Add membergroups to the staff block - Plug-In
Post by: ZiFFeL on November 28, 2011, 11:52:15 AM
Hi thank you.
Do this MOD let me short the member group as i want?
regards
Title: Re: SP - Add membergroups to the staff block - Plug-In
Post by: Chen Zhen on November 28, 2011, 01:24:48 PM
Hi thank you.
Do this MOD let me short the member group as i want?
regards

It allows you to add whom you wish to your Simple Portal staff block.

   
Title: Re: SP - Add membergroups to the staff block - Plug-In
Post by: XGraf on December 10, 2011, 12:45:23 PM
Nice but how to remove some membergroups from Staff List block?
Title: Re: SP - Add membergroups to the staff block - Plug-In
Post by: Chen Zhen on December 10, 2011, 12:55:09 PM
Nice but how to remove some membergroups from Staff List block?

??

In the permission settings for each membergroup there is a checkbox under the Simple Portal header that reads:
Enable SP staff permission

You enable it to make that entire membergroup show on the staff list and of course disable it if you do not want the users from that membergroup to appear in the staff block.
If you want to add individuals look at my last post.
Administrators will always show. 
Title: Re: SP - Add membergroups to the staff block - Plug-In
Post by: ccbtimewiz on December 10, 2011, 12:56:04 PM
Strange how SP doesn't have this by default
Title: Re: SP - Add membergroups to the staff block - Plug-In
Post by: ZiFFeL on December 14, 2011, 04:45:38 PM
Ok, i have already install the mod, but i hace 3 member groups for the staff block, and i want to put first webmaster, then admins and finally super moderator, if i put the permission on admins a super they appear mixed, but i want to appear separatley.

Is there any way to short members by name or something like that?

Regards and thank you before hand!!
Title: Re: SP - Add membergroups to the staff block - Plug-In
Post by: Chen Zhen on December 15, 2011, 06:00:34 PM
Ok, i have already install the mod, but i hace 3 member groups for the staff block, and i want to put first webmaster, then admins and finally super moderator, if i put the permission on admins a super they appear mixed, but i want to appear separatley.

Is there any way to short members by name or something like that?

Regards and thank you before hand!!

Make a copy of the noted file before editing it so that when I update this mod you can replace it back again beforehand.
 
File: Sources / PortalBlocks.php
Find:
Code: [Select]
WHERE m.id_member IN ({array_int:staff_list})',

Replace with:
Code: [Select]
WHERE m.id_member IN ({array_int:staff_list}) ORDER BY mg.id_group, m.real_name',

Find:
Code: [Select]
ksort($staff_list);

Replace with:
Code: [Select]
/* ksort($staff_list); */

That should put it in order of membergroup id & then alphabetical.
When I adjust it some more I will update the mod.

Title: Re: SP - Add membergroups to the staff block - Plug-In
Post by: XGraf on December 16, 2011, 08:16:09 AM
I cant uderstand you very good(Im from Croatia). I have SP 2.3.4 and I want to remove hiden admins from staff list. Is it possible?
Title: Re: SP - Add membergroups to the staff block - Plug-In
Post by: andy on December 16, 2011, 10:20:26 AM
Works well ... thanks.
Title: Re: SP - Add membergroups to the staff block - Plug-In
Post by: Chen Zhen on December 16, 2011, 05:38:30 PM
I cant uderstand you very good(Im from Croatia). I have SP 2.3.4 and I want to remove hiden admins from staff list. Is it possible?

The last edit was not directed at you unless you want it to be in the same order.

For what you requested, try this:

File: Sources / PortalBlocks.php

find:
Code: [Select]
$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,
)
);

replace with:
Code: [Select]
$request = $smcFunc['db_query']('', '
SELECT
m.id_member, m.show_online, 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}) AND m.show_online = 1',
array(
'staff_list' => $all_staff,
'reg_group_id' => 0,
)
);
Title: Re: SP - Add membergroups to the staff block - Plug-In
Post by: Yngwiedis on March 21, 2012, 01:48:28 AM
Is not working in SimplePortal 2.3.5 RC1. 
Can you please fix it?

Thank you very very much.
Title: Re: SP - Add membergroups to the staff block - Plug-In
Post by: Yngwiedis on March 26, 2012, 05:21:15 PM
Any help please ?
Title: Re: SP - Add membergroups to the staff block - Plug-In
Post by: Old Fossil on March 26, 2012, 06:27:11 PM
Any help please ?

Please have some patience.

Title: Re: SP - Add membergroups to the staff block - Plug-In
Post by: Yngwiedis on March 26, 2012, 06:48:26 PM
OK. Sorry...
Title: Re: SP - Add membergroups to the staff block - Plug-In
Post by: Chen Zhen on March 26, 2012, 08:28:29 PM
This modification works fine with SP v2.3.5 RC1.

You would need to uninstall it prior to upgrading SimplePortal and then reinstall it afterward.
This applies to any plugin.


Title: Re: SP - Add membergroups to the staff block - Plug-In
Post by: Yngwiedis on March 27, 2012, 02:07:15 AM
Hello...

Yes you are right.
This is the only plugin for SP i have and i didn't know that i need to uninstall it before uninstall previous version of SP.

Now everything is ok.

Thank you very very much.
Title: Re: SP - Add membergroups to the staff block - Plug-In
Post by: Nilas on June 13, 2012, 01:14:48 AM
Sorry for necroposting but I had a quick question.

I've been using the mod here and I was able to hide/show specific groups on my simple portal Staff List, however I was unable to hide specific board moderators from said list as there is no option to do so. Is there anyway I can hide board moderators? I tried adding the board moderators to another group which I made hidden from the list however they were still not hidden since they're tied to the moderator group. What can I do to hide them?
Title: Re: SP - Add membergroups to the staff block - Plug-In
Post by: Chen Zhen on August 15, 2012, 12:38:14 PM
Sorry for necroposting but I had a quick question.

I've been using the mod here and I was able to hide/show specific groups on my simple portal Staff List, however I was unable to hide specific board moderators from said list as there is no option to do so. Is there anyway I can hide board moderators? I tried adding the board moderators to another group which I made hidden from the list however they were still not hidden since they're tied to the moderator group. What can I do to hide them?

Nilas,

If you edit your staff block you will see the following checkbox option:
Quote
Disable Local Moderators
.. if you check the box it may give you the desired effect.

So you are requesting that I add a feature to not display individuals belonging to a membergroup?
Then if you add user(s) to that group they will simply not appear no matter which other membergroup they belong to?
I may implement this as it gives the admin more control over it but this is also currently possible.
Any group you create to have only those individuals show (except admins always show) should be set to use unique permissions. This way you can control it so only the members added to that group will appear on the block (+ Admins). Do not set this membergroup to inherit any permissions from other groups. The list will show what their primary member group is set to (not this one unless you set it to do so).


Title: Re: SP - Add membergroups to the staff block - Plug-In
Post by: Aquafan on October 10, 2012, 05:17:41 AM
How to add the sqll by hand?
i cant seem to find it
Title: Re: SP - Add membergroups to the staff block - Plug-In
Post by: Snoopix on July 08, 2013, 04:26:04 AM
how i can change icon of additional staff membergroups?
Title: Re: SP - Add membergroups to the staff block - Plug-In
Post by: Chen Zhen on July 08, 2013, 09:55:40 PM
Snoopix,

  It shows the member's avatar and a small icon which is the global mod icon.  Sinan only provided 3 icons to choose from which is admin, global and local moderator.

  Are you asking to change it to local moderator or are you asking me to add the option of a custom icon?
Perhaps a like icon that is the color that you chose for the membergroup?

  The attachment is an example that will use the membergroup color to opt a specific colored icon. Please peruse the readme during installation to see which 9 color options it will accept.

Uninstall and delete the previous version of this mod prior to using the attachment below.
 
Title: Re: SP - Add membergroups to the staff block - Plug-In
Post by: Burke Knight on December 13, 2013, 08:22:28 AM
Ok, i have already install the mod, but i hace 3 member groups for the staff block, and i want to put first webmaster, then admins and finally super moderator, if i put the permission on admins a super they appear mixed, but i want to appear separatley.

Is there any way to short members by name or something like that?

Regards and thank you before hand!!

Make a copy of the noted file before editing it so that when I update this mod you can replace it back again beforehand.
 
File: Sources / PortalBlocks.php
Find:
Code: [Select]
WHERE m.id_member IN ({array_int:staff_list})',

Replace with:
Code: [Select]
WHERE m.id_member IN ({array_int:staff_list}) ORDER BY mg.id_group, m.real_name',

Find:
Code: [Select]
ksort($staff_list);

Replace with:
Code: [Select]
/* ksort($staff_list); */

That should put it in order of membergroup id & then alphabetical.
When I adjust it some more I will update the mod.



I tried this, yet it still lists the groups the same order as before doing it.
My groups I want to show:
Administrators
Global Moderators
Support Team

How it shows it, before and after editing the PortalBlocks.php file:
Administrators
Support Team
Global Moderators


Any idea on why it wont reorder them after doing the above?
Title: Re: SP - Add membergroups to the staff block - Plug-In
Post by: Chen Zhen on December 13, 2013, 11:42:32 PM
BurkeKnight,

File: Sources / PortalBlocks.php
Find:
Code: [Select]
$request = $smcFunc['db_query']('', '
SELECT
m.id_member, m.real_name, m.avatar, mg.group_name, mg.online_color,
a.id_attach, a.attachment_type, a.filename

replace with (add m.id_group to the query):
Code: [Select]
$request = $smcFunc['db_query']('', '
SELECT
m.id_member, m.real_name, m.avatar, mg.group_name, mg.online_color,
a.id_attach, a.attachment_type, a.filename, m.id_group


find:
Code: [Select]
'type' => $row['type'],

replace with (add group_id to the array):
Code: [Select]
'type' => $row['type'],
                        'group_id' => $row['id_group'],

find:
Code: [Select]
$staff_list = sp_sortmultiple($staff_list, 'type', 'ASC');

replace with (sort array by group_id):
Code: [Select]
$staff_list = sp_sortmultiple($staff_list, 'group_id', 'ASC');

That should work for you, if not I have another solution.
Title: Re: SP - Add membergroups to the staff block - Plug-In
Post by: Burke Knight on December 14, 2013, 08:15:44 AM
That worked. :)

If you have one that has an array so can custom sort, I really could use that for another site.
Would allow me to use the staff block for that site in a really neat way. :)


Thank you, my friend.
Title: Re: SP - Add membergroups to the staff block - Plug-In
Post by: LittleFang on September 11, 2018, 06:46:55 PM
I really need a mod that does this and I'm failing everywhere I turn.  The zip files are corrupt and I cannot extract them, much less install them.  Is everyone having the same issue, or can I just not download anything from this forum?
Title: Re: SP - Add membergroups to the staff block - Plug-In
Post by: ♦ Ninja ZX-10RR ♦ on September 13, 2018, 08:51:04 AM
I really need a mod that does this and I'm failing everywhere I turn.  The zip files are corrupt and I cannot extract them, much less install them.  Is everyone having the same issue, or can I just not download anything from this forum?
Already replied to you on here (https://simpleportal.net/index.php?topic=8765.msg73158#msg73158) :)
Same reason, hopefully someone has a copy, with all of those downloads.
SimplePortal 2.3.8 © 2008-2024, SimplePortal