[pmwiki-users] Hg tweaks...

Kathryn Andersen kat_lists at katspace.homelinux.org
Thu Feb 1 15:25:54 CST 2007


On Thu, Feb 01, 2007 at 03:58:01PM -0500, The Editor wrote:
> On 2/1/07, Kathryn Andersen <kat_lists at katspace.homelinux.org> wrote:
> > On Thu, Feb 01, 2007 at 08:33:04AM -0500, The Editor wrote:

> > Are you going to include the relative '^' link markup?
> 
> Yes, actually it's already in!

Yay!
 
> > One problem I found was that it wouldn't work at first because it was
> > complaining that the function "bcadd" didn't exist.  This is because my
> > version of PHP was compiled without support for the bcmath library.
> >
> > So I changed this line:
> >
> >  $hg = "g" . bcadd($g,1);
> >
> > to
> >
> >  $hg = "g" . ($g + 1);
> >
> > And that seemed to work.
> >
> > Any particular reason why you used bcadd rather than the simple "+"?
> 
> I'll make the change.  I've had problems with the simple notation in
> certain situations in the past but if it works fine here, great.

Well, I haven't tested it thoroughly, so maybe there are some situations
where it doesn't work... 8-(

> Didn't realize some php installations didn't include this.

I'm running GenToo, and since it's optional to include bcmath, and I
didn't see any need for it, I didn't include it.
It may be the case that other Linux distros always include it in their
versions of PHP; I do not know.

If I end up having problems, I'll just have to re-install PHP with
bcmath turned on, so it's not insurmountable.
 
Oh, I've also run into something puzzling, a line which I changed...

 $FmtPV["$$hg"] = "'" . $gg . "'";

Wouldn't that work better as the following?

 $FmtPV['$' . $hg] = "'" . $gg . "'";

I'm not sure that the $$ will give what is needed.  Or maybe I'm just
being paranoid.

> > Wouldn't it work to then have a pagelist template which checks the value
> > of $g2?
> >
> > (:if !equal "{<$g2}" "{=$g2}":)
> > {=$g2}
> > (:ifend:)
> >
> > I haven't tried it, but hopefully it would work.
> 
> I don't know that the subgroup variables would be created for each
> item in the page list--as they are only created when Hg is run.  Or
> are you saying there's a way to do something when a page is a new
> group... That would do it exactly...  Yes, there must be as some
> pagelists return nothing but a list of groups.  Perfect!  Thanks
> Kathryn--that's the answer!

Yay!
 
Kathryn Andersen
-- 
 _--_|\     | Kathryn Andersen	<http://www.katspace.com>
/      \    | 
\_.--.*/    | GenFicCrit mailing list <http://www.katspace.com/gen_fic_crit/>
      v     | 
------------| Melbourne -> Victoria -> Australia -> Southern Hemisphere
Maranatha!  |	-> Earth -> Sol -> Milky Way Galaxy -> Universe



More information about the pmwiki-users mailing list