[pmwiki-users] quick php question

Tegan Dowling tmdowling at gmail.com
Wed Apr 25 12:37:16 CDT 2007


On 4/25/07, Patrick R. Michaud <pmichaud at pobox.com> wrote:
>
> On Wed, Apr 25, 2007 at 06:11:18PM +0100, Hans wrote:
> > Wednesday, April 25, 2007, 6:06:03 PM, Tegan wrote:
> >
> > > Whoops.  Never mind the never mind - that doesn't work after all. I
> have
> >
> > >     if($page == 'Admin.WebAdmin')  $EnablePathInfo = 0;
> >
> > > That's no good.  What should I have?  Do I need some curly brackets in
> there
> > > or something?
> >
> > try
> >
> >      $page = PageVar($pagename, '$FullName');
> >      if($page == 'Admin.WebAdmin') {
> >         $EnablePathInfo = 0;
> >         include_once("$FarmD/cookbook/webadmin.php");
> >      }
>
> Even better is to not use PageVar() to get the pagename
> (since we already have it in $pagename!):
>
>     $pagename = ResolvePageName($pagename);
>     if ($pagename == 'Admin.WebAdmin') {
>       $EnablePathInfo = 0;
>       include_once("$FarmD/cookbook/webadmin.php");
>     }
>
> Also, I'm not familiar with webadmin, but it would
> seem that even easier would be to put the following into
> local/Admin.WebAdmin.php :
>
>     <?php
>       $EnablePathInfo = 0;
>       include_once("$FarmD/cookbook/webadmin.php");



OK, I'm using

    $pagename = ResolvePageName($pagename);
    if ($pagename == 'Admin.WebAdmin') {
      $EnablePathInfo = 0;
    }
      include_once("$FarmD/cookbook/webadmin.php");


Apparently the include_once statement has to be outside of the conditional -
which makes me suspect it also wouldn't work to have it on the page
local/Admin/WebAdmin.php.

And anyhow, I wanted to move it all off of local/Admin.WebAdmin.php and onto
local/config.php in the first place.  So this is great.

Thanks again!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: /pipermail/pmwiki-users/attachments/20070425/05313e46/attachment.html 


More information about the pmwiki-users mailing list