Firefox PHP

Can Phorum be dynamically integrated into an existing class-based site?

Posted by PleaseHelp 
Can Phorum be dynamically integrated into an existing class-based site?
November 25, 2011 01:34PM
Hello,

My site is based entirely around the index.php file which uses a class-system to dynamically load each page. This makes the site highly integrated, which means that a simple template for Phorum wouldn't really cut it.

Can the Phorum hook System or any other element of it be integrated dynamically into the site? What I mean by that is that I would need to integrate the Phorum with my existing index.php file which controls the entire site, so I'm looking for a forum that would allow me to essentially include all the elements that make up Phorum.

For example, within my index.php, I would add the forum page with hooks such as:

$hook->thread(1); //display first thread of Phorum
$hook->thread(2); //display second thread of Phorum
...
$hook->post(1,1) //display first post of first thread

In other words, where I can completely control which unique elements of Phorum are displayed so I can fully integrate it with my existing class-based site rather than have to have a separate file (other than the existing index.php) for Phorum. Editing the header.tpl and footer.tpl files would only be a superficial integration of Phorum within my site, and not a real integration with how the site currently functions and operates.

Is anything like this remotely possible with Phorum's integration system? If not, do you have any ideas of how I could achieve this type of high-level integration? Otherwise it seems that I'm stuck with hacking MiniBB into my existing code, which I prefer to avoid for obvious reasons.

Thanks!
Re: Can Phorum be dynamically integrated into an existing class-based site?
November 26, 2011 04:24AM
I'd say it depends on how much work you want to put into it.
Phorum is not available as a simple class if thats what you are looking for.


Thomas Seifert
Re: Can Phorum be dynamically integrated into an existing class-based site?
November 26, 2011 09:42AM
Quote
Thomas Seifert
I'd say it depends on how much work you want to put into it.
Phorum is not available as a simple class if thats what you are looking for.
So it's possible, but not inherent in the integration system, and would require hacking the script, thus making it difficult to upgrade in the future, is that correct?
Re: Can Phorum be dynamically integrated into an existing class-based site?
November 26, 2011 05:41PM
In Phorum 5.1, we created the embed_phorum module, which could be used for this kind of task. But next to the module itself, additional coding was still needed to get a full integration working. The reason for this is that Phorum is not just about producing some body content, but also about some <head> data that needs to go in the page and request routing that goes way beyond 'simple' (making it a requirement that a mapping is programmed between the main system's URL routing and the Phorum routing).

Definitely possible and even without hacking the core as we proved in 5.1, but not an easy job to get it fully working for any kind of master application integration.


Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Re: Can Phorum be dynamically integrated into an existing class-based site?
November 27, 2011 06:25AM
Quote
Maurice Makaay
In Phorum 5.1, we created the embed_phorum module, which could be used for this kind of task.

Thanks, this sounds interesting. Where can I find it?

Quote
Maurice Makaay
But next to the module itself, additional coding was still needed to get a full integration working.

Specifically, where was this additional coding needed?

Quote
Maurice Makaay
The reason for this is that Phorum is not just about producing some body content, but also about some <head> data that needs to go in the page and request routing that goes way beyond 'simple' (making it a requirement that a mapping is programmed between the main system's URL routing and the Phorum routing).

I am not sure I understand what you mean here, can you please clarify?

Quote
Maurice Makaay
Definitely possible and even without hacking the core as we proved in 5.1, but not an easy job to get it fully working for any kind of master application integration.

If it's indeed entirely possible, then I'm willing to do it as I need a forum on my site ASAP.

With regards to integration, is it also possible and relatively straightforward to change what the username in each post links to so instead of linking to the Phorum profile it would link to the main profile on my site?
Re: Can Phorum be dynamically integrated into an existing class-based site?
November 27, 2011 07:46AM
User integration is one of the things that the embed_phorum module took care of for 5.1. I'm not going to explain all the work that is needed to get things working for full integration. The sources probably speak for themselves.

The 5.1 embedding module can be found at:
[www.phorum.org]


Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Re: Can Phorum be dynamically integrated into an existing class-based site?
November 27, 2011 01:14PM
Quote
Maurice Makaay
User integration is one of the things that the embed_phorum module took care of for 5.1. I'm not going to explain all the work that is needed to get things working for full integration. The sources probably speak for themselves.

The 5.1 embedding module can be found at:
[www.phorum.org]

Is it also possible and relatively straightforward to change what the username in each post links to so instead of linking to the Phorum profile it would link to the main profile on my site?
Re: Can Phorum be dynamically integrated into an existing class-based site?
November 27, 2011 02:17PM
You always have the templates to work with, in which you can put alternative URLs directly. You could also override the URL generation code from a module to generate different URLs for the profile pages. That's one of the many things that the embed module took care of.


Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Re: Can Phorum be dynamically integrated into an existing class-based site?
November 27, 2011 05:06PM
Quote
Maurice Makaay
You always have the templates to work with, in which you can put alternative URLs directly. You could also override the URL generation code from a module to generate different URLs for the profile pages. That's one of the many things that the embed module took care of.

Great, thanks. My only concern is that the embed module is over 4 years old and in version 0.0.20. Is it still recommended for a live site or are there more suitable alternatives for what I'm looking for?
Re: Can Phorum be dynamically integrated into an existing class-based site?
November 27, 2011 05:30PM
I mentioned explicitly that it was for 5.1, not for 5.2. It is not compatible with 5.2. But maybe you can grab some ideas from it to implement a module that is only targeted at the profile URL modification that you require.


Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Sorry, only registered users may post in this forum.

Click here to login