Jim R Posted July 16, 2009 Share Posted July 16, 2009 I'm trying to have my WordPress site recognize my SMF user information, specifically what Membergroup they are in. I'm using SMF's SSI functions, but I'm not having much luck. The code I'm using determines which Membergroups can see content. From there it is to determine whether or not the User is a Guest, Registered or a Subscriber. It works perfectly on my own PHP pages, but I'm wanting to move over to WordPress for better functionality. I can kind of start from scratch, but I'd rather not. There are not any suitable bridges or converters that I have found to work. Here is the code: <?php $allowed_groups = array(1, 2, 9, 14); $can_see = FALSE; foreach ($allowed_groups as $allowed) { if (in_array($allowed, $user_info['groups'])) { $can_see = TRUE; break; } } //If allowed to see...show this. if ($can_see) { //Just stay right here and do nothing. } elseif ($can_see == FALSE && $context['user']['is_logged']) { //If you want to redirect the user to another place you can use the redirectexit() function. echo 'Registered but not subscribed.'; } else { //Just redirect since they are just a guest. echo 'Not registered.'; } ?> Here are the errors: Note, that I'm allowing four Membergroups access, and I'm getting four errors. I switched it to three Membergroups, and it produced three errors. Warning: in_array() [function.in-array]: Wrong datatype for second argument in /home/jwrbloom/public_html/wp/wp-content/plugins/php_execution/includes/class.php_execution.php(270) : eval()’d code on line 6 Warning: in_array() [function.in-array]: Wrong datatype for second argument in /home/jwrbloom/public_html/wp/wp-content/plugins/php_execution/includes/class.php_execution.php(270) : eval()’d code on line 6 Warning: in_array() [function.in-array]: Wrong datatype for second argument in /home/jwrbloom/public_html/wp/wp-content/plugins/php_execution/includes/class.php_execution.php(270) : eval()’d code on line 6 Warning: in_array() [function.in-array]: Wrong datatype for second argument in /home/jwrbloom/public_html/wp/wp-content/plugins/php_execution/includes/class.php_execution.php(270) : eval()’d code on line 6 Not registered. As you can see by the "Not registered" at the end, it just bypasses that the User is Registered or a Subscriber. Again, this works on my own PHP pages. Quote Link to comment https://forums.phpfreaks.com/topic/166190-merging-wordpress-and-smf-forumshaving-sessions-issues/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.