Firefox PHP

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
Module: Automatic HTTP Path
December 08, 2007 06:47PM
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).

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
my blog linkedin profile secret sauce



Edited 11 time(s). Last edit at 09/08/2015 02:49PM by Oliver Riesen.
Attachments:
open | download - auto_http_path-1.0.9.zip (4 KB)
open | download - auto_http_path.tar-1.0.9.gz (3 KB)
Re: Module: Automatic HTTP Path
January 22, 2008 06:02PM
Nice work. Thanks for your help!
Re: Module: Automatic HTTP Path
January 22, 2008 08:17PM
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
Re: Module: Automatic HTTP Path
July 30, 2008 03:59AM
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
Re: Module: Automatic HTTP Path
January 13, 2010 05:20PM
is a file missing (eg settings.php ) in auto_http_path-1.0.5.tar.gz and auto_http_path-1.0.5.zip ?
i have this message on the admin page :
Warning: possible module "auto_http_path" found, but no module information is available for that module.
Re: Module: Automatic HTTP Path
January 13, 2010 05:37PM
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
Re: Module: Automatic HTTP Path
January 20, 2010 05:03PM
thanks for your answer, this mod was installed the wrong directory
mods\auto_http_path-1.0.5\auto_http_path
instead of
mods\auto_http_path



Edited 1 time(s). Last edit at 01/20/2010 05:04PM by zetoun.
Re: Module: Automatic HTTP Path
May 08, 2011 01:08AM
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:

Language: PHP
  1. $uri = $_SERVER[';REQUEST_URI';];
  2. if (isset($_SERVER[';PATH_INFO';]) && $_SERVER[';PATH_INFO';] !== ';';)
  3. {
  4. $p = preg_quote($_SERVER[';PATH_INFO';], ';!';);
  5. $uri = preg_replace(
  6. ';!'; . preg_quote($p, ';!';) . ';(\?.*)?$!';,
  7. ';';, $uri
  8. );
  9. }
  10.  
  11. $dir = dirname($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.
Re: Module: Automatic HTTP Path
May 08, 2011 10:46AM
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
Re: Module: Automatic HTTP Path
February 26, 2015 09:09AM
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
Language: PHP
// PPS> Search Friendly Fix // <PPS

Would be cool if you create a new build with this fix ;).

Greetings
KatyWings
Glarotech GmbH
Attachments:
open | download - auto_http_path.php (5.1 KB)
Sorry, only registered users may post in this forum.

Click here to login