Best way for session preferences

Author Message

Karol Radziuk

Tuesday 22 February 2011 2:56:51 am

Hi

I'd like to give for anonymus user an opportunity to store:
- numer of items per page (10, 20, 50...)
- sorting method

Ez preference stores data per user id. Each anonymus has the same id...

$view_parameters is not good, system will not remember user's decision. Session variable seems to be best, but how to store it easly, and deal with template cache?

Have you an idea, how to do this smoothly?

{$me|attribute(show,1)}

Damien Pobel

Tuesday 22 February 2011 4:27:28 am

Hi,

"

Ez preference stores data per user id. Each anonymus has the same id...

"

In fact the preference system of eZ Publish is bit more clever because for anonymous users it uses session variables instead of storing values in the database. See https://github.com/ezsystems/ezpublish/blob/master/kernel/classes/ezpreferences.php

Cheers

Damien
Planet eZ Publish.fr : http://www.planet-ezpublish.fr
Certification : http://auth.ez.no/certification/verify/372448
Publications about eZ Publish : http://pwet.fr/tags/keywords/weblog/ez_publish

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 02:21:49
Script start
Timing: Jan 18 2025 02:21:49
Module start 'layout'
Timing: Jan 18 2025 02:21:49
Module start 'content'
Timing: Jan 18 2025 02:21:50
Module end 'content'
Timing: Jan 18 2025 02:21:50
Script end

Main resources:

Total runtime0.8526 sec
Peak memory usage4,096.0000 KB
Database Queries55

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0075 587.9219152.6250
Module start 'layout' 0.00760.0027 740.546939.4531
Module start 'content' 0.01020.8407 780.0000533.2422
Module end 'content' 0.85090.0016 1,313.24228.1563
Script end 0.8525  1,321.3984 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00370.4357160.0002
Check MTime0.00130.1517160.0001
Mysql Total
Database connection0.00110.126010.0011
Mysqli_queries0.804394.3307550.0146
Looping result0.00050.0563530.0000
Template Total0.820096.220.4100
Template load0.00190.226820.0010
Template processing0.818195.945020.4090
Template load and register function0.00010.010510.0001
states
state_id_array0.00080.091110.0008
state_identifier_array0.00140.165820.0007
Override
Cache load0.00150.1733190.0001
Sytem overhead
Fetch class attribute can translate value0.00100.120820.0005
Fetch class attribute name0.00120.137240.0003
XML
Image XML parsing0.00090.110320.0005
class_abstraction
Instantiating content class attribute0.00000.000840.0000
General
dbfile0.00100.1197220.0000
String conversion0.00000.000740.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
4content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1content/datatype/view/ezxmltags/quote.tpldatatype/ezxmltext/quote.tplextension/ezwebin/design/ezwebin/override/templates/datatype/ezxmltext/quote.tplEdit templateOverride template
1content/datatype/view/ezxmltags/link.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/link.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 13
 Number of unique templates used: 8

Time used to render debug report: 0.0001 secs