multiple user blogs

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

multiple user blogs

Lichman, Mark Eugene
Is there a way to allow multiple user to each have their own blog? How could this be set up?



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: multiple user blogs

Ludovic Dubost

One of the techniques to get multiple user blogs is to copy the content
of the Main page and add a little sql in the query to retrieve blog
articles in the macro. For this you need to copy the Macro code from
xwiki.com in your own wiki:

http://www.xwiki.com/xwiki/bin/view/Blog/Macros?xpage=code

And modify the following lines:

#if($category=='')
#set ($sql = ", BaseObject as obj where obj.name=doc.fullName and
obj.className='XWiki.ArticleClass' and
obj.name<>'XWiki.ArticleClassTemplate' order by doc.creationDate desc")
#else
#set ($sql = ", BaseObject as obj, DBStringListProperty as prop join
prop.list list where obj.name=doc.fullName and
obj.className='XWiki.ArticleClass' and
obj.name<>'XWiki.ArticleClassTemplate' and obj.id=prop.id.id and
prop.id.name='category'  and list='${category}' order by
doc.creationDate desc")
#end

For example you can add doc.web='$doc.web' in the queries

#set ($sql = ", BaseObject as obj where doc.web='$doc.web'
obj.name=doc.fullName and obj.className='XWiki.ArticleClass' and
obj.name<>'XWiki.ArticleClassTemplate' order by doc.creationDate desc")

This would have the effect of restricting the articles to the ones in
the current space..
Be carefull this will probably break the home page blog as the home page
blog is on Main.WebHome and the articles are in the Blog space..
You will need to add some ifs for the case

#if($doc.web='Main')
#set($articlespace = 'Blog')
#else
#set($articlespace= $doc.web)
#end
#set ($sql = ", BaseObject as obj where doc.web='$articlespace'
obj.name=doc.fullName and obj.className='XWiki.ArticleClass' and
obj.name<>'XWiki.ArticleClassTemplate' order by doc.creationDate desc")

You can put the home page script of each user in the shared page and
include it using #includeForm().
And the next cool thing would be to have a small script where people can
setup their blog using one click !

Another approach is to say that a user blog is a blog of all the
articles published by that user.. So that would be:

#if($request.user)
#set($usersql = "doc.creator = 'XWiki.${request.user}' and")
#else
#set($usersql = "")
#end
#set ($sql = ", BaseObject as obj where $usersql obj.name=doc.fullName
and obj.className='XWiki.ArticleClass' and
obj.name<>'XWiki.ArticleClassTemplate' order by doc.creationDate desc")

You can view a user's blog by adding ?user=LudovicDubost

Ludovic

[hidden email] wrote:

> Is there a way to allow multiple user to each have their own blog? How could this be set up?
>
>  
> ------------------------------------------------------------------------
>
>
> --
> You receive this message as a subscriber of the [hidden email] mailing list.
> To unsubscribe: mailto:[hidden email]
> For general help: mailto:[hidden email]?subject=help
> ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
>  

--
Ludovic Dubost
XPertNet: http://www.xpertnet.fr/
Blog: http://www.ludovic.org/blog/
XWiki: http://www.xwiki.com
Skype: ldubost AIM: nvludo Yahoo: ludovic




--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws