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

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 31 2025 06:16:00
Script start
Timing: Jan 31 2025 06:16:00
Module start 'layout'
Timing: Jan 31 2025 06:16:00
Module start 'content'
Timing: Jan 31 2025 06:16:00
Module end 'content'
Timing: Jan 31 2025 06:16:00
Script end

Main resources:

Total runtime0.0104 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0040 588.1250151.2109
Module start 'layout' 0.00400.0017 739.335936.6328
Module start 'content' 0.00570.0036 775.968898.1094
Module end 'content' 0.00930.0011 874.078137.9922
Script end 0.0104  912.0703 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.001918.4638140.0001
Check MTime0.00098.6053140.0001
Mysql Total
Database connection0.00065.754410.0006
Mysqli_queries0.001716.197230.0006
Looping result0.00000.086710.0000
Template Total0.00087.910.0008
Template load0.00076.242910.0007
Template processing0.00021.588710.0002
Override
Cache load0.00044.279810.0004
General
dbfile0.00021.858080.0000
String conversion0.00000.047940.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_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