[pmwiki-users] powertools bug?

adam overton a at plus1plus1plus.org
Thu Jul 31 01:46:17 CDT 2008


i don't have the best php style/experience, but this seems to do the  
trick for what i'm looking for. (perhaps someone knows a one-liner  
that's better than this?)

are there any reasons why i wouldn't want to make pagecount spit out  
a zero?

function PageCount($pn, $arg='') {
	/* new */
	$plist = explode(",", $arg);
	$ppn = '';
	foreach($plist as $k => $pn) {
		$ppn .= $pn;
	}

	// count is spitting out a "1" even when there are no entries in the  
Plist
	if ($ppn == "") { return 0; } else { return count($plist); }
	/* end new */
	
	//return count(explode(",", $arg));
}


a



On 30 Jul 2008, at 10:50 PM, adam overton wrote:

> hi there
>
> is this a powertools pagecount bug, or is it supposed to do this?  
> i'm unable to get a pagecount of zero...
>
>
> WikiS*
> {(plist PmWiki.WikiS*)}
> {(pagecount (plist PmWiki.WikiS*))}
>
>      correctly displays:
>       
> PmWiki.WikiSandbox,PmWiki.WikiStructure,PmWiki.WikiStyleExamples,PmWik 
> i.WikiStyles
>      4
>
>
> while:
>
>
> Wikv*
> {(plist PmWiki.Wikv*)}
> {(pagecount (plist PmWiki.Wikv*))}
>
>
>      incorrectly(?) displays:
>      Wikv*
>      1
>
> i'm expecting a 0 from pagecount...
>
> ?
> thanks,
> adam

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.pmichaud.com/pipermail/pmwiki-users/attachments/20080730/c4569ce6/attachment.html 


More information about the pmwiki-users mailing list