News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Return Group ID

Started by IceXaos, September 11, 2010, 10:47:39 AM

Previous topic - Next topic

IceXaos

How would I return the group ID, such as 1 (Admins), and so on?

gbsothere

#1
Quote from: IceXaos on September 11, 2010, 10:47:39 AM
How would I return the group ID, such as 1 (Admins), and so on?


Return?  (I'm always slightly confused.)   :)

Log into phpMyAdmin and browse the smf_membergroups table.  You can see where the ID groups are.  If something's gone wrong and you need to edit, you should be able to simply reassign the ID group number there.


EDIT:   I'd back up that table, though, by exporting it, before I edited it.
My apologies, but I am taking a break from accepting PM requests for support.  If I am not currently assisting you, please do not ask as long as this notice is posted.  Thank you.

I Don't Want To Grow Old Alone


It has been proven that Steely Dan reduces the occurrence of road rage, according to an independent study.



A reminder about admin / ftp passwords etc.

IceXaos

I mean returning the value, such as if you return the username:
$user_info['username']

Is there a simple way to return the group ID?

Kays

$user_info['groups'] returns an array of member groups. $user_settings['id_group'], returns the user's primary member group (I think).

If at first you don't succeed, use a bigger hammer. If that fails, read the manual.
My Mods

IceXaos

Thanks very much, exactly what I needed.

Kays

Cool, :)

Do yourself a favour and learn to look. Create a test page and include SSI.php as well as the following code.


echo '<pre>', print_r($GLOBALS), '</pre>';


If you run that page, it will give you a huge array of all the variables available for a basic load of SMF. Copy that to a .txt document and use that to check for what variables are available. I keep two, one for each version SMF. Where do you think I got my reply from. :)

If at first you don't succeed, use a bigger hammer. If that fails, read the manual.
My Mods

IceXaos

Quote from: Kays on September 11, 2010, 12:58:28 PM
Cool, :)

Do yourself a favour and learn to look. Create a test page and include SSI.php as well as the following code.


echo '<pre>', print_r($GLOBALS), '</pre>';


If you run that page, it will give you a huge array of all the variables available for a basic load of SMF. Copy that to a .txt document and use that to check for what variables are available. I keep two, one for each version SMF. Where do you think I got my reply from. :)
That's a good, commonsense idea, thanks!

Advertisement: