[pmwiki-users] Path to skins question

Patrick R. Michaud pmichaud at pobox.com
Wed Nov 8 11:10:53 CST 2006


On Wed, Nov 08, 2006 at 04:18:16PM +0000, Hans wrote:
> Wednesday, November 8, 2006, 3:50:59 PM, Patrick wrote:
> 
> >> I can't give an absolute path on the commercial hosting server.
> 
> > Why not?
> 
> Because I have no access to the server. I just rent space.
> I know the url paths, but not the filepaths, only from the site root
> upwards. Is there a variable giving me the site root, which i then can
> use in SkinLibDirs?

There's not a variable, but you could use the getcwd() function
somewhere to figure out what it is.  Or just run PmWiki with
?action=phpinfo, and then look at the DOCUMENT_ROOT or
SCRIPT_FILENAME entries in the PHP Variables to learn what the
absolute path is.

> > You also didn't answer my earlier question -- what's not
> > working?  Is it not finding the skin directory, or is there
> > some other problem?
> 
> It is a farm setup. The fields work fine but without style sheets,
> the path to the skins are wrong. All skins are in
> public_html/farm/pub/skins/

If the templates are being loaded but not the stylesheets, that
indicates that $SkinLibDirs itself is probably okay but there's
something wrong with $FarmPubDirUrl.  (You are setting $FarmPubDirUrl
*before* setting $SkinLibDirs, yes?)

> Pm, I am confused about you saying
> 
> >> $SkinLibDirs = array(
> >>   "./pub/skins/\$Skin"      => "$PubDirUrl/skins/\$Skin",
> >>   "$SiteRoot/public_html/farm/pub/skins/\$Skin" =>
> >>     "$FarmPubDirUrl/skins/\$Skin",
> >>   ));
> >>
> >> There should be an easy answer to this, but it evades me. Any ideas?
> 
> >The above seems like it should work.
> 
> How can it work if $SiteRoot is not defined?
> How can I determine the site root directory?

You originally wrote "...with what will i need to replace $siteroot?"
and my response was "You might try replacing $SiteRoot with an
absolute path to the farm/pub/skins directory."  As you mentioned
in another email, you were just using $SiteRoot as a placeholder
to demonstrate what is missing; I was using $SiteRoot in exactly the
same sense, and not as a real variable that is being set somewhere
(although you could certainly do that).

The key question to resolving this is to know if the page is
being displayed with or without the skin template.  If you're
getting a "skin not found" error, that indicates a problem with
the filesystem path (the key).  If the page is displaying
but none of the .css and/or .gif images are loading, that's
a problem with the url portion and/or $FarmPubDirUrl.

Pm




More information about the pmwiki-users mailing list