[pmwiki-users] $SkinLibDirs bug

JB jbit at ev1.net
Sat Sep 23 01:02:39 CDT 2006

The SetSkin function in scripts/skins.php is not 
working like I thought/hoped/wished/feel it should.

A comment in the code says: 

  # SetSkin changes the current skin to the first available 
  # skin from the $skin array.

It is in fact searching for a directory named for a skin and 
then trys to load the skin .tmpl file from it.  If it cannot 
find the skin .tmpl file it gives the error message:

    Unable to load $Skin template

What I thought would happen was that it would try to search 
through all array (key,index) pairs and try to load a skin. 
Currently it abandons trying after matching one directory 
named for the skin which does not contain the skin .tmpl file.
I feel it should keep searching through the other 
array (key,index) pairs.


   $SkinLibDirs = array(
          "./pub/skins/\$Skin" => "$PubDirUrl/skins/\$Skin",
     "$FarmD/pub/skins/\$Skin" => "$PubDirUrl/skins/\$Skin",
     "$FarmD/pub/skins/\$Skin" => "$FarmPubDirUrl/skins/\$Skin");

In my farm directory I have a skin .tmpl

  /var/www/home/awebsite/farm/ (farm directory)

In my local wiki directory I have a skin css

  var/www/home/awebsite/public_html/alocalwiki/ (local wiki dir)

My local wiki has a symlink 

  index.php -> ../../farm/index.php

When the SetSkin function searches and finds directory 
"./pub/skins/\$Skin", which contains my skin css but not a 
skin .tmpl it gives me the error message. ("./pub/skins/\$Skin" 
is relative to the location of the symlink)

Can you make it so the SetSkin function will go back
to the other not used array (key,index) pairs and try to load 
the skin from them?

If this is fixed then my 2nd item in $SkinLibDirs would 
be a match and my skin would load.

Again, what I do not like is that it abandons trying to load
a skin after it finds one directory named for the skin which 
does not contain the skin .tmpl file.  It should keep trying
the other directories in the array.

More information about the pmwiki-users mailing list