how to disable "tipa a friend" function for anonymous?

Author Message

Vytautas Germanavičius

Tuesday 28 November 2006 12:38:33 am

{set-block scope=root variable=cache_ttl}0{/set-block}

Georg Franz

Tuesday 28 November 2006 1:11:09 am

Hi,

Have a look at http://ez.no/community/forum/general/how_avoid_tip_a_friend_abuse/re_how_avoid_tip_a_friend_abuse__6

Best wishes,
Georg.

--
http://www.schicksal.com Horoskop website which uses eZ Publish since 2004

André R.

Tuesday 28 November 2006 2:25:28 am

You override the article template and add a if $current_user.is_logged_in check.

like this:

{if $current_user.is_logged_in}
        <div class="attribute-tipafriend">
          <p>
             <a href={concat('/content/tipafriend/',$node.node_id)|ezurl}>{"Tip a friend"|i18n("design/base")}</a>
          </p>
        </div>
{/if}

about the user object:
http://ez.no/doc/ez_publish/technical_manual/3_8/reference/objects/ezuser

about template override:
http://ez.no/doc/ez_publish/technical_manual/3_8/templates/the_template_override_system

PS! There where some issues with forum posting as you can see from the two last posts, but it's fixed now.

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

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 31 2025 06:29:29
Script start
Timing: Jan 31 2025 06:29:29
Module start 'layout'
Timing: Jan 31 2025 06:29:29
Module start 'content'
Timing: Jan 31 2025 06:29:29
Module end 'content'
Timing: Jan 31 2025 06:29:29
Script end

Main resources:

Total runtime0.0174 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.0045 588.3828151.2422
Module start 'layout' 0.00450.0019 739.625036.7109
Module start 'content' 0.00640.0091 776.335990.3438
Module end 'content' 0.01540.0019 866.679733.9922
Script end 0.0173  900.6719 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002514.1897140.0002
Check MTime0.00116.5345140.0001
Mysql Total
Database connection0.00073.890010.0007
Mysqli_queries0.00158.582430.0005
Looping result0.00000.052110.0000
Template Total0.00148.310.0014
Template load0.00105.811710.0010
Template processing0.00042.444310.0004
Override
Cache load0.00074.050510.0007
General
dbfile0.00031.718780.0000
String conversion0.00000.028840.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