Forums / Developer / Hiding notification button

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