New datatype for users

Author Message

David Engelmark

Tuesday 07 August 2007 6:39:51 am

Hi im trying to make a new datatype that will be called Credits and it will exists in the User class and i want a extension that will be able to increse tills datatype what whould the best practice to implent this be? Im not very expreinced with Ez publish so i really don't know where to start and i want to implent it so smooth as posibly with ez publish and also is therer any other place to look for documententions/tuturials other than the main documentations?

Felix Laate

Tuesday 07 August 2007 12:17:54 pm

Hi David,

if I understand you correct, you want your user-class to have an attribute (Credits) of type number. This is easily done in the admin-interface.

Now, you can make an extension that consists of (at least) an template operator that increments the attribute.

See http://ez.no/community/forum/developer/how_to_update_an_attribute_of_an_object_with_php/re_how_to_update_an_attribute_of_an_object_wit__7 for some advice on manipulating an object with PHP.

See http://ez.no/community/contribs/template_plugins for examples of such extensions.

Felix

Publlic Relations Manager
Greater Stavanger
www.greaterstavanger.com

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 20:55:56
Script start
Timing: Jan 18 2025 20:55:56
Module start 'layout'
Timing: Jan 18 2025 20:55:56
Module start 'content'
Timing: Jan 18 2025 20:55:57
Module end 'content'
Timing: Jan 18 2025 20:55:57
Script end

Main resources:

Total runtime1.2931 sec
Peak memory usage4,096.0000 KB
Database Queries54

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0081 587.9063152.6250
Module start 'layout' 0.00810.0038 740.531339.4297
Module start 'content' 0.01191.2796 779.9609517.8281
Module end 'content' 1.29160.0015 1,297.78918.1875
Script end 1.2930  1,305.9766 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00360.2747160.0002
Check MTime0.00140.1102160.0001
Mysql Total
Database connection0.00120.091510.0012
Mysqli_queries1.248296.5323540.0231
Looping result0.00050.0405520.0000
Template Total1.256497.220.6282
Template load0.00200.151420.0010
Template processing1.254497.007920.6272
Template load and register function0.00020.012810.0002
states
state_id_array0.00120.092310.0012
state_identifier_array0.00160.127020.0008
Override
Cache load0.00160.1205120.0001
Sytem overhead
Fetch class attribute can translate value0.00070.050420.0003
Fetch class attribute name0.00130.098330.0004
XML
Image XML parsing0.00060.043020.0003
class_abstraction
Instantiating content class attribute0.00000.000630.0000
General
dbfile0.00180.1418160.0001
String conversion0.00000.000940.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/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
2content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 7
 Number of unique templates used: 5

Time used to render debug report: 0.0001 secs