Hiding notification button

Author Message

Sandra Parente

Tuesday 27 January 2004 9:40:28 am

I'm using version 3.3-2
I want to display the notification button in nodes only to logged-in users (it has no sense displaying it in a page to anonymous)

I put this code in my node template:

{let thisuser=fetch('user','current_user')}
{section show=$thisuser.is_logged_in}
<input class="button" type="submit" name="ActionAddToNotification" value="{"Notify me about updates"|i18n("design/shop/layout")}{*to {$node.name|wash}*}" />
{/section}
{/let}

It diplays correctly the button only to logged in users, but when you click it, it does not add the element to the notification settings, even if you have the rights.

I also tried:

{section show=$current_user.is_logged_in}
<input class="button" type="submit" name="ActionAddToNotification" value="{"Notify me about updates"|i18n("design/shop/layout")}{*to {$node.name|wash}*}" />
{/section}

But it does not display any button, even if you are logged in.

Any idea?
Thanks.

Sandra

Sandra Parente
www.netbliss.it

Sandra Parente

Wednesday 28 January 2004 2:50:21 am

I discovered that the problem was in upgrading: there must be a bug in the mysql database upgrade from 3.3-1 to 3.3-2. It does not solve the problem with notification. I re-installed 3.3-2 cleaning up the database (sick!) and now notification works.
The correct code for hiding the notification button to anonymous is:

{let thisuser=fetch('user','current_user')}
{section show=$thisuser.is_logged_in}
<input class="button" type="submit" name="ActionAddToNotification" value="{"Notify me about updates"|i18n("design/shop/layout")}{*to {$node.name|wash}*}" />
{/section}
{/let}

Cheers.
Sandra

Sandra Parente
www.netbliss.it

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 22:31:13
Script start
Timing: Jan 18 2025 22:31:13
Module start 'layout'
Timing: Jan 18 2025 22:31:13
Module start 'content'
Timing: Jan 18 2025 22:31:14
Module end 'content'
Timing: Jan 18 2025 22:31:14
Script end

Main resources:

Total runtime0.6864 sec
Peak memory usage4,096.0000 KB
Database Queries52

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0061 587.9141152.6250
Module start 'layout' 0.00610.0029 740.539139.4453
Module start 'content' 0.00890.6753 779.9844497.3984
Module end 'content' 0.68420.0021 1,277.382812.1641
Script end 0.6863  1,289.5469 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00310.4502160.0002
Check MTime0.00130.1945160.0001
Mysql Total
Database connection0.00120.172110.0012
Mysqli_queries0.636292.6931520.0122
Looping result0.00050.0713500.0000
Template Total0.652095.020.3260
Template load0.00190.277820.0010
Template processing0.650194.715920.3250
Template load and register function0.00010.013310.0001
states
state_id_array0.00120.180510.0012
state_identifier_array0.00160.237720.0008
Override
Cache load0.00150.2221320.0000
Sytem overhead
Fetch class attribute can translate value0.00050.068210.0005
Fetch class attribute name0.00120.172830.0004
XML
Image XML parsing0.00040.057810.0004
class_abstraction
Instantiating content class attribute0.00000.001540.0000
General
dbfile0.00080.1096160.0000
String conversion0.00000.001040.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
2content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
2content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
7content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
7content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 20
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs