[pmwiki-users] Hg tweaks...

Kathryn Andersen kat_lists at katspace.homelinux.org
Thu Feb 1 14:39:42 CST 2007


On Thu, Feb 01, 2007 at 08:33:04AM -0500, The Editor wrote:
> Just add subname vars to Hg for various uses (esp in ZAP)...
> 
> {$n1}, {$n2}, etc.  {$n0} gives the count...

Good!

Are you going to include the relative '^' link markup?

> Didn't document it, but the separator can be changed from a hyphen to
> whatever you want by setting $hgseparator to some other value before
> calling hg.php

Noted.
 
> Hope more of you will give this a try.  It is proving to be a very
> useful little script.  It makes quite a few really neat things
> possible...

I've given it a go; if it works I'll be able to change my stuff that's
split into a farm so that it's back as one wiki, which will be great!

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 "+"?
 
> PS.  Still looking for help with a way to create a pagelist that will
> return exactly one name for each instance of a subgroup--perhaps by
> creating some kind of custom search routine.  Can anyone suggest a way
> to do it?

Well, you could make a $SearchPatterns pattern for subgroup pages...

$SearchPatterns['subgroup']['group'] = '/^[^-]*-[^-]*-/';
 
> Specifically, if I have pages:
> 
> Main-One.A
> Main-One.B
> Main-Two.A
> Main-Two.B
> 
> I'd like to be able to get exactly one instance of One and Two.  A
> basename pattern?

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.

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