main node id of the user

Author Message

Mazen Alsibai

Saturday 12 November 2005 4:38:22 am

Hi:
how can i get the main node id of the user if i have user id?
thanks

Clemens T

Saturday 12 November 2005 7:51:20 am

Do this in your template:

{def $userid=14}
{def $user=fetch('user', '$userid')}
TheUserID:{$user.contentobject.node_id}
{undef $user}
{undef $userid}

If I'm not right try this, so you can look for the node_id:

{def $userid=14}
{def $user=fetch('user', '$userid')}
UserObject:{$user|attribute(show,2)}
{undef $user}
{undef $userid}

greets,
Clemens
ps: hope it helps

Kristof Coomans

Wednesday 16 November 2005 12:15:58 am

The user's ID is the ID of the user's content object:

{def $userid=14}
{def $userobject=fetch( 'content', 'object', hash( 'object_id', $userid ) )}
Main node id: {$userobject.main_node_id}
{undef $userobject}
{undef $userid}

If you want to have the main node instead of the main node's ID, then you can use <i>$userobject.main_node</i>.

independent eZ Publish developer and service provider | http://blog.coomanskristof.be | http://ezpedia.org

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 19:22:42
Script start
Timing: Jan 18 2025 19:22:42
Module start 'layout'
Timing: Jan 18 2025 19:22:42
Module start 'content'
Timing: Jan 18 2025 19:22:42
Module end 'content'
Timing: Jan 18 2025 19:22:42
Script end

Main resources:

Total runtime0.6665 sec
Peak memory usage4,096.0000 KB
Database Queries59

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0069 590.0781152.6250
Module start 'layout' 0.00700.0039 742.703139.4453
Module start 'content' 0.01080.6541 782.1484568.1563
Module end 'content' 0.66500.0015 1,350.30478.4766
Script end 0.6665  1,358.7813 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00370.5564160.0002
Check MTime0.00140.2102160.0001
Mysql Total
Database connection0.00170.257910.0017
Mysqli_queries0.610891.6458590.0104
Looping result0.00060.0953570.0000
Template Total0.622593.420.3113
Template load0.00220.329920.0011
Template processing0.620393.065120.3101
Template load and register function0.00030.038610.0003
states
state_id_array0.00170.254810.0017
state_identifier_array0.00090.132620.0004
Override
Cache load0.00180.2651190.0001
Sytem overhead
Fetch class attribute can translate value0.00110.158730.0004
Fetch class attribute name0.00230.341840.0006
XML
Image XML parsing0.00210.316730.0007
class_abstraction
Instantiating content class attribute0.00000.002040.0000
General
dbfile0.00180.2754160.0001
String conversion0.00000.001340.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
3content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
2content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
6content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
3content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.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: 17
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs