00540: $PubDirUrl not used for skins

Summary: $PubDirUrl not used for skins
Created: 2005-09-25 00:47
Status: Closed - not a bug
Category: Bug
Assigned:
Priority: 2
Version: 2.0.6
OS: all

Description: skins.php won't accept a pub dir url different from default :

    $sd = FmtPageName("pub/skins/$s", $pagename);
    if (is_dir($sd)) 
      { $Skin=$s; $SkinDirUrl="$PubDirUrl/skins/$Skin"; break; }
    $sd = FmtPageName("$FarmD/pub/skins/$s", $pagename);
    if (is_dir($sd)) 
      { $Skin=$s; $SkinDirUrl="$FarmPubDirUrl/skins/$Skin"; break; }

looks like lines should be changed to:

 $sd = FmtPageName("$PubDirUrl/skins/$s", $pagename);

and

 $sd = FmtPageName("$FarmPubDirUrl/skins/$s", $pagename);

The lines quoted above aren't setting urls, they're directory paths (relative to the current directory). The $PubDirUrl and $FarmPubDirUrl variables are used to tell a browser where it can find files, especially on systems where pmwiki.php is remapped to a different url.

In particular, the PHP is_dir function cannot be run on a url.

--Pm


Just a small query, is it possible to create a central repository of skins?

 example:
 $sd = FmtPageName("$SomeVariable", $pagename);

 "$SomeVariable gets" resolved to true if "$PubDir/skins/$s" or "$FarmD/pub/skins/$s" is true.

This would be helpful if core PmWiki installations has to be segregated from skin repository.

~V.Krishn


Normally the "central repository" of skins is the farm directory; i.e., $FarmD/pub/skins/. The skins.php recipe automatically sets $SkinDir to the directory (either farm or local) that corresponds to the $Skin setting. --Pm

Yes, this helps if there is a single farm setup. This would be difficult if I plan to run two or more farms with its own set of fields. With a common skin repository maybe outsite $PubDir or $FarmD perhaps may solve the issue, otherwise the only option would be to upload the skins for each farm. ~V.Krishn

Thanks for introduding the new $SkinLibDirs array in Version 2.1.16. This would solve my skin repository query above.
VKrishn August 27, 2006, at 08:47 AM