Hey everyone,
would it be possible to have things such as a login field and user icon/name displayed outside of a Vanilla installation?
I'm using Wordpress 2.5 and got the Jasmine plugin working with the comments (comment link on WP blog post leads to an automatically created forum post) and I see no reason to merge WP with Vanilla anymore, if only people could login into Vanilla from the WP end too.
Thanks!
Comments
Out of curiosity, why are you dropping the integration between WP and Vanilla?
library/People/People.Class.Authenticator.php, GetIdentity() on line 107.
Gets the user ID from the session or from cookies.
library/People/People.Class.UserManager.php, GetSessionDataById() on line 527.
Given a user ID, gets user properties from the database.
The really fast and nasty way to do it would be some PHP code like this:
<?php
ini_set('include_path', ini_get('include_path') . PATH_SEPARATOR . $path_to_vanilla);
include('appg/settings.php');
$Configuration['SELF_URL'] = 'norender';
include('appg/init_vanilla.php');
echo $Context->Session->User->Name;
?>
But that would pull a lot of Vanilla code into every load of your Wordpress page, which probably isn't what you want.
Warning: main(http://www.thatblognetwork.com/tvgbtest/forums/appg/settings.php) [function.main]: failed to open stream: HTTP request failed! HTTP/1.1 403 Forbidden in /home/wohoo/public_html/tvgbtest/wp-content/themes/default/sidebar.php on line 133
Warning: main(http://www.thatblognetwork.com/tvgbtest/forums/appg/settings.php) [function.main]: failed to open stream: HTTP request failed! HTTP/1.1 403 Forbidden in /home/wohoo/public_html/tvgbtest/wp-content/themes/default/sidebar.php on line 133
Warning: main() [function.include]: Failed opening 'http://www.thatblognetwork.com/tvgbtest/forums/appg/settings.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php:') in /home/wohoo/public_html/tvgbtest/wp-content/themes/default/sidebar.php on line 133
Warning: main(http://www.thatblognetwork.com/tvgbtest/forums/appg/init_vanilla.php) [function.main]: failed to open stream: HTTP request failed! HTTP/1.1 403 Forbidden in /home/wohoo/public_html/tvgbtest/wp-content/themes/default/sidebar.php on line 135
Warning: main(http://www.thatblognetwork.com/tvgbtest/forums/appg/init_vanilla.php) [function.main]: failed to open stream: HTTP request failed! HTTP/1.1 403 Forbidden in /home/wohoo/public_html/tvgbtest/wp-content/themes/default/sidebar.php on line 135
Warning: main() [function.include]: Failed opening 'http://www.thatblognetwork.com/tvgbtest/forums/appg/init_vanilla.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php:') in /home/wohoo/public_html/tvgbtest/wp-content/themes/default/sidebar.php on line 135
But it still probably wouldn't work because I'm guessing WP renders the sidebar from inside a function and class declarations aren't valid inside a function.
If you didn't understand that last sentence, then this is not a path you want to go down.
Honestly I think the WP integration is a better bet for you. When you don't understand the code it's always better to go with a proven solution rather than a customized one.
<?php
ini_set('include_path', ini_get('include_path') . PATH_SEPARATOR . /home/wohoo/public_html/forums);
include('appg/settings.php');
$Configuration['SELF_URL'] = 'norender';
include('appg/init_vanilla.php');
echo $Context->Session->User->Name;
?>
If so, then this is what I'm getting now:
Parse error: syntax error, unexpected '/' in /home/wohoo/public_html/tvgbtest/wp-content/themes/default/sidebar.php on line 132If I insert it without the "/", like this:
<?php
ini_set('include_path', ini_get('include_path') . PATH_SEPARATOR . home/wohoo/public_html/forums);
include('appg/settings.php');
$Configuration['SELF_URL'] = 'norender';
include('appg/init_vanilla.php');
echo $Context->Session->User->Name;
?>
then I get these errors:
Warning: Division by zero in /home/wohoo/public_html/tvgbtest/wp-content/themes/default/sidebar.php on line 129
Warning: Division by zero in /home/wohoo/public_html/tvgbtest/wp-content/themes/default/sidebar.php on line 129
Warning: Division by zero in /home/wohoo/public_html/tvgbtest/wp-content/themes/default/sidebar.php on line 129
Warning: main(appg/settings.php) [function.main]: failed to open stream: No such file or directory in /home/wohoo/public_html/tvgbtest/wp-content/themes/default/sidebar.php on line 130
Warning: main(appg/settings.php) [function.main]: failed to open stream: No such file or directory in /home/wohoo/public_html/tvgbtest/wp-content/themes/default/sidebar.php on line 130
Warning: main(appg/settings.php) [function.main]: failed to open stream: No such file or directory in /home/wohoo/public_html/tvgbtest/wp-content/themes/default/sidebar.php on line 130
Warning: main() [function.include]: Failed opening 'appg/settings.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php:') in /home/wohoo/public_html/tvgbtest/wp-content/themes/default/sidebar.php on line 130
Warning: main(appg/init_vanilla.php) [function.main]: failed to open stream: No such file or directory in /home/wohoo/public_html/tvgbtest/wp-content/themes/default/sidebar.php on line 132
Warning: main(appg/init_vanilla.php) [function.main]: failed to open stream: No such file or directory in /home/wohoo/public_html/tvgbtest/wp-content/themes/default/sidebar.php on line 132
Warning: main(appg/init_vanilla.php) [function.main]: failed to open stream: No such file or directory in /home/wohoo/public_html/tvgbtest/wp-content/themes/default/sidebar.php on line 132
Warning: main() [function.include]: Failed opening 'appg/init_vanilla.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php:') in /home/wohoo/public_html/tvgbtest/wp-content/themes/default/sidebar.php on line 132
The reason I'm staying away from integration is so whenever something goes wrong, I can just disable a plugin or quickly remove the code from the WP end. But if it's all integrated, then doing that would be much more difficult. No?
http://lussumo.com/community/discussion/7278/