Forums / Developer / Using the user preferences system ?

Using the user preferences system ?

Author Message

H-Works Agency

Thursday 17 June 2010 5:29:12 am

Hello,

How can we use the "/user/preferences/set/" system ?

Can we pass arrays with this system ? What are the related php functions in ezpublish api to retrieve a user preferences ?

Thank !

EZP is Great

Bruce Morrison

Thursday 17 June 2010 7:12:12 pm

Hi Martin

Have you seen these?

The following methods can be used to retrieve user preferences

Cheers
Bruce

My Blog: http://www.stuffandcontent.com/
Follow me on twitter: http://twitter.com/brucemorrison
Consolidated eZ Publish Feed : http://friendfeed.com/rooms/ez-publish

André R.

Friday 18 June 2010 1:58:35 am

The value can not be an array, it must be a string, but you can of course use a string to represent an array as long as it is legal to put into an url.

Alternatively it also supports values by post, if you want to post value as json or some other format. But I suspect that was added in 4.3 together with 'set_and_exit' which is to be able to use it in ajax calls without regenerating a full page in the background.

Note: value & name has a limit of 100 chars each, I suspect this is because preferences are cached to session, and thus can't be of unlimited size.

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

H-Works Agency

Friday 18 June 2010 4:35:30 am

Thanks for your answers, i got it now.

It seems that variables stored with this system are recorded in session too.

I didn't knew there were an API documentation website...will be very useful for me.

EZP is Great

eZ debug

Timing: Jan 17 2025 23:45:16
Script start
Timing: Jan 17 2025 23:45:16
Module start 'content'
Timing: Jan 17 2025 23:45:17
Module end 'content'
Timing: Jan 17 2025 23:45:17
Script end

Main resources:

Total runtime0.7897 sec
Peak memory usage4,096.0000 KB
Database Queries200

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0059 587.7344180.8281
Module start 'content' 0.00590.6781 768.5625608.6563
Module end 'content' 0.68400.1056 1,377.2188337.3672
Script end 0.7897  1,714.5859 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00410.5158210.0002
Check MTime0.00140.1794210.0001
Mysql Total
Database connection0.00090.117910.0009
Mysqli_queries0.720391.20582000.0036
Looping result0.00180.23251980.0000
Template Total0.762296.520.3811
Template load0.00210.269120.0011
Template processing0.760196.249620.3801
Template load and register function0.00010.012210.0001
states
state_id_array0.00100.128010.0010
state_identifier_array0.00090.107920.0004
Override
Cache load0.00190.2344350.0001
Sytem overhead
Fetch class attribute can translate value0.00100.128640.0003
Fetch class attribute name0.00110.133470.0002
XML
Image XML parsing0.00170.219840.0004
class_abstraction
Instantiating content class attribute0.00000.002280.0000
General
dbfile0.00180.2275410.0000
String conversion0.00000.000530.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
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
4content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
4content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
6content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
4content/datatype/view/ezxmltags/link.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/link.tplEdit templateOverride template
4content/datatype/view/ezxmltags/li.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/li.tplEdit templateOverride template
2content/datatype/view/ezxmltags/ul.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/ul.tplEdit templateOverride template
1content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 27
 Number of unique templates used: 9

Time used to render debug report: 0.0002 secs