Skip to content

Commit

Permalink
Merge pull request #1 from Summeli/master
Browse files Browse the repository at this point in the history
Added $smf_user_info['smf_groups'] so you can check the SMF user groups in wp-side
  • Loading branch information
jwall149 committed Jan 25, 2013
2 parents 97ab7a0 + 5da5898 commit 0bdf543
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 4 additions & 0 deletions README.md
Expand Up @@ -11,3 +11,7 @@ Feel free to edit and ask for a pull request.
Plugin website: http://wordpress.org/extend/plugins/smf2wp/

Tonny

Notes
-----
You can use global variable $smf_user_info['smf_groups'] to see which groups the users belongs on the SMF side
5 changes: 3 additions & 2 deletions smf2api.php
Expand Up @@ -197,8 +197,9 @@ function smf_authenticateUser()
$ID_MEMBER = 0;
mysql_free_result($request);
}


// The smf_groups can be used to check which user-groups the user belongs on the SMF side
// it's very handy if you want to hide some information from wp-template etc.
$smf_user_info['smf_groups'] = array_merge(array($smf_user_info['id_group'], $smf_user_info['id_post_group']), explode(',', $smf_user_info['additional_groups']));
/* if (empty($ID_MEMBER))
$smf_user_info = array('groups' => array(-1));
else
Expand Down

0 comments on commit 0bdf543

Please sign in to comment.