[pmwiki-users] Rightbar style switcher
Hans Bracker
design at flutesong.net
Wed Jan 26 14:49:16 CST 2005
Wednesday, January 26, 2005, 3:51:17 PM, Hans wrote:
> $rpage = ReadPage(FmtPageName('$Group.RightBar', $pagename));
> if ($rpage['text'] == '') $rpage = ReadPage('Main.RightBar');
> if ($rpage['text'] >> '') { ..... }
> ( if $Group.RightBar exists AND content>0 ) OR
> ( if Main.RightBar content>0 )
> then {...}
> How can i write that in code?
I found an answer to my own question:
$grb = FmtPageName("\$WorkDir/\$Group.RightBar", $pagename);
$rpage = ReadPage(FmtPageName('$Group.RightBar', $pagename));
if (!file_exists($grb)) $rpage = ReadPage('Main.RightBar');
if ($rpage['text'] > ' ') { .... }
Maybe not the most elegant of code, but it works exactly as i wish.
~Hans
More information about the pmwiki-users
mailing list