[pmwiki-users] strange error messages

Patrick R. Michaud pmichaud at pobox.com
Thu Sep 8 08:45:11 CDT 2005


On Thu, Sep 08, 2005 at 02:36:41PM +0100, Hans wrote:
> Thursday, September 8, 2005, 1:20:30 PM, Patrick wrote:
> > Here it's warning that the $rpage variable is being used when it hasn't
> > been initialized.  In my scripts where I know this usage is okay I usually
> > suppress the warnings by placing an "@" in front of the expression.
> 
> I better ask since I am not quite sure:
> Existing codeblock:
> 
>    # do not show rightbar box if RightBar is empty
>    global $HTMLStylesFmt;
>    $prb = FmtPageName('$FullName-RightBar',$pagename);
>    $grb = FmtPageName('$Group.RightBar',$pagename);
>    $srb = FmtPageName('$SiteGroup.RightBar',$pagename);
>    if (PageExists($prb)) $rpage = ReadPage($prb);
>    if (PageExists($grb)) $rpage .= ReadPage($grb);
>    if (PageExists($srb)) $rpage .= ReadPage($srb);
>    if($rpage['text']=='') {$HTMLStylesFmt[] = " #rightbar { display:none } \n";};
> 
> Is it sufficient to write the last line as this:
> 
>    if(@$rpage['text']=='') {$HTMLStylesFmt[] = .......

Yes.  

Pm




More information about the pmwiki-users mailing list