Forums / Developer / How add another parent node to user object

How add another parent node to user object

Author Message

Matej Ukmar

Monday 12 April 2004 11:34:05 am

I am building web portal, where users have expiration time... I mean after 30 days their account expires.

I was thinking to assign or remove to user an extra user group which would tell if user is allowed to enter the portal. (This User goroup is linked to a portal user role)

The problem is I dont know how. I was trying with

	$newNode=eZContentObjectTreeNode::addChild( $user->attribute( 'contentobject_id' ), 12, true);

New node (of current user object) was created but it did not appear in the admin interface under the requested user group (id=12)

Maybe I just need to publish newly created node... I dont know how... I am a little confused, can anybody help.

And maybe there is also another more appropriate aproach to my user expiration problem.

Please help.

Thanx
Matey

Björn Dieding@xrow.de

Monday 12 April 2004 9:57:06 pm

there is a little more to it

try this code

function & copyto (& $object,$node){
	$nodeAssignment =& eZNodeAssignment::create( array
		    	(
                  'contentobject_id' => $object->attribute( 'id' ),
                  'contentobject_version' => $object->attribute( 'current_version' ),
                  'parent_node' => $node,
                  'is_main' => 0
                 )
            );
    $nodeAssignment->store();
    #die("Here2".$node);
    $treenodegewerk = & eZContentObjectTreeNode::addChild($object->attribute( 'id' ),$node,true);
	$operationResult = eZOperationHandler::execute(
									'content', 'publish', array( 
									'object_id' => $object->attribute( 'id' ),
									'version' => $object->attribute( 'current_version' ) ) );
	 return eZContentObjectTreeNode::findNode($node,$object->attribute('id'),true); 
}

Looking for a new job? http://www.xrow.com/xrow-GmbH/Jobs
Looking for hosting? http://hostingezpublish.com
-----------------------------------------------------------------------------
GMT +01:00 Hannover, Germany
Web: http://www.xrow.com/

Matej Ukmar

Tuesday 13 April 2004 12:55:03 pm

Bjorn thanks,
this helps a lot... and it works!!! :-)

I have just one more little question.
If I want to remove a node is it enough just to use

eZContentObjectTreeNode::remove(...

or is there also some extra "coding" to be done?

Regards,
Matey

Dominik Pich

Thursday 22 April 2004 1:32:15 am

Remove its assignments first... ?

eZ debug

Timing: Jan 19 2025 04:31:47
Script start
Timing: Jan 19 2025 04:31:47
Module start 'content'
Timing: Jan 19 2025 04:31:47
Module end 'content'
Timing: Jan 19 2025 04:31:47
Script end

Main resources:

Total runtime0.6797 sec
Peak memory usage4,096.0000 KB
Database Queries199

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0070 589.0859180.8125
Module start 'content' 0.00700.5413 769.8984591.0547
Module end 'content' 0.54830.1313 1,360.9531337.3672
Script end 0.6796  1,698.3203 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00380.5625210.0002
Check MTime0.00140.2058210.0001
Mysql Total
Database connection0.00100.145610.0010
Mysqli_queries0.606489.21001990.0030
Looping result0.00220.31761970.0000
Template Total0.652896.020.3264
Template load0.00240.353920.0012
Template processing0.650495.683520.3252
Template load and register function0.00020.022710.0002
states
state_id_array0.00060.088910.0006
state_identifier_array0.00080.116220.0004
Override
Cache load0.00170.2568290.0001
Sytem overhead
Fetch class attribute can translate value0.00140.199740.0003
Fetch class attribute name0.00200.295150.0004
XML
Image XML parsing0.00110.158540.0003
class_abstraction
Instantiating content class attribute0.00000.001550.0000
General
dbfile0.00350.5095270.0001
String conversion0.00000.001130.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/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
9content/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
4content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 23
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs