Forums / General / how to create a news handler like facebook?

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.
:-)

eZ debug

Timing: Jan 30 2025 01:01:23
Script start
Timing: Jan 30 2025 01:01:23
Module start 'content'
Timing: Jan 30 2025 01:01:23
Module end 'content'
Timing: Jan 30 2025 01:01:23
Script end

Main resources:

Total runtime0.1878 sec
Peak memory usage2,048.0000 KB
Database Queries141

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0064 588.0547180.8203
Module start 'content' 0.00640.0055 768.875094.0234
Module end 'content' 0.01190.1759 862.8984522.6250
Script end 0.1878  1,385.5234 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00351.8423200.0002
Check MTime0.00150.7814200.0001
Mysql Total
Database connection0.00100.512710.0010
Mysqli_queries0.147678.59811410.0010
Looping result0.00100.51281390.0000
Template Total0.175693.510.1756
Template load0.00080.444510.0008
Template processing0.174793.016410.1747
Override
Cache load0.00060.311010.0006
Sytem overhead
Fetch class attribute can translate value0.00060.326910.0006
XML
Image XML parsing0.00020.098010.0002
General
dbfile0.00643.3827200.0003
String conversion0.00000.004230.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/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