[pmwiki-users] giving a new page an automatic prefix/suffix

marc gmane at auxbuss.com
Wed Jan 24 04:10:14 CST 2007


Kathryn Andersen said...
>
> I have NewPageBoxPlus set up for my users, and they like it, but there's
> one thing that it won't do -- and I'm not sure if anything else will do
> it either.
> 
> What is needed is to have a way of having a user give a new page name,
> to create a new page, but instead of creating the page that they give,
> the page name has a prefix (or a suffix).  For example, if the prefix
> was "Foo", then a new page which they entered as "NewPage" wouldn't be
> called "NewPage", it would be called "FooNewPage".
> 
> This would be really useful, as one could set up a framework where users
> could create new pages which were a meaningful subset of pages in that
> group, and they could be listed with a pagelist automatically.
> 
> And no, making a new group called "Foo" is not a helpful solution.

Looking at newpageboxplus.php, you could amend it to add the prefix to 
the line

    $name = @$_REQUEST['name'];

in HandleNew(), then set the value, say, in each group.php.

In newpageboxplus.php, something like:

    SDV($newPagePrefix,'');
    function HandleNew($pagename) {
    global $Author, $Now, $newPagePrefix;
    $name = $newPagePrefix.@$_REQUEST['name'];

then in, say, Main.php add:

    $newPagePrefix = 'foo-';

-- 
Cheers,
Marc





More information about the pmwiki-users mailing list