Forums / General / Suscribing to a course #2

Suscribing to a course #2

Author Message

Thomas Schamm

Saturday 11 October 2003 2:45:56 pm

I'm still confronted with one problem:
I want a user, who is logged in, to suscribe to a course. For doing that, Eirik Johansen told me, i should use the "placements of object" feature. I think he means, that i should create a node of the user under the course object. Doing this manually in the admin interface works, but i still don't know, how to do this with only one click.

I am searching for a code (in my template), i think this should be a form, where i can provide a button for the user, and if he clicks, his node should be placed under the courseobject where he is in. What i already know is the $current_user.contentobject.id and the $node.node_id, where the copy of the user should be copied to.

What i don't know, is the code for the form, and if it is possible to create a new node without getting through the 'create a new draft' ...

Thank you very much, Thomas

ps: the first topic where eirik helped me you find http://ez.no/developer/ez_publish_3/forum/developer/suscribing_to_a_course . I don't publish my question there, because i think it's not a developer question anymore.

Thomas Schamm

Tuesday 14 October 2003 1:39:23 pm

I'm afraid i will jump out of the window the next moment ... I don't get this thing working :-(
What i found out in
http://www.ez.no/developer/ez_publish_3/forum/developer/pass_additional_information_to_cart
is the possibility to bring back my $setCourseID variable in the template, but i don't get it working with the user/edit module.

If i am thinking correct, the /user/edit.php calls the /content/edit.php, and i want to take my variable from the <input type="hidden" name="setCourseID" ...> in my template file through the user/edit.php to content/edit.php and then use {$setCourseID} in my content/edit.tpl file to show my variable there.

Can someone help me here??
Kind Regards, Thomas

Thomas Schamm

Wednesday 15 October 2003 4:16:16 pm

Another try doesn't work:
My course.tpl File has a form and should transfer the $node.node_id to the /content/edit.tpl. I try it this way:

<input type="hidden" name="setCourseID" value="{$node.node_id}" />

I stored my setCourseID in my user/edit.php in a session variable:

if ( $Module->isCurrentAction( "Edit" ) )
{
if ( $http->hasPostVariable( 'setCourseID' ) )
{
$setCourseID = $http->postVariable( 'setCourseID' );
$http->setSessionVariable( 'setCourseID', $setCourseID );
$Module->redirectTo( '/content/edit/' . $UserID );
return;
}
else
{
$Module->redirectTo( '/content/edit/' . $UserID );
return;
}
}

Then, i added these Lines to user/attribute_edit.php:

if ( $http->hasSessionVariable( 'setCourseID' ) )
{
$setCourseID = $http->sessionVariable( 'setCourseID' );
$tpl->setVariable( 'setCourseID', $setCourseID );
}

But i still don't get any attribute in /content/edit.tpl with {$setCourseID}

eZ debug

Timing: Jan 18 2025 11:23:03
Script start
Timing: Jan 18 2025 11:23:03
Module start 'content'
Timing: Jan 18 2025 11:23:04
Module end 'content'
Timing: Jan 18 2025 11:23:04
Script end

Main resources:

Total runtime1.4355 sec
Peak memory usage4,096.0000 KB
Database Queries192

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0070 588.8203180.8438
Module start 'content' 0.00711.3062 769.6641449.0313
Module end 'content' 1.31330.1221 1,218.6953333.8125
Script end 1.4354  1,552.5078 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00430.2988210.0002
Check MTime0.00150.1039210.0001
Mysql Total
Database connection0.00060.043010.0006
Mysqli_queries1.366595.19851920.0071
Looping result0.00190.13151900.0000
Template Total1.398497.420.6992
Template load0.00220.155420.0011
Template processing1.396197.259720.6981
Template load and register function0.00010.010410.0001
states
state_id_array0.00120.086110.0012
state_identifier_array0.00290.203320.0015
Override
Cache load0.00190.1306440.0000
Sytem overhead
Fetch class attribute can translate value0.00160.114320.0008
Fetch class attribute name0.00120.083930.0004
XML
Image XML parsing0.00040.028820.0002
class_abstraction
Instantiating content class attribute0.00000.000530.0000
General
dbfile0.00290.2000210.0001
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
3content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
6content/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
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 17
 Number of unique templates used: 5

Time used to render debug report: 0.0001 secs