[pmwiki-users] path worries with Flowplayer

Petko Yotov 5ko at 5ko.fr
Sun Jan 31 18:14:57 CST 2010

On Sunday 31 January 2010 17:18:18, Moni Kellermann wrote :
> The recipe uses
> SDV($FPObjBaseUrl, $ScriptUrl."/wiki/cookbook/flowplayer/");
> SDV($FPJsUrl, $ScriptUrl."/wiki/cookbook/flowplayer/flashembed.min.js");
> SDV($HelperJsUrl, $ScriptUrl."/wiki/cookbook/flowplayer/addloadevent.js");
> This assumes that my wiki is in a folder called "wiki" which it
> isn't, but, okay, I remove that. But it still doesn't work because of
> the used $ScriptUrl parameter.

Hello. Normally, you can define variables in config.php, and if the recipe 
uses SDV() - "set default value" - it will not overwrite them.

I haven't tried this particular recipe, but you can set in config.php 
something like this:

  if($_SERVER['HTTP_HOST'] == 'localhost') { # home server
    $FPObjBaseUrl = "http://localhost/pm68/cookbook/flowplayer/";
  else { # online server
    $FPObjBaseUrl = "http://www.pmwiki.org/cookbook/flowplayer/";
  # these contain the Base Url we just defined above
  $FPJsUrl = $FPObjBaseUrl."flashembed.min.js";
  $HelperJsUrl = $FPObjBaseUrl."addloadevent.js";

  # include the recipe after the variables are set

Hope that helps.


P.S. Note that the "cookbook" disk directory should normally be read-protected 
from internet, with a special .htaccess file forbidding http:// visitors. If I 
may make a recommendation, the "flowplayer" directory (not flowplayer.php) 
would better be moved inside the "pub" directory, then your $FPObjBaseUrl 
lines would look like:

  $FPObjBaseUrl = "http://www.pmwiki.org/pub/flowplayer/";

More information about the pmwiki-users mailing list