how to make a community with ezpublish?

Author Message

Daniele Nocentini

Thursday 01 June 2006 8:49:17 am

HI

I want to start web community with ezpublish and I want to allow the user to exchange messages from each other, how can I do with ez?

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

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

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 30 2025 22:23:28
Script start
Timing: Jan 30 2025 22:23:28
Module start 'layout'
Timing: Jan 30 2025 22:23:28
Module start 'content'
Timing: Jan 30 2025 22:23:28
Module end 'content'
Timing: Jan 30 2025 22:23:28
Script end

Main resources:

Total runtime0.0216 sec
Peak memory usage6,144.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0041 588.2500151.2266
Module start 'layout' 0.00410.0034 739.4766220.7188
Module start 'content' 0.00750.0126 960.19531,005.9297
Module end 'content' 0.02010.0015 1,966.125037.9922
Script end 0.0216  2,004.1172 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002511.6285140.0002
Check MTime0.00094.3435140.0001
Mysql Total
Database connection0.00062.909610.0006
Mysqli_queries0.00167.431530.0005
Looping result0.00000.046310.0000
Template Total0.00115.010.0011
Template load0.00083.866610.0008
Template processing0.00021.095810.0002
Override
Cache load0.00062.553910.0006
General
dbfile0.00115.297280.0001
String conversion0.00000.031940.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs