[pmwiki-users] BlogSimple2 - for different users

Jon Haupt jhaupt at gmail.com
Mon Mar 5 14:30:31 CST 2007


On 3/5/07, Siegfried Hirsch <siegfried.hirsch at gmail.com> wrote:
> Hello everybody,
>
> I have successfully installed BlogSimple2beta with the extension
> commentboxplus and I am using Categories.
>
> Now I have special question:
> I want to create and maintain a blog for every user.
>
> I created a new variable in config.php after successfull login with
> AuthUser like this:
> $FmtPV['$BlogAuthor2'] = 'Blog'.ucfirst($AuthId);
> which generates a variable for every user like this: BlogSiegfried
> if the login is Siegfried
>
> In the SideBar menu I was able to install a new menu point:
>
> * [[Main/{$BlogAuthor2}|Blog $BlogAuthor]]
>
> And in this file I have put the pagelist for this user:
>
> (:pagelist $:{$BlogAuthor2}=1 list=blog order=-ctime fmt=#recentblog count=15:)
>
> which produces the blog listing for the author.
>
> My problem is now with the commentplusbox, which will be included
> with Site.SiteFooter in every blog page to have commenting abilities:
>
> (:if equal {*$:Blog} 1:)
> ----
> (:div2 class=blogpost-comments:)
> (:if expr exists PostComments.{*$Group}-{*$Name} && equal {*$:Blog} 1:)
> !!![[#comments]]{PostComments.{*$Group}-{*$Name}$PostCount}
> Comments:(:if equal {*$:Blog} 1:)
> (:include PostComments.{*$Group}-{*$Name}:)
> !!! Add a Comment
> (:div3 class=blogpost-commentbox:)
> [[#commentbox]]
> (:commentboxchrono PostComments.{*$Group}-{*$Name}:)
> (:div3end:)
> (:div2end:)
> (:div1end:)
> (:div0end:)
> (:if:)
>
> How can I change this from using Blog to using my varialbe
> $BlogAuthor2 to create the comments for this user?
> I have tried different thinks, but have not found the right syntax for this.
>

I guess the most important question is, what exactly do you want to
happen when someone submits a comment?  Where should the comment go?
Do you want all the comments to be in one special group still
(PostComments) or do you want separate groups, like
PostCommentsSiegfried?

I think the former could be accomplished by changing everything to
{*$BlogAuthor2}-{*$Group}-{*$Name} below and then creating another
custom page variable that extracts "{*$BlogAuthor2}-" from a page name
as well as turning the second hyphen into a dot (which is what
$BaseName does already).  I think the latter could be accomplished
with the following, but you'd probably have to adjust the
commentboxplus somehow so that it's allowed to post to any group
starting with PostComments.

(:if equal {*$:Blog} 1:)
----
(:div2 class=blogpost-comments:)
(:if expr exists PostComments{*$BlogAuthor2}.{*$Group}-{*$Name} &&
equal {*$:Blog} 1:)
!!![[#comments]]{PostComments{*$BlogAuthor2}.{*$Group}-{*$Name}$PostCount}
Comments:(:if equal {*$:Blog} 1:)
(:include PostComments{*$BlogAuthor2}.{*$Group}-{*$Name}:)
!!! Add a Comment
(:div3 class=blogpost-commentbox:)
[[#commentbox]]
(:commentboxchrono PostComments{*$BlogAuthor2}.{*$Group}-{*$Name}:)
(:div3end:)
(:div2end:)
(:div1end:)
(:div0end:)
(:if:)

Jon



More information about the pmwiki-users mailing list