Simple, up-to-date, working solution to integrate Phorum into a website
Posted by JMF
|
Simple, up-to-date, working solution to integrate Phorum into a website February 23, 2007 09:26AM |
Registered: 18 years ago Posts: 4 |
Hello,
I have tried for several days to integrate Phorum into a website and despite the reading of a lot of topics here, I still can not make it work.
I need to have the same design as on the website and the users informations synchronized. Sounds pretty simple need, isn't it?
I tried the embed module, the userinterface and many other ways. Every time something goes wrong and I can not figure out why.
Is there a simple, up-to-date and working solution to do so?
Thanks.
I have tried for several days to integrate Phorum into a website and despite the reading of a lot of topics here, I still can not make it work.
I need to have the same design as on the website and the users informations synchronized. Sounds pretty simple need, isn't it?
I tried the embed module, the userinterface and many other ways. Every time something goes wrong and I can not figure out why.
Is there a simple, up-to-date and working solution to do so?
Thanks.
|
February 23, 2007 09:34AM |
Admin Registered: 21 years ago Posts: 8,532 |
Yes. The embed module sounds like the solution that you need. It's fully up to date and I am running it on my own site to get Phorum running embedded there. Maybe it would help if you explained what problems you are running into.
Maurice Makaay
Phorum Development Team
my blog
linkedin profile
secret sauce
Maurice Makaay
Phorum Development Team
my blog
linkedin profile
secret sauce
|
Re: Simple, up-to-date, working solution to integrate Phorum into a website February 23, 2007 10:05AM |
Registered: 18 years ago Posts: 4 |
I installed the module, created a connector (in fact just a copy of the gitaar.ner one for now), created a file based on the example_page_script.php page, moved the embed_phorum template directory to the templates directory and selected this template for both the general settings and the test forum.
When I run my test page I got this error message :
"embed_phorum module error: page element "style" is missing in the templates. Did you select the correct template for this forum? The output that we did get is the following: [HTML CODE]"
What do I do wrong ?
When I run my test page I got this error message :
"embed_phorum module error: page element "style" is missing in the templates. Did you select the correct template for this forum? The output that we did get is the following: [HTML CODE]"
What do I do wrong ?
|
February 23, 2007 10:18AM |
Admin Registered: 21 years ago Posts: 8,532 |
Do you have the get_template method defined in the connector? And does that pass on the "gitaar.net" template by any chance? In that case, this might happen. Phorum will try to find the gitaar.net template, but can't locate it. Then it will fallback to the default template, which isn't compatible with the embedding module.
If you let the get_template() method return your own template name, then you wouldn't even have to change the template settings in your admin interface.
Maurice Makaay
Phorum Development Team
my blog
linkedin profile
secret sauce
Edited 1 time(s). Last edit at 02/23/2007 10:20AM by mmakaay.
If you let the get_template() method return your own template name, then you wouldn't even have to change the template settings in your admin interface.
Maurice Makaay
Phorum Development Team
my blog
linkedin profile
secret sauceEdited 1 time(s). Last edit at 02/23/2007 10:20AM by mmakaay.
|
Re: Simple, up-to-date, working solution to integrate Phorum into a website February 23, 2007 10:25AM |
Registered: 18 years ago Posts: 4 |
I changed the return value to the name of my template (a verbatim copy of embed_phorum) and now I have the following error :
Fatal error: Call to a member function set_title() on a non-object in /var/www/mysite/code/www/forum/mods/embed_phorum/connectors/mysite/connector.php on line 65
A var_dump($SITE_FRAME) indicate that is variable is NULL.
A search indicates that the only files that contains this variable are your original gitaar.net connector and my copy. These files seems to only use it. It is not set anywhere I could find.
Edited 1 time(s). Last edit at 02/23/2007 10:28AM by JMF.
Fatal error: Call to a member function set_title() on a non-object in /var/www/mysite/code/www/forum/mods/embed_phorum/connectors/mysite/connector.php on line 65
A var_dump($SITE_FRAME) indicate that is variable is NULL.
A search indicates that the only files that contains this variable are your original gitaar.net connector and my copy. These files seems to only use it. It is not set anywhere I could find.
Edited 1 time(s). Last edit at 02/23/2007 10:28AM by JMF.
|
February 23, 2007 02:35PM |
Admin Registered: 21 years ago Posts: 8,532 |
There's a reason why each site integration uses its own run script and connector class. That is because each site will handle things differently.
On my site, the central variable in which I store data during the request is $SITE_FRAME. That's why you'll only find that variable in my connector code. It doesn't have anything to do with the embed module.
In process_page_elements(), I use my skin object $SITE_FRAME["SKIN"] object to store parts of the website in my $SITE_FRAME data fields. Once the connector has filled $SITE_FRAME variables, the run script will regain control back from the connector and call the header, body and footer functions from my site's software. My site's software knows about the fields that are set in $SITE_FRAME and will put them in the right spots (the header call will use the "head_head" data for example and the body call will display the "body" data).
This may sound a bit complicated, but we need to do it this way. We cannot simply provide a body which can be dumped inside your site's header and footer. That is, because Phorum also has to be able add data to your page <head> section too (for example rss links, stylesheets, meta redirects, etc.).
The simplest thing that you could do is copy the argument for the process_page_elements to a global variable, which you can use afterwards in the run script to print out the data at the right places.
Also, do a print_var($elements) in the process_page_elements() function. That will give you an idea of all the available page elements that are passed to this function. That might help in deciding how you should implement this method for your site.
Also take a look at the Mambo connector. That one has a bit different strategy. The run script is called from Mambo. Mambo expects a component to print out the data for the body directly. A component still has a chance to set header data however. The run script doesn't need to call anything after the run_phorum.php script. Instead, the process_page_elements method will print out the body code and use some calls to the $mainframe to set head data.
What the right strategy would be for you, is up to the way in which your site is implemented.
Maurice Makaay
Phorum Development Team
my blog
linkedin profile
secret sauce
On my site, the central variable in which I store data during the request is $SITE_FRAME. That's why you'll only find that variable in my connector code. It doesn't have anything to do with the embed module.
In process_page_elements(), I use my skin object $SITE_FRAME["SKIN"] object to store parts of the website in my $SITE_FRAME data fields. Once the connector has filled $SITE_FRAME variables, the run script will regain control back from the connector and call the header, body and footer functions from my site's software. My site's software knows about the fields that are set in $SITE_FRAME and will put them in the right spots (the header call will use the "head_head" data for example and the body call will display the "body" data).
This may sound a bit complicated, but we need to do it this way. We cannot simply provide a body which can be dumped inside your site's header and footer. That is, because Phorum also has to be able add data to your page <head> section too (for example rss links, stylesheets, meta redirects, etc.).
The simplest thing that you could do is copy the argument for the process_page_elements to a global variable, which you can use afterwards in the run script to print out the data at the right places.
Also, do a print_var($elements) in the process_page_elements() function. That will give you an idea of all the available page elements that are passed to this function. That might help in deciding how you should implement this method for your site.
Also take a look at the Mambo connector. That one has a bit different strategy. The run script is called from Mambo. Mambo expects a component to print out the data for the body directly. A component still has a chance to set header data however. The run script doesn't need to call anything after the run_phorum.php script. Instead, the process_page_elements method will print out the body code and use some calls to the $mainframe to set head data.
What the right strategy would be for you, is up to the way in which your site is implemented.
Maurice Makaay
Phorum Development Team
my blog
linkedin profile
secret sauce
|
Re: Simple, up-to-date, working solution to integrate Phorum into a website February 24, 2007 10:57AM |
Registered: 18 years ago Posts: 4 |
|
February 24, 2007 05:28PM |
Admin Registered: 21 years ago Posts: 8,532 |
Nice! You just happened to hit the module in a pretty much undocumented state. :-)
If you want to send me your implementation connector and run script, then I could add those to the distro as an extra example. Maybe that will help others in the future.
Maurice Makaay
Phorum Development Team
my blog
linkedin profile
secret sauce
If you want to send me your implementation connector and run script, then I could add those to the distro as an extra example. Maybe that will help others in the future.
Maurice Makaay
Phorum Development Team
my blog
linkedin profile
secret sauce
Sorry, only registered users may post in this forum.