- Moderated by:
- Support
-
- rank:
-
Professional
- registered:
- April 2004
- Status:
- offline
- last visit:
- 21.01.08
- Posts:
- 2723
I'm using pnUserGetVars(pnSessionGetVar('uid')); and it's returning a good deal of info, but not the user's group id number...?
Any idea'rs ....?
:)
--
Photography | PHP | Other -
- rank:
-
Steering Committee
- registered:
- August 2002
- Status:
- offline
- last visit:
- 03.03.08
- Posts:
- 1221
If pn0.760, Groups API function "getusergroups" might help...
If not 0.760... then, it is the old way. :wink:
--
Chestnut !
Support via Private message won't be answered...
http://dev.pnconcept.com
http://www.postnuke-france.org -
- rank:
-
Professional
- registered:
- April 2004
- Status:
- offline
- last visit:
- 21.01.08
- Posts:
- 2723
-
- rank:
-
Steering Committee
- registered:
- December 2002
- Status:
- offline
- last visit:
- 28.11.08
- Posts:
- 13417
-
- rank:
-
Steering Committee
- registered:
- August 2002
- Status:
- offline
- last visit:
- 03.03.08
- Posts:
- 1221
Well... you know... the good old SQL...
Code
$uid = pnUserGetVar('uid');
$dbconn =& pnDBGetConn(true);
$pntable =& pnDBGetTables()
$tbl = &$pntable['group_membership'];
$col = &$pntable['group_membership_column'];
$sql = "SELECT $col[gid]
FROM $tbl
WHERE $col[uid] = '".pnVarPrepForStore($uid)."'";
$result =& $dbconn->Execute($sql);
// We are looping in the rows because a user can be a member of many groups.
for (; !$result->EOF; $result->MoveNext()) {
list($gid) = $result->fields;
echo $gid.'<br />';
}
$result->Close();
--
Chestnut !
Support via Private message won't be answered...
http://dev.pnconcept.com
http://www.postnuke-france.org -
- rank:
-
Professional
- registered:
- April 2004
- Status:
- offline
- last visit:
- 21.01.08
- Posts:
- 2723
-
- rank:
-
Steering Committee
- registered:
- August 2002
- Status:
- offline
- last visit:
- 03.03.08
- Posts:
- 1221
Well... you could always shout at your screen : "GIMME GROUP ID...".......
But very few of us has the brain damaged enough to hear an answer.
:wink:
--
Chestnut !
Support via Private message won't be answered...
http://dev.pnconcept.com
http://www.postnuke-france.org
