View Full Version : display the memberes of a certain usergroup as a vertical list one per line?
Jenkins
02-26-2007, 02:15 PM
I would like to be able to incorporate a list of users in a "right colum code" hack that i have on my board, is there a way to do this? I just need it to list one user per line as seen on my current board, except this list is done manually, i'd like to to autoupdate as the members in the usergroup change.
http://www.okgmp.com you can see the list on the right about middle way.
Kirk Y
02-26-2007, 06:14 PM
Try this; create a new plugin at forumhome_start with the following:
$query = $db->query_read("SELECT username,userid FROM user WHERE usergroupid = 'X'");
while($row = mysql_fetch_array($query))
{
eval('$usernames .= "' . fetch_template('forum_users_bit') . '";');
}
Note the Red X must be replaced with the UsergroupID of the Users you're trying to retrieve.
Then create a new template named "forum_users_bit" with the following:
<a href="member.php?u=$row[userid]">$row[username]</a>,
Then just place "$usernames" in your Forumhome template and you're off.
You can fiddle with it yourself if you're not trying to place it on the forumhome.
Jenkins
02-27-2007, 01:49 PM
looks simple enough, just one other question.
Okay seems to work fine in the forumhome, how can I make it work in the "RightColumn" template? do I need to move the HOOK to somewhere or something? sorry I'm not too good with coding.. :D
Kirk Y
02-27-2007, 07:43 PM
Where is your Right Column being placed? You'd probably be fine just changing the Hook's location from "forumhome_start" to "global_start". This'll make it available on the majority of templates.
Jenkins
02-28-2007, 04:52 PM
the right column has it's own template off of the root (i guess you could say) it's not a sub template in any other template. the varible for the right column code is in the forum home template. I'll try moving the hook location to global and see what happens.
thanks for the help!
***EDIT***
hmm.. still no workie I moved the hook location to global_start but still nothing in the right column. weird.
Jenkins
03-05-2007, 02:51 AM
anyone? surely someone knows how to do this?
all the code is working right I guess I just need to find the correct place to put my hook? I tried Global but it doesn't work.
dfinkle
08-30-2007, 07:26 AM
I'm in the same boat. :( Can anyone help?
Jenkins
03-31-2008, 04:35 PM
Anyone ever get this to work? Would still like to do this.
ResaleBroker
09-12-2008, 04:54 PM
I would like to the list members in a secondary usergroup. I've changed "usergroupid" to "membergroupids". With "usergroupid" all members of the primary usergroup (X) are displayed however with"membergroupids" only one (1) member of the secondary usergroup (X) is being displayed. Any ideas?
$query = $db->query_read("SELECT username,userid FROM user WHERE membergroupids = '51'");
while($row = mysql_fetch_array($query))
{
eval('$usernames .= "' . fetch_template('forum_users_bit') . '";');
}
DiSpy
05-13-2009, 12:22 AM
Hmm... did anyone ever figure this out? It seems to be working in the origional thread starters' page, but I can't get it working on mine.
EDIT: got it working, nevermind.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.