Module: Automatic HTTP Path
Posted by Maurice Makaay
All files from this thread
File Name | File Size | Posted by | Date | ||
---|---|---|---|---|---|
auto_http_path-1.0.9.zip | 4 KB | open | download | Maurice Makaay | 09/08/2015 | Read message |
auto_http_path.tar-1.0.9.gz | 3 KB | open | download | Maurice Makaay | 09/08/2015 | Read message |
auto_http_path.php | 5.1 KB | open | download | KatyWings | 02/26/2015 | Read message |
December 08, 2007 12:47PM |
Admin Registered: 20 years ago Posts: 8,532 |
This module automatically sets the HTTP Path configuration option, based on the active URL. This can be useful if for some reason you run one Phorum install under various host names and/or directories (e.g. a Phorum on a private space intranet server that is also accessible through a public URL or a server that has to be accessible on both an http:// and https:// URL).
Maurice Makaay
Phorum Development Team
my blog
linkedin profile
secret sauce
Edited 11 time(s). Last edit at 09/08/2015 08:49AM by Oliver Riesen.
Changelog: ---------- 2015/09/08 version 1.0.9 Oliver Riesen (oliver@riesen.org) - Strip query string from REQUEST_URI because slashes in the query string resulted in bad http_path. 2011-07-21 1.0.8 - Even more updates for the path detection in various environments. 2011-03-30 1.0.7 - Some more updates to make the path detection more robust. 2011-02-20 1.0.6 - An attempt to fix some strange issue where the http_path is broken (i.e. empty) for Phorum scripts that are run from cron. - Updates to the automatic HTTP path generation code, to accomodate for the use of path info in a URL (this makes this module work for URLs like [site.com]) 2008-07-30 1.0.5 - Added compatibility for the $PHORUM['template_http_path'] variable. That one needs some rewriting too, since it's based on the $PHORUM['http_path']. We do not change this variable if some other mod changed it already. In that case, the files might be coming from some CDN. 2008-01-22 1.0.4 - Fixed a problem with the stub CSS and JavaScript code that this module registers. Winzip did not unpack the zero byte css.tpl. I changed the code to let the module provide the stub code by means of a function instead. That should work in all cases. Thanks to Steve Healy for reporting this issue. 2008-01-19 1.0.3 - Fixed undefined index warning for the css register hook. - The http_path is not generated anymore for the admin interface. - Added a formatting fixup hook that will rewrite URLs in subjects and bodies that use the original http_path to the dynamic http_path. This is for example needed for the smileys module, which caches the URLs for the smiley images from the admin using the configured http_path. Thanks to Steve Healy for reporting these issues. 2008-01-18 1.0.2 - The module now makes Phorum use the correct URLs in cached CSS and JavaScript code. 2007-12-08 1.0.1 - Use common_pre hook instead of common. - Strip ending slash for the http_path. That is how Phorum expects it. 2007-11-30 1.0.0 - Initial release
Maurice Makaay
Phorum Development Team



Edited 11 time(s). Last edit at 09/08/2015 08:49AM by Oliver Riesen.
Re: Module: Automatic HTTP Path January 22, 2008 12:02PM |
Registered: 20 years ago Posts: 237 |
January 22, 2008 02:17PM |
Admin Registered: 20 years ago Posts: 8,532 |
Thank you too for your patience and problem reports!
I removed our previous conversation from this thread to make it less confusing and scary for newcomers =)
Maurice Makaay
Phorum Development Team
my blog
linkedin profile
secret sauce
I removed our previous conversation from this thread to make it less confusing and scary for newcomers =)
Maurice Makaay
Phorum Development Team



July 29, 2008 09:59PM |
Admin Registered: 20 years ago Posts: 8,532 |
I uploaded version 1.0.5 of the module. This version adds compatibility for the $PHORUM['template_http_path'] variable. That one needs some rewriting too, since it's based on the $PHORUM['http_path'].
Maurice Makaay
Phorum Development Team
my blog
linkedin profile
secret sauce
Maurice Makaay
Phorum Development Team



Re: Module: Automatic HTTP Path January 13, 2010 11:20AM |
Registered: 15 years ago Posts: 12 |
January 13, 2010 11:37AM |
Admin Registered: 20 years ago Posts: 8,532 |
The file looks complete to me. Check if you uploaded all the files from the package to the mods/auto_http_path folder on the server. The error could indicate a missing info.txt file.
Maurice Makaay
Phorum Development Team
my blog
linkedin profile
secret sauce
Maurice Makaay
Phorum Development Team



Re: Module: Automatic HTTP Path January 20, 2010 11:03AM |
Registered: 15 years ago Posts: 12 |
Re: Module: Automatic HTTP Path May 07, 2011 07:08PM |
Registered: 20 years ago Posts: 24 |
Thank you very much for this module, it's exactly what I was looking for. However, I needed to modify it a bit to make it work on my site and I thought I'd share my changes in case someone else is in a similar situation. On my site (http://www.mopedarmy.com/) I have links to all my forums listed in a drop down navigation on any page. This is generated by Phorum, based on the user's appropriate permissions, by calling the phorum_build_forum_list() method within the "/include/forum_function.php" file. I am using the external_authentication mod to integrate the Phorum login with my own login system.
The problem is that the Automatic HTTP Path module determines the directory for the forum based on the current URL. If I implement it as-is then then the path to the forums in my drop down nav is wrong on every section of the site except within the Phorum itself. To fix this, I made it use the path from the $PHORUM["http_path"] variable, which is set in the admin tools.
I changed the following code:
to
Thanks again for the excellent module. I am implementing a separate mobile domain and this helped me quickly solve my problem.
The problem is that the Automatic HTTP Path module determines the directory for the forum based on the current URL. If I implement it as-is then then the path to the forums in my drop down nav is wrong on every section of the site except within the Phorum itself. To fix this, I made it use the path from the $PHORUM["http_path"] variable, which is set in the admin tools.
I changed the following code:
Language: PHP
$uri = $_SERVER[';REQUEST_URI';]; { ';';, $uri ); }
to
Language: PHP$dir = parse_url($PHORUM["http_path"], PHP_URL_PATH);
Thanks again for the excellent module. I am implementing a separate mobile domain and this helped me quickly solve my problem.
May 08, 2011 04:46AM |
Admin Registered: 20 years ago Posts: 8,532 |
It's a bit of a chicken-egg thing here, since the module is trying to build the http_path, but you feed it with information from the existing http_path. I can think of some edge cases (not for your setup) where this could go wrong.
I'll have to think if I can make this module work automatically correctly for cases where the Phorum API is access from a page that is outside the Phorum tree.
Thanks for the comment!
Maurice Makaay
Phorum Development Team
my blog
linkedin profile
secret sauce
I'll have to think if I can make this module work automatically correctly for cases where the Phorum API is access from a page that is outside the Phorum tree.
Thanks for the comment!
Maurice Makaay
Phorum Development Team



Re: Module: Automatic HTTP Path February 26, 2015 03:09AM |
Registered: 10 years ago Posts: 2 |
Hey hey,
I really dont like to post into old threads but i have a small addition to this mod :)
The current mod version isn't compatible with the Search Friendly URL's mod: it breaks every css,js,img path. My addition fixes the issue, its sort of a workaround but it works.
I commented the addition with
Would be cool if you create a new build with this fix ;).
Greetings
KatyWings
Glarotech GmbH
I really dont like to post into old threads but i have a small addition to this mod :)
The current mod version isn't compatible with the Search Friendly URL's mod: it breaks every css,js,img path. My addition fixes the issue, its sort of a workaround but it works.
I commented the addition with
Language: PHP// PPS> Search Friendly Fix // <PPS
Would be cool if you create a new build with this fix ;).
Greetings
KatyWings
Glarotech GmbH
Sorry, only registered users may post in this forum.