|
PITS /
00708Summary: Missing $FarmPubD variable leads to "Unable to find skin" error.
Created: 2006-03-20 20:30
Status: Closed - now fixed in 2.1.16
Category: Bug
From: HaganFox
Assigned:
Priority: 4
Version: 2.1.3
OS: Various
Description:
You cannot re-define the filesystem location of a farm's pub/ directory when you redefine its URL ( PmWiki can't process your request
?unable to find skin from list pmwiki
We are sorry for any inconvenience.
Here's a patch that adds the capability to set a $FarmPubD in the farm's local/farmconfig.php:
*** skins-old.php 2006-03-20 15:38:19.000000000 -0700
--- skins-new.php 2006-03-20 15:35:48.000000000 -0700
***************
*** 40,52 ****
# the $skin array.
function SetSkin($pagename, $skin) {
global $Skin, $SkinDir, $SkinDirUrl, $IsTemplateLoaded, $PubDirUrl,
! $FarmPubDirUrl, $FarmD;
unset($Skin);
foreach((array)$skin as $s) {
$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; }
}
--- 40,53 ----
# the $skin array.
function SetSkin($pagename, $skin) {
global $Skin, $SkinDir, $SkinDirUrl, $IsTemplateLoaded, $PubDirUrl,
! $FarmPubDirUrl, $FarmD, $FarmPubD;
unset($Skin);
+ SDV($FarmPubD, "$FarmD/pub");
foreach((array)$skin as $s) {
$sd = FmtPageName("./pub/skins/$s", $pagename);
if (is_dir($sd))
{ $Skin=$s; $SkinDirUrl="$PubDirUrl/skins/$Skin"; break; }
! $sd = FmtPageName("$FarmPubD/skins/$s", $pagename);
if (is_dir($sd))
{ $Skin=$s; $SkinDirUrl="$FarmPubDirUrl/skins/$Skin"; break; }
}
I chose to go about this in a different way, by introducing a Thus, there's not a $FarmPubD variable built-in, but one can use one in order to make things work. For example, supposing that the farm's pub directory location is indeed in $FarmPubD, then a config file may set:
which says to look in the local pub/skins/ directory followed by the $FarmPubD/skins/$Skin directory. Of course, this can also be used to tell the skin code to only look in a farm directory, or to extend the number of places to look for skins. Thanks! Pm |