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

_______________________________________________
pmwiki-users mailing list
[email protected]
http://www.pmichaud.com/mailman/listinfo/pmwiki-users

Reply via email to