Firefox PHP

Howto: Integrate Phorum and Wordpress

Posted by gloeglm 
Re: Howto: Integrate Phorum and Wordpress
August 15, 2006 02:31PM
thanks for the quick response maurice :) not sure what happened but i started from fresh template copies and now my error is gone :)

now when i'm logged into WP i'm not logged into phorum -- but is that because my WP account existed prior to wp-phorum? or is it supposed to work like, if i have an existing WP account is the plugin supposed to automatically create me in phorum? and if this is the case, how could i add all my existing users into phorum? i tried to add a phorum user (same name as wp name) via phpmyadmin but that didn't work

thanks again!
Re: Howto: Integrate Phorum and Wordpress
September 20, 2006 12:52AM
Quote
circuit
the problem i have is this:

users i create in the wordpress admin area are created in phorum.
users who register themselves via the wordpress register/login screens are not created in phorum.

Hey Circuit

Many apologies for not getting back to you on this sooner; forgot to check this post, and email troubles kept the subscription things from getting to me.

If you're using the most recent version of the plugin that I've compiled you should theoretically be good to go. Where in relation to your WordPress directory are the Phorum files, and what did you enter in the $phorum_dir variable in the phorum.php file? There might be issues with that, but it would be weird.

The stuff you quoted is old and shouldn't apply (assuming you've got the most recent version of the plugin, which I believe is attached to this topic, and is certainly available at this page).

Quote
circuit
second question: how would i add existing phorum users to a wordpress user database? is it as simple as exporting the users/password columns from the phorum DB table and importing back into the WP db table?

Good question. I didn't have to worry about this because I installed Phorum on a clean blog. The admin account should be fine if you set up Phorum to have the exact same name as the WordPress admin, but other than that I'm not sure of a good way to add people. I'll try and figure something out for the next incarnation of the bridge.

Beckism

One Crayon :: Beckism.com :: Tagamac
WordPress-Phorum Bridge
Re: Howto: Integrate Phorum and Wordpress
September 21, 2006 04:21AM
hi,

i got a problem of the cookie

i tried to print out the values of $_COOKIE

in wordpress page,it have a wordpress cookie in the $_COOKIE
Array ( [wordpressuser_a7f40a08e0b1c4ffa91359dac9fb2948] => wordpress [wordpresspass_a7f40a08e0b1c4ffa91359dac9fb2948] => becf2975c84f4db6a2d137a541de4ef3 [phorum_admin_session] => 1:c115e88315ce1af515c458d0bb1a3d76 [phorum_session_v5] => 8:8dd87f3e1ff21cd7e225cc2b7e5334d0 )

when i go ot phorum page, it have not wordpress cookie in the $_COOKIE

Array ( [dbx-postmeta] => grabit=0-,1-,2-,3-,4-,5-,6-&advancedstuff=0 ,1-,2 ,3-,4 ,5- [PHPSESSID] => 004a75f2517ab8979fecfbfc5e5b1993 [phorum_admin_session] => 1:c115e88315ce1af515c458d0bb1a3d76 )

according to the plugin of phorum(wplogin.php)
the function "get_userid" is going to get the wordpress cookie value to select the user id

but it have not wordpress's cookie in the $_COOKIE

$site_loc = grab_config_vars();
$cookiehash = md5($site_loc);
// Try to snag the cookie
$id = get_userid($_COOKIE['wordpressuser_' . $cookiehash]);<--it is a null value so that , it can't get the user_id in the phorum page

how can i solve it ?
my wordpress installed diretory is:
http:// 127.0.0.1:8080/wpdemo
my phorum installed diretory is:
http:// 127.0.0.1:8080/phorum


my HTTP Path is http:// 127.0.0.1:8080/phorum
WordPress address (URI) is http:// 127.0.0.1:8080/wpdemo
$wp_domain_name is http:// 127.0.0.1:8080/wpdemo

is it my setting wrong ? i can logined either space (wp or phorum),

thank you
Re: Howto: Integrate Phorum and Wordpress
September 21, 2006 05:13AM
Hey lochen,

You might need to have the Phorum install wrapped in the WordPress template in order to get access to the WordPress cookie. If you haven't edited your templates, this might well be the issue. Try opening header.tpl in the template you're using and add this at the very top:

<?php require('../wp-blog-header.php'); ?>

Of course, you'll need to make sure that the path navigates to the WordPress wp-blog-header.php, which should be installed in the WordPress base directory (so for you the path will likely be '../wpdemo/wp-blog-header.php').

If that doesn't work, this is the second possibility: if I remember correctly, the plugin assumes that your Phorum install is within your WordPress base install directory. If the wp-blog-header.php file doesn't fix things for you, it might be that unless the Phorum install is within the WordPress base directory, it won't have access to the WordPress cookie. I haven't tested this at all, and it's been a while since I worked directly with cookies in PHP, though, so I could be wrong. Only try moving the phorum directory once you've tried the first thing above, though, since if you move it you'll have to change a number of your variables in the files and options.

Let me know if neither of these things works, and I'll try to figure out what the heck is going wrong.

Beckism

One Crayon :: Beckism.com :: Tagamac
WordPress-Phorum Bridge
Re: Howto: Integrate Phorum and Wordpress
September 25, 2006 01:09AM
thank you for your help

but it still not work

i try to install phorum under wordpress base directory

http: //127.0.0.1/wordpress
http: //127.0.0.1/wordpress/phorum

it logined success on wordpress, it show that logined in the phorum(displayed the menu such as "My control Center", "Private Message" link), but when i going to phorum's "my control center" page
it display a login form to ask me login

The $_COOKIE array
Array ( [wordpressuser_f91327853cab97b2ac71765b7d7b303e] => wordpress [wordpresspass_f91327853cab97b2ac71765b7d7b303e] => becf2975c84f4db6a2d137a541de4ef3 [phorum_admin_session] => 1:638d226c5f2b39f18de67385ee46bd3c )

It seem lost the phorum cookie like this (it is using phorum to login and print out $_COOKIE)
Array ( [phorum_admin_session] => 1:638d226c5f2b39f18de67385ee46bd3c [phorum_session_v5] => 5:91da162c47af5abca794787ccf6fbd0f

i don't phorum how to keep the user logined, so i don't the problem of it

and then it got an other problem of phorum logined,

when i logined of wordpress, and in phorum click the "Log Out", it's not work, it can't log out, it need to using wordpress that logout to logout successful.

thank you,
Re: Howto: Integrate Phorum and Wordpress
September 25, 2006 01:24AM
Hey lochen,

Did you complete the instructions in the included ReadMe? It sounds like you might be encountering the cookie domain problem: WordPress automatically in most cases uses a domain like
http://domain.com
while Phorum defaults to
http://www.domain.com
If you haven't defined everything consistently as outlined in the ReadMe file, then you will be having the sort of odd login/out cookie things that you're encountering.

Also, I just want to verify that you are wrapping Phorum in the WordPress template.

Lastly, the Phorum login/out buttons will not work with this code; it assumes that you will only use WordPress to login or out. You will need to go through the Phorum template and remove all login/out links before you go public, which requires pretty extensive changes. I will be releasing a default template without login/out links as part of the next release of this code, but that's a little ways down the road.

Good luck!

Beckism

One Crayon :: Beckism.com :: Tagamac
WordPress-Phorum Bridge



Edited 1 time(s). Last edit at 09/25/2006 01:26AM by Beckism.
Re: Howto: Integrate Phorum and Wordpress
January 25, 2007 04:22AM
I've updated the WordPress-Phorum bridge and assigned it a global version of 1.3.

What's new:
- All settings are now handled within the admin sections of WordPress and Phorum (WP: Options->Phorum; Ph: Modules->Settings).

I strongly recommend that anyone using the bridge update to this version. All that you need to do to update is overwrite the old files with the new ones, and then go into the options in Phorum and WordPress and set the site URLs correctly. You will never have to worry about editing the source files after this release.

I'm shooting to have the example template for Phorum in my next release.

Let me know if you have any problems! As always, the latest file and info is also available at beckism.net/wordpress-phorum/.

Edit: uploaded a new version with a couple more parts of the code commented.

Beckism

One Crayon :: Beckism.com :: Tagamac
WordPress-Phorum Bridge



Edited 1 time(s). Last edit at 01/25/2007 04:35AM by Beckism.
Attachments:
open | download - wordpress-phorum.zip (5.2 KB)
Re: Howto: Integrate Phorum and Wordpress
May 28, 2007 09:48PM
i have a problem with the integration, it seems when i login in the wordpress, i automatically login to phorum, but when i want to start a new topic or go to My Control Center or Private Msg, it ask to login again. weird...and so, i login again, and when i logout from my wordpress, i didn't logout from the phorum..

it seem almost everyone got the same problem (from what i read on this thread).. i have check like thousand time the address like Beck said and the address i put is correct.

i really bump, dunt really know what to do.. any help would be great.
Re: Howto: Integrate Phorum and Wordpress
May 29, 2007 01:49AM
Hey Weko,

Sorry, I should have posted an update to this thread. For some reason, it looks like WordPress 2.1+ broke the WordPress-Phorum bridge. I'll hopefully be able to fix it in the near future, but just haven't gotten around to it yet (got swamped with stuff at the end of the school year, and immediately went abroad).

I've also been putting it off because I'd like the next release to have a template example included, and I've been waiting to be sure that the next version of Phorum didn't change the template system a lot. I'll try and get this done sooner rather than later, though, since there's obviously at least one other person out there using the bridge.

Beckism

One Crayon :: Beckism.com :: Tagamac
WordPress-Phorum Bridge
Re: Howto: Integrate Phorum and Wordpress
August 16, 2007 10:05AM
a very newbie (and probably stupid) question:

how do i best integrate the lastest version of phorum into the design of the latest version of wordpress with the search friendly urls module for phorum??

thanks,

norvo
Sorry, only registered users may post in this forum.

Click here to login