Permalink
Browse files

Merge pull request #1 from Summeli/master

Added $smf_user_info['smf_groups'] so you can check the SMF user groups in wp-side
  • Loading branch information...
2 parents 97ab7a0 + 5da5898 commit 0bdf543c8ed175537d6ab5902bf77dbec081d586 @jwall149 committed Jan 25, 2013
Showing with 7 additions and 2 deletions.
  1. +4 −0 README.md
  2. +3 −2 smf2api.php
View
@@ -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
View
@@ -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

0 comments on commit 0bdf543

Please sign in to comment.