PDA

View Full Version : usergroup in memberlist


StarBuG
01-08-2002, 01:30 PM
Hi!

How can I show the usergroup after the username in the memberlist??

I menaged to show the groupid but i want the name!

help plz

StarBuG

StarBuG
01-09-2002, 06:29 PM
No one can help ????

StarBuG

Admin
01-09-2002, 06:36 PM
Err I'm in a bit of a hurry, but try replacing this in memberlist.php:
$users=$DB_site->query("SELECT *
FROM user,userfield
WHERE $condition AND
with this:
$users=$DB_site->query("SELECT *
FROM user,userfield
LEFT JOIN usergroup ON usergroup.usergroupid=user.usergroupid
WHERE $condition AND
then try using $user[title] in the memberlistbit template.

Hope this works. :)

Tarion
01-09-2002, 08:32 PM
nope there where no output in the memberlist.

StarBuG
01-09-2002, 11:38 PM
I get this error:

Invalid SQL: SELECT *
FROM user,userfield
LEFT JOIN usergroup ON usergroup.usergroupid=user.usergroupid
WHERE 1=1 AND
user.userid = userfield.userid
AND usergroupid NOT IN (1,3,4)
ORDER BY username ASC
LIMIT 0,30
mysql error: Column: 'usergroupid' in where clause is ambiguous

mysql error number: 1052

Any suggestions?

Admin
01-10-2002, 09:39 AM
Replace this:
".iif($memberAllGood, " AND usergroupid NOT IN (1,3,4) ", "")."
ORDER BY $orderby $direction
with:
".iif($memberAllGood, " AND user.usergroupid NOT IN (1,3,4) ", "")."
ORDER BY $orderby $direction

Tarion
01-10-2002, 09:50 AM
Firefly, in memberlistbit Template don't add $user[title], add this $unserinfo[title] and it will work.

THX for your help

StarBuG
01-10-2002, 05:51 PM
Originally posted by Tarion
Firefly, in memberlistbit Template don't add $user[title], add this $unserinfo[title] and it will work.

THX for your help

You made a Typo $userinfo[title] not unserinfo[titel] but that was the solution!!

THX to both of u for your help!!!

Greetings

StarBuG

Tarion
01-10-2002, 06:10 PM
sorry litte false, but i think everyone can understand this :) now

THX for the corretion

5861king
01-14-2002, 10:15 PM
is there away of displaying the usergroup text in the postbit template, if so what will i need to do!!!!!

squawell
01-15-2002, 02:22 AM
i got the same error

Invalid SQL: SELECT *
FROM user,userfield
LEFT JOIN usergroup ON usergroup.usergroupid=user.usergroupid
WHERE 8=8 AND
user.userid = userfield.userid
AND usergroupid NOT IN (1,3,4)
ORDER BY username ASC
LIMIT 0,30
mysql error: Column: 'usergroupid' in where clause is ambiguous

and i already replace the code with FireFly's post

any idea??

Admin
01-15-2002, 12:18 PM
Originally posted by squawell
and i already replace the code with FireFly's post
No, you didn't.

squawell
01-16-2002, 03:57 AM
Originally posted by FireFly

No, you didn't.
yes i'm sure!!

see my code

$users=$DB_site->query("SELECT *
FROM user,userfield
LEFT JOIN usergroup ON usergroup.usergroupid=user.usergroupid
WHERE $condition AND
user.userid = userfield.userid
".iif($memberAllGood, " AND user.usergroupid NOT IN (1,3,4) ", "")."
ORDER BY $orderby $direction
LIMIT ".($limitlower-1).",$perpage");


it should be like this isn't it??

but it still cann't work~~

Admin
01-16-2002, 02:21 PM
Then you didn't upload the file, because that query you pasted is not with the fix.

ElecEagle
03-13-2002, 01:47 AM
Sorry to bother, but I have one quick question:

I have added this 'hack', but could someone please post what I would need to change in it to use the "user status" field for the group, rather than the group name? It's probably pretty easy ...I just don't know off hand what it would be. ...

sgeiger
09-03-2004, 12:38 PM
Chen,

How could I change this query to only show members of a usergroup when one clicks on memberlist.

I want no outside groups to see the members of other user groups.

Group A to see only group A members in memberlist....
and
Group B to only see group B members in member list....




Err I'm in a bit of a hurry, but try replacing this in memberlist.php:
$users=$DB_site->query("SELECT *
FROM user,userfield
WHERE $condition AND
with this:
$users=$DB_site->query("SELECT *
FROM user,userfield
LEFT JOIN usergroup ON usergroup.usergroupid=user.usergroupid
WHERE $condition AND
then try using $user[title] in the memberlistbit template.

Hope this works. :)