Firefox PHP

Redirection after Posting (Phorum Integration in Joomla via addphp)

Posted by pjotr 
All files from this thread

File Name File Size   Posted by Date  
smallthreadthumbs.png 18.1 KB open | download jogger 03/30/2010 Read message
joomla_phorum_search_plugin.zip 4.9 KB open | download jogger 04/05/2010 Read message
Redirection after Posting (Phorum Integration in Joomla via addphp)
October 23, 2009 07:00AM
Hi all,

I'm working on the Integration of Phorum into Joomla with the addphp plugin (http://www.run-digital.com/loesungen/open-source/addphp/25-addphp.html). The plugin allows to integrate Php-code in Joomla content items. I use the the plugin to integrate the Phorum portable code into a Joomla article. (I want to mention that I don't use the Joomla! 1.5 plugin for Phorum integration discussed elsewhere here in the forum because user integration is not the priority objective).

I've changed the custom_url- Function in the portable code to add and extract the necessary data from the joomla-type urls and hacked my joomla-template to transfer some Variables from the Phorum-Array into the Joomla Environment (e.g. HTML-Title, Head-Information links to css and javascripts)

Nearly everything seems to work now, only after posting the redirection to the initial forum does not work. Instead Phorum always shows the index page and the forum_id in the Phorum-Array is set to zero even though the posted article was added correctly to the relevant forum.

Any suggestions or help on this behaviour would be appreciated.

Kind regards
P.
Re: Redirection after Posting (Phorum Integration in Joomla via addphp)
October 27, 2009 03:50PM
I've found that the above described problem with the redirection after posting a new article is caused by the portable code.
The redirection works unless I use the portable code but I'm not sure how this happens. Perhaps some Variables are not set through the portable code? Can anyone (maybe from the developer team) describe how phorum is handling the redirection after a new post is added to the database ?

Thanks in advance
Re: Redirection after Posting (Phorum Integration in Joomla via addphp)
October 27, 2009 04:05PM
Redirection is handled from include/posting/action_post.php. Around line 382, the redirect URL is formatted using:

$redir_url = phorum_get_url(PHORUM_LIST_URL);

right after this, the redirection is done using phorum_redirect_by_url($redir_url). So for debugging the behavior, this would be a starting point. Check out what URL is generated there within your environment.


Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Re: Redirection after Posting (Phorum Integration in Joomla via addphp)
October 29, 2009 05:40PM
Hi Maurice,

thank you for the usefull information. The problem was caused by the function phorum_custom_get_url form the portable code that cuts off the http_host from the redirect_url.

Regards
P.
Re: Redirection after Posting (Phorum Integration in Joomla via addphp)
December 04, 2009 05:27PM
P,

I hit a similar roadblock in the spring, trying to embed phorum in Joomla using Jumi (another php-include component).

Like you, the sticky point seemed to be the URL processing.

Quote
P

thank you for the usefull information. The problem was caused by the function phorum_custom_get_url form the portable code that cuts off the http_host from the redirect_url.

Does that mean you found & fixed it?

If so, what did you change?

Either way, this thread has been useful for me - I need to get back to that roadblock myself, and this gives me some good ideas.

Sp

------------------------
Sean Phelan
Sites By Sequoia - Web Marketing ... The Experts at Building Your Success Online
Re: Redirection after Posting (Phorum Integration in Joomla via addphp)
December 04, 2009 05:36PM
For ideas, take a look at the embed_phorum module that I wrote for Phorum 5.1. That one is all about embedding Phorum into some other system. There are several hurdles in doing so (or in integrating any non-CMS-specific application into a CMS), but the module took care of all the issues.

Some code from that module would be simpler to implement in 5.2. In fact, I did so once and finished a nice new version of the mod, but then a Harddisk Accident Of Which We Do Not Speak occurred...


Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Re: Redirection after Posting (Phorum Integration in Joomla via addphp)
December 04, 2009 06:11PM
Quote
Maurice
Some code from that module would be simpler to implement in 5.2. In fact, I did so once and finished a nice new version of the mod, but then a Harddisk Accident Of Which We Do Not Speak occurred...

Ouch.... I know what that pain feels like.

------------------------
Sean Phelan
Sites By Sequoia - Web Marketing ... The Experts at Building Your Success Online
Re: Redirection after Posting (Phorum Integration in Joomla via addphp)
March 24, 2010 10:26AM
Hello!

I've found this topic about Joomla integration of Phorum (which seems to fit my needs best).

I'm trying to do the same for my Joomla installation (also with forum authentication done by Phorum itself because I am the only one writing new articles etc. on my site, so I don't need user synchronisation).

I'm a relative newbie to Phorum so I'm not sure the way I'm thinking is correct:

1.) I also use the Joomla addphp plugin and have created a content which calls the Phorum index.php

2.) I changed the header.tpl and footer.tpl in my template (a copy of the lightweight template) so the only the <div id="#forum"> container exists

3.) I put the css and script links in my Joomla template

Ok, for the main page of Phorum this all works fine - but of course when I click on a link in Phorum, there is no Joomla "frame" anymore because Phorum does not know of Joomla and will show me only itself.

My idea would be the following: I will have to catch all calls of files of Phorum, extract the informations (which file is called, parameters etc.) and redirect these to my Joomla template.
This could be done by mod_rewrite in the .htaccess: catch every call of the Phorum directory (which is "/forum" in my Joomla root directory) and put the called file name (e.g. "list.php") with it's GET parameters as new GET variables (may be "?phorumfile=list.php&phorumparams=XYZ" so I can work with them in my Joomla template.

My problem: I don't exactly know what kind of data I have to take care of (GET/POST parameters, which filenames).

Is the way I want to embed Phorum correct and possible?

I also found the "portable" folder but don't not know if and how to use it for my Joomla installation.
It would be great if someone could tell me something about it's use :-)

BTW: I tried so many forums but Phorum is by far that one with the best code base.
Re: Redirection after Posting (Phorum Integration in Joomla via addphp)
March 25, 2010 07:10AM
Jogger,

First question ... are you using phorum in "portable" mode or regular mode?

Sp

------------------------
Sean Phelan
Sites By Sequoia - Web Marketing ... The Experts at Building Your Success Online
Re: Redirection after Posting (Phorum Integration in Joomla via addphp)
March 25, 2010 11:45AM
Hmmm.

I'm sorry but what are these two modes doing?
Have I overlooked an option or their descriptions?

I'm new to Phorum but I think I use "regular" mode - since I installed it like it is said in the instructions and then only modified the (copied) template until now.

Any help would be wonderful :-}

Addendum:

Ok, I think I finally got the difference between the two ;-)
If I understand it right the code in the portable folder mainly is for creating an interface (by calling phorum.php) and giving the possibility to edit all links in Phorum to fit the needs of the environmental CMS etc.

So I changed my code:

I call the start page of Phorum in my Joomla by including and running a special file "forum.php":

Language: PHP
$et_aktuelles_verzeichnis = getcwd(); chdir (';./forum/portable';);   include_once (';phorum.php';);   chdir ($et_aktuelles_verzeichnis);

I now got the "start page" with forum links like this:
"host.de/joomla/forum/phorum.php?list,1"

So the rewriting of the phorum links in phorum_settings.php seems to work, but I am in the wrong directory - I would need something like this:
"host.de/joomla/forum/portable/phorum.php?list,1"

$PHORUM_DIR is set correctly with the path to ....joomla/forum (which is the folder containing all of myPhorum code).
Where is my fault?

But the most important question: Is this "link rewriting" (beside of including css and script files in the header) all I need to do to make Phorum work correctly?
Of course I have to catch all phorum.php-calls in my .htaccess and redirecting them to the Joomla template (which then has to call it with the given parameters) - but is this all?
Or in other words: Are all informations included in the GET parameters?

Chris



Edited 3 time(s). Last edit at 03/26/2010 03:29AM by jogger.
Sorry, only registered users may post in this forum.

Click here to login