EzPortal - Portal Software for Forums
EzPortal Forums => ezBlocks => Topic started by: npereira on July 15, 2009, 07:40:19 am
-
Hi,
How can I show, in an ezblock, members of a specific group? Like for instance, the moderators...
Please advise.
-
After doing some coding with the help of guys from the SMF coding, here is the final code you can add to a php block to show, in my case, members of the id_group = 37 which is my supporters.
This ONLY works in SMF 2.0 with EZportal.
If this could be put in as a exblock, that would be awsome..
echo'<p><b>Here is a list of the Supporters of the site for 2009</b>:</p>';
echo '<p align="center">';
echo '<img src="/Themes/default/images/dollar.gif"><img src="/Themes/default/images/dollar.gif"><img src="/Themes/default/images/dollar.gif"><img src="/Themes/default/images/dollar.gif"><img src="/Themes/default/images/dollar.gif"><img src="/Themes/default/images/dollar.gif"></p><p align="center">';
global $db_prefix, $scripturl, $smcFunc;
$request = $smcFunc['db_query']('', '
SELECT id_member, real_name
FROM smf_members
WHERE id_group = 37
ORDER BY real_name',array());
while ($row = $smcFunc['db_fetch_assoc']($request))
echo ' <a href="'.$scripturl.'?action=profile;u='.$row['id_member'].'">'.$row['real_name'].'</a>,<br> ';
echo ' </P> ';
-
You can also do it as a php block with the SSI functions for ease of use:
echo '<center>';
ssi_fetchGroupMembers(37);
echo'</center>';
Although this code will put it in a list with alot more info like there tag lines, there avatars, and more...
That's why i used the above more flexible code and set it up only to show the members realname.
-
you also may need the bellow line at the top of the code if you have no other php block in that section...
this is a bug in ezportal i think...
require("/home/ottmoto/public_html/SSI.php");
-
How can I get this to work on SMF 1.1.10?
Thanks
-
After doing some coding with the help of guys from the SMF coding, here is the final code you can add to a php block to show, in my case, members of the id_group = 37 which is my supporters.
This ONLY works in SMF 2.0 with EZportal.
If this could be put in as a exblock, that would be awsome..
echo'<p><b>Here is a list of the Supporters of the site for 2009</b>:</p>';
echo '<p align="center">';
echo '<img src="/Themes/default/images/dollar.gif"><img src="/Themes/default/images/dollar.gif"><img src="/Themes/default/images/dollar.gif"><img src="/Themes/default/images/dollar.gif"><img src="/Themes/default/images/dollar.gif"><img src="/Themes/default/images/dollar.gif"></p><p align="center">';
global $db_prefix, $scripturl, $smcFunc;
$request = $smcFunc['db_query']('', '
SELECT id_member, real_name
FROM smf_members
WHERE id_group = 37
ORDER BY real_name',array());
while ($row = $smcFunc['db_fetch_assoc']($request))
echo ' <a href="'.$scripturl.'?action=profile;u='.$row['id_member'].'">'.$row['real_name'].'</a>,<br> ';
echo ' </P> ';
>_> I get this in the block:
Database Error
Table 'dsrpg_1.smf_members' doesn't exist
File: ... /rpgs/forum/Sources/Load.php(2184) : eval()'d code(1393) : eval()'d code
Line: 9
-
I was thinking about adding a Staff EzBlock to the next release if it would be of use to people.
-
I personally would find it very useful, especially if you could choose from any existing member group.
Setting up an RPG, so I'd love to be able to put on display, for example, the leading members of a selected area [eg, King & Queen of Kingdomland]. =)
-
Sorry for revive this topic, but this is very useful and i want to know if this was added to new version of ezportal or have ony other way to do it
(bad english :P)
-
good code
-
Thanks for this code. ;)
-
I was thinking about adding a Staff EzBlock to the next release if it would be of use to people.
Did this happen?
-
No it did not.