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.