[pmwiki-users] php q

Petko Yotov 5ko at free.fr
Mon Jul 16 08:30:15 CDT 2007


On Monday 16 July 2007, noskule wrote:
> SomeGroup.SomeName-Topic-12-Comment-3 -> SomeGroup.SomeName-Topic-12
>
> $name = PageVar($pagename, '$Name');
> $backnamecomment = explode('-Comment-',$name);
> $backnamecomment = $backnamecomment[0];
> $FmtPV['$CommentBaseName'] = $backnamecomment;
>
> this don't work and gives me: -12
>
>
> does anyone have an idea what I'm doing wrong?

Use everytime:

   $FmtPV['$TopicBaseName'] = "'$backnametopic'";
   $FmtPV['$CommentBaseName'] = "'$backnamecomment'";

in quotes and inside, in apostrophes, because the PageVariables are being 
eval()-uated, and you may get a number of fatal errors.

See also:
   http://pmwiki.org/wiki/Cookbook/MoreCustomPageVariables

Thanks,
Petko




More information about the pmwiki-users mailing list