Customizing SMF > SMF Coding Discussion

Help with the ssi_login in my web

(1/3) > >>

vito88:
Hi friends!

Ssi functions are used to export our SMF Forum outside the Forum itself, for example to wordpress. There are many features you can export. I have done a block of recent post with comments of my Forum in the index of my wordpress blog: vidaemigrante.com (down at all) and also a message indicating who was the last user to register in the Forum. This work perfectly

The problem has been using the function ssi_login () which displays the entry box. Use:
<? php ssi_login ();? >
It displays well, but when you put user and password, it redirects to the Forum and keep logged but only in the forum, not in the index of my wordpress. When you return to the blog, the login box is empty again, as if you were not logged. Reading in forums and posts here and by reviewing the faq of the ssi_login i see that maybe changing the configuration of the server, removing local cookies and "Use database-driven sessions", but the problem continues and I've tried all of these options. I've also tried with redirections:


--- Code: ---if ($context['user']['is_guest']) {
echo '<div id="loggedOutDiv">';
$_SESSION['login_url'] = 'http://neweragaming.org' . $_SERVER['PHP_SELF'];
ssi_login();
echo '</div>';
}
else {
echo '
<div id="loggedIn">
Welcome, ' . $context['user']['name'] . '
<br />
';
$_SESSION['logout_url'] = 'http://neweragaming.org' . $_SERVER['PHP_SELF'];
ssi_logout();
echo '
</div>
';
}
--- End code ---

And including the ssi_welcome that shows the typical message "Hi pepe, you have 234 messages", but it doesnt matter if you're logged or not, in the login box ssi always appears empty, but then if you are logged in the Forum you are still logged, but not in the blog where I use the ssi_login.

I use smf 2.0.2, someone can help me? thanks!

vito88:
nobody can help??  :(

Arantor:
URL to WP, URL to forum?

vito88:

--- Quote from: Arantor on July 30, 2012, 10:29:05 PM ---URL to WP, URL to forum?

--- End quote ---

vidaemigrante.com
vidaemigrante.com/foro/

Arantor:
Admin > Configuration > Server Settings > Cookies and Sessions > tick Use subdomain independent cookies

Then log out, log back in.

The path of cookies is normally restricted to the path SMF is in, i.e. /foro/ on that domain. Using the above option will expand cookies out to the entire domain.

Mind you, SSI stuff rarely works out that well with WP simply because SMF takes extra measures to secure sessions, that WP does not take. It mostly depends on exactly where you put SSI.php into the page.

Navigation

[0] Message Index

[#] Next page

Go to full version