how to create a news handler like facebook?

Author Message

marc marc

Tuesday 28 July 2009 9:09:08 am

hello,

i'm a true beginner in ez publish so be indulgent please :)
i would like to create a news handler, that means that people that have an personal page on the website , can access to a personal admin page and create a news (=a date + few lines) on his personal page , the news will be added to the old ones, like on facebook.
i have no ideas if its possible (probably yes), but i would like to have some clues or hints to help me and find where to start...
i already googled a lot but didn't find anything.

thank in advance.

Max Keil

Tuesday 28 July 2009 4:24:36 pm

Hi Marc,

if I understand your problem correctly:

You want that your customer can create simple news within their own folders?

It's really "eZ":
Create a form in the owner view or on the blog view:

<form action="{'/content/action'|ezurl(no)}" method="post">
<input type="hidden" name="ClassID" value="#CLASS ID FOR NEWS#" />
<input type="hidden" value="#ID WHRE TO CREATE#" name="NodeID" />
<input type="hidden" value="#ID WHRE TO CREATE#" name="ContentNodeID"/>
<input type="hidden" value="#OBJECT ID WHERE TO CREATE#" name="ContentObjectID"/>
<input type="hidden" value="eng-GB" name="ContentLanguageCode"/>
<input type="submit" value="Create here" name="NewButton" />
</form>

After submitting this form you should be redirected to the edit view of your blog, where the customers can create their own news.
To ensure that not everybody can do that or see the button - you should set up some roles & policies - something like "content"->"create"->"class news"->"parent owner self"

To hide the button from foreign eys you can check is the current user has access to create some news in the current folder.

{def $access=fetch( 'user', 'has_access_to',
                    hash( 'module',   'content', 'function', 'create' ) )}

{if $access}
SHOW FORM
{/if}

I hope this can help you at your way.

Mit freundlichen Grüßen
Best regards

Max Keil

____________________________________________________________
eZ Publish Gold Partner - http://www.all2e.com
http://ez.no/partners/worldwide_partners/all2e_gmbh

marc marc

Tuesday 11 August 2009 2:58:21 am

many thanks to your helpful answer, it seems a bit more clear for me now, i will check that direction.
:-)

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 18 2025 11:15:45
Script start
Timing: Jan 18 2025 11:15:45
Module start 'layout'
Timing: Jan 18 2025 11:15:45
Module start 'content'
Timing: Jan 18 2025 11:15:45
Module end 'content'
Timing: Jan 18 2025 11:15:45
Script end

Main resources:

Total runtime0.0189 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0077 588.0391152.6406
Module start 'layout' 0.00770.0044 740.679739.4766
Module start 'content' 0.01210.0050 780.156389.4609
Module end 'content' 0.01710.0018 869.617234.3047
Script end 0.0189  903.9219 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002613.9804140.0002
Check MTime0.00115.7817140.0001
Mysql Total
Database connection0.00126.110910.0012
Mysqli_queries0.004523.785130.0015
Looping result0.00000.127410.0000
Template Total0.00157.910.0015
Template load0.00084.111410.0008
Template processing0.00073.725310.0007
Override
Cache load0.00052.867510.0005
General
dbfile0.00031.447080.0000
String conversion0.00000.059340.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