SMF and WordPress, a simple request... vbg

Started by Jim R, July 02, 2009, 08:05:54 AM

Previous topic - Next topic

Jim R

Lots of materials found in search, but there are no real answers for bridging WordPress 2.8 and SMF 2.0+.  Using SMF log in/log out via SSI, whatever, I want it so when a user is logged into my SMF, they are also logged in and recognized in my WP with their SMF ID.

I don't know enough to get started or which hook to look at.  I don't know how to apply the hooks.  Right now I have my own PHP page, which utilizes SSI, but I'm wanting to use WP now, keeping SMF with its membergroups, paypal integration, etc.



KensonPlays

I'm having same issue, and I want to do this too...

Owner of Mesozoic Haven

Aleksi "Lex" Kilpinen

Hi Jim R, any updates on this? Have you found anything to do what you are after? :)
Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

How you can help SMF

Jim R

I have not found a complete solution.  I'm not entirely sure I've figured out the issue of WordPress even acknowledging I'm logged into SMF via SSI.  However, worse are the errors I get in dealing with arrays. 

Quote
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


Here is the code in question:


<?php
 $allowed_groups 
= array(12914);
$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.';

    

}
?>


H

Do you still require help with this?
Is $user_info['groups'] definitely populated with the group information? Perhaps it needs to be global'ed
-H
Former Support Team Lead
                              I recommend:
Namecheap (domains)
Fastmail (e-mail)
Linode (VPS)
                             

Jim R

Quote from: H on July 31, 2009, 08:48:04 AM
Do you still require help with this?
Is $user_info['groups'] definitely populated with the group information? Perhaps it needs to be global'ed

I still do need help with this.  I'm wondering if it's an array issue, since having three Membergroups in the array produces three errors, while four Membergroups produces four. 

H

Which array do you mean? If there are four groups in $allowed_groups then the for loop would be executed four times which is why four errors would appear
-H
Former Support Team Lead
                              I recommend:
Namecheap (domains)
Fastmail (e-mail)
Linode (VPS)
                             

Jim R

Quote from: H on July 31, 2009, 04:59:58 PM
Which array do you mean? If there are four groups in $allowed_groups then the for loop would be executed four times which is why four errors would appear

I figured that is why I think it's an issue with arrays.

H

Did you check the contents of $user_info['groups'] to check it is holding the correct groups? :)
-H
Former Support Team Lead
                              I recommend:
Namecheap (domains)
Fastmail (e-mail)
Linode (VPS)
                             

Jim R

It's the same code I'm using elsewhere on normal PHP pages.

H

I'm guessing your other PHP pages aren't wrapped in wordpress in the same way though? The error implies that it can only be coming from one of two variables. If you don't check them and atleast eliminate them as the source of the problem it makes it very difficult for us to help you.
-H
Former Support Team Lead
                              I recommend:
Namecheap (domains)
Fastmail (e-mail)
Linode (VPS)
                             

Jim R

I guess I don't know enough of how to test them.  I just know it's code that works elsewhere, but you're right, those aren't pages within WordPress.

H

print_r($user_info['groups']);

That code will print the entire array. Should be fine just to put it before the for() line
-H
Former Support Team Lead
                              I recommend:
Namecheap (domains)
Fastmail (e-mail)
Linode (VPS)
                             

Advertisement: