Share » Forums » Setup & design » how to make a community with ezpublish?

how to make a community with ezpublish?

how to make a community with ezpublish?

Thursday 01 June 2006 8:49:17 am - 5 replies

Author Message

Jeroen Sangers

Thursday 01 June 2006 9:38:05 am

Just use the built-in forum

Łukasz Serwatka

Thursday 01 June 2006 1:28:22 pm

You did not write about community portal requirements but I guess most of things can be easily implemented. With eZ publish you can allow users in the community to have their own blogs, galleries, news folders and much more. It is basically front-end editing and permissions setup. If some functionality is missing you can easily add it as eZ publish extensions.

Forum is great to place for shearing the information ;)

Personal website -> http://serwatka.net
Blog (about eZ Publish) -> http://serwatka.net/blog

Daniele Nocentini

Monday 05 June 2006 12:12:31 am

yes the forum is a good idea for community, but I need also that users can exchange private message from each other, If I write a message for an user, only this user can read my message. How must build an extension?

Antica Bottega Digitale srl
http://www.abd.it

Daniele Nocentini

Thursday 08 June 2006 2:23:52 am

any suggestion?

Antica Bottega Digitale srl
http://www.abd.it

Łukasz Serwatka

Thursday 08 June 2006 2:34:04 am

Just make a new table in your database where attributes are:

Example
sender_user_id (int)
reciver_user_id (int)
message (text or varchar)
date (date or timestamp)

Then write new module with view for sending messages and second view for browsing. Fetch only messages for currently logged in user:

Quick example which you need to extend for browsing:

<?php 

$db =& eZDB::instance();
$tpl =& templateInit();

$user =& eZUser:currentuser();

$rs = $db->arrayQuery( "SELECT * FROM messages WHERE reciver_user_id='" . $user->attribute('contentobject_id') . "'" );

$tpl->setVariable( 'messages', $rs );

$Result['content'] = $tpl->fetch( 'design:myext/messages.tpl' );
?>

Then use foreach for $messages and display sender name, date, and message in template.

I did not test the code, it is just quick suggestion which needs to be extended.

Proper way is to use eZ publish persisting object and fetch functions for database communication instead of direct SQL queries.

Good luck.

Let's us know when you make this "private messages" extension ;)

Personal website -> http://serwatka.net
Blog (about eZ Publish) -> http://serwatka.net/blog

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu