Forums / Developer / extending user class

extending user class

Author Message

Vivek Chopra

Wednesday 31 March 2004 4:17:13 pm

I need some help in extending the user class. I am extending the user class to add the address in the user registration form. I added Address as a text field. It shows up ok on the form and stores the data as well. But it doesn't add those fields to the emails.

I want to include the user name and the address in the feedback and confirmation emails.

Need some guidance.
I am on eZ3.3

TIA,

Vivek

Eirik Alfstad Johansen

Thursday 01 April 2004 4:43:18 am

Hi Vivek,

For this purpose, you need to make an override of the user/registrationinfo.tpl template where you include the address info.

Sincerely,

Eirik Johansen

Sincerely,

Eirik Alfstad Johansen
http://www.netmaking.no/

Vivek Chopra

Thursday 01 April 2004 8:20:29 am

Hi Eirik,

Thanks for your reply. I understand that I need to override the registrationinfo.tpl and registrationfeedback.tpl files. But the question is how do I call the address value in these templates.
The login is called by user.login and email by user.email. I have dumped all the attributes and thier values for user variable. The address attribute is not present in the user variable. I am guessing the address is being stored in $contentobject_attribute array in the user variable.
How do I get the value in the template files.

Thanks again
Vivek

Paul Forsyth

Thursday 01 April 2004 8:43:12 am

Would this tutorial be of use?

http://ez.no/ez_publish/documentation/incoming/tutorial_using_userregister

It was written a while ago but it still works fine for 3.3 :)

paul

Vivek Chopra

Thursday 01 April 2004 10:55:06 am

I read this tutorial but didn't find it of much help. register.tpl doesn't need to be overridden since the new fields show up fine without overriding the templates.

I didn't understand the ezurl.tpl modifications in the tutorials.

Vivek

Vivek Chopra

Friday 02 April 2004 10:15:36 am

Finally figured it out.

Thanks for all your help.

Vivek

Iain MacLean

Saturday 03 April 2004 2:59:27 am

Hi Vivek

I've been trying to figure this out myself. How did you do it?

Regards

Iain

Vivek Chopra

Thursday 08 April 2004 11:26:56 am

I didn't have to override register.tpl as mentioned in the tutorial. I did override the registrationfeedback.tpl which sends out the email.

I called the newly added fields in the user class as:
Address:{attribute_view_gui attribute=$user.contentobject.data_map.address}.

Hope this helps.

Now the question is, I am adding forum on my site and users need to register for that. Can I have different signup form/user class for that?

Vivek

eZ debug

Timing: Jan 31 2025 04:22:03
Script start
Timing: Jan 31 2025 04:22:03
Module start 'content'
Timing: Jan 31 2025 04:22:03
Module end 'content'
Timing: Jan 31 2025 04:22:03
Script end

Main resources:

Total runtime0.1216 sec
Peak memory usage2,048.0000 KB
Database Queries141

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0055 587.8281180.8438
Module start 'content' 0.00550.0047 768.671997.8359
Module end 'content' 0.01020.1113 866.5078526.2344
Script end 0.1216  1,392.7422 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00302.4811200.0002
Check MTime0.00120.9684200.0001
Mysql Total
Database connection0.00070.587010.0007
Mysqli_queries0.079965.72311410.0006
Looping result0.00090.77811390.0000
Template Total0.111091.310.1110
Template load0.00070.587810.0007
Template processing0.110390.694110.1103
Override
Cache load0.00050.421810.0005
Sytem overhead
Fetch class attribute can translate value0.00050.438810.0005
XML
Image XML parsing0.00030.235010.0003
General
dbfile0.00776.3117200.0004
String conversion0.00000.004130.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
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/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