[pmwiki-users] best practice

Ben Wilson dausha at gmail.com
Tue May 9 11:47:52 CDT 2006


Sorry, I did not think about this until after I hit send. My outline
bank recipe might be what you need, though I need to spruce it up a
bit before it's suitable to go live. But, it basically is a document
retention tool but it lacks some refinement. Let me put this on my
todo list for next week. I have exams today through next Tuesday.

Ben

On 5/9/06, Ben Wilson <dausha at gmail.com> wrote:
> I wrote an outline bank that based the number upon the number of
> documents in the system. The documents are named "Group.00001" and
> "Group.00002," and each wiki page corresponds to a document (e.g.
> Group.00001 links to page Group.000001.(doc|wpd|pdf)).
>
>    $pages = ListPages("/^$group\\.\\d/");
>    $next_page_no = count($pages) + 1;
>    # Alternatively, pull the last page and find out the "nnn" like:
>    list(,$next) = split('-', array_pop($pages));
>
> You would probably want:
>
>    ListPages("/^$group\\.\\d{4}-\\d{3}");
>
> On 5/9/06, Marco Ferretti <marco.ferretti at gmail.com> wrote:
> > Hi all.
> > I want to create a cookbook to keep track of internal documents. The ideal
> > toponomy of internal documents should be of the form yyyy-nnn where yyyy is
> > the year in wich the document is issued, and nnn is a counter. Also, in an
> > ideal world, nnn should be set by the system. Now, since I've seen a lot of
> > code in cookbooks to retrieve the current year and provided that a wiki group
> > would be created ( say for example InternalDoc ) , what would be the best
> > practice in order to keep track of the next available document number ?
> > I was thinking of a group page ( maybe InternalDoc:InternalDoc ? ) where to
> > initialize a variable ( $LastDocNumber ), but I am stuck as of the
> > initialization  ( getting the last doc number when the web-server is
> > started ... ) .
> >
> > Do you have any suggestion/ better approach ?
> >
> > TIA
> >
> > Marco
> >
> > --
> > You will be honored for contributing your time and skill to a worthy cause.
> >
> >
> > _______________________________________________
> > pmwiki-users mailing list
> > pmwiki-users at pmichaud.com
> > http://host.pmichaud.com/mailman/listinfo/pmwiki-users
> >
> >
> >
> >
>
>
> --
> Ben Wilson
> " Mundus vult decipi, ergo decipiatur"
>


--
Ben Wilson
" Mundus vult decipi, ergo decipiatur"




More information about the pmwiki-users mailing list