Forums / Developer / Suscribing to a course

Suscribing to a course

Author Message

Thomas Schamm

Thursday 09 October 2003 4:15:37 pm

Hi everybody,
after doing some basic work with ezp 3.2 for a few weeks now, i'm getting to a point where i need (again) some help:

I'm going to create a site for a skiing club. There i want to publish courses (this works), i want the users to create their own account (works too) and, if they are logged in, give them the possibility to sign in to a course (what is not working yet). The course has participant limit, which should be a constant minus the number of persons already signed in. The user should see in his details, to which courses he has inscribed. And, at least, I should see, which course has which participant.
For this i am using a class 'course' and a class 'participant'.

My Question is: Do i have create a new module for this? Or is it possible to create such a sign-in process with build-in functions of ezp? How do i have to start? Perhaps you can give me a hint.

Thanks a lot, greetings from Karlsruhe, Thomas

Eirik Alfstad Johansen

Friday 10 October 2003 3:05:18 am

Hi Thomas,

How about using the "placements of object" feature? Then you could just place the user under each course he/she's subscribing to. For the user to be able to subscribe to courses, he/she has to be able to edit his/her own account, which is the object in this case.

Just my 2 cents.

Sincerely,

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

Thomas Schamm

Friday 10 October 2003 11:09:21 am

Hi Eirik,
i'm not sure, if i understand your advice. Do you mean with "placements of object", that the user, when he suscribes to a course, would create a node of his own user account and this node will be placed under the course he suscribes in? Thanks for your advice, i will try out with it. If you meant another method, i would be thankful, if you could tell me!
But i'm thinking about the code for creating a new node in a special directory. The code must contain the user id, the node id of the object where the new node is copied to and the node id of the object itself. Can someone help me with this?
Is there a special command for creating nodes and directly coping them under a specific object?

Thank you, Thomas

Eirik Alfstad Johansen

Sunday 12 October 2003 4:48:27 am

Hi Thomas,

[quote]Do you mean with "placements of object", that the user, when he suscribes to a course, would create a node of his own user account and this node will be placed under the course he suscribes in?[/quote]

That's exactly what I meant. Sorry if my post was a little unclear.

On the code part, I think you would come a long way by examining the "placements part" of the admin template for editing an object.

Good luck !

- Eirik

Sincerely,

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

Thomas Schamm

Sunday 12 October 2003 4:43:14 pm

That's exactly what i'm doing the last three days :-)
I'm quite new to ezp, so i have difficulties understanding every part of the module system. I saw, that there is a possibility in /content/edit_placement.tpl to define the folder where the node should be placed, but i have troubles 'transporting' the course_id through the 'edit-form' from my course page to the edit page, where i then want to define the folder.

I have created a <input type="hidden" name="SetCourseID" value="{$node.node_id}" />, and i get the $SetCourseID in the /user/edit.php (it is a user node, which must be copied) with $setCourseID = $http->postVariable( 'SetCourseID' );

But as the 'SetCourseID' is not used in edit.php, i'm not knowing how to get the value of the $SetCourseID back in the edit.tpl

So if one can show me the command, how to store the $SetCourseID (perhaps throug a session command?!) back in a template variable, i would be very very thankful!!

Greetings, Thomas

Thomas Schamm

Tuesday 14 October 2003 3:25:38 pm

Ok, i am getting angry with this now.
I found the command for viewing the value of $setCourseID in the template, but only in the /user/edit.tpl, and i must get it in the /content/edit.tpl.
How can i transfer a custom variable $setCourseID from the user/edit.php to the content/attribute_edit.php ???
I tried it with almost everything, and i'm loosing my patience now :-/
There must be some way, but i don't know, if doing this over $module, $..., ??!?!

Please help, i would be so thankful!! Thomas

eZ debug

Timing: Jan 18 2025 19:26:59
Script start
Timing: Jan 18 2025 19:26:59
Module start 'content'
Timing: Jan 18 2025 19:26:59
Module end 'content'
Timing: Jan 18 2025 19:27:00
Script end

Main resources:

Total runtime0.8888 sec
Peak memory usage4,096.0000 KB
Database Queries203

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0075 588.8047180.8438
Module start 'content' 0.00750.7242 769.6484580.0859
Module end 'content' 0.73170.1570 1,349.7344341.3984
Script end 0.8887  1,691.1328 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00420.4731210.0002
Check MTime0.00160.1764210.0001
Mysql Total
Database connection0.00080.085710.0008
Mysqli_queries0.809791.10592030.0040
Looping result0.00240.26542010.0000
Template Total0.857696.520.4288
Template load0.00200.223520.0010
Template processing0.855696.271520.4278
Template load and register function0.00020.016910.0002
states
state_id_array0.00080.090810.0008
state_identifier_array0.00080.089920.0004
Override
Cache load0.00170.1948420.0000
Sytem overhead
Fetch class attribute can translate value0.00210.238730.0007
Fetch class attribute name0.00110.118570.0002
XML
Image XML parsing0.00100.111730.0003
class_abstraction
Instantiating content class attribute0.00000.001780.0000
General
dbfile0.00320.3622270.0001
String conversion0.00000.000930.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
6content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
5content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
7content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
2content/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: 22
 Number of unique templates used: 6

Time used to render debug report: 0.0002 secs