Forums

Joomla Non profit school site

r2ks 02 Apr, 2009
Hello every one🙂
I am trying to develop a Pledge area on my sons school website which is non profit which is in Joomla

Ok we have a program each year which is a Golf tournament each Golfer goes out and gets pledges what they want is to have the Golfers login and track there own pledges but have a admin able to sign in and see all pledges.

i have created a table in the Joomla data base called jos_pledges
fields ==
id , firstname , lastname , street , city, state , phone , email , pledgeamount , userid
the userid -field is the person that is loged in createing the pledge ??
I am not a data base programer and new to alot of this

am i on the right path or way Off ??? please help
GreyHead 02 Apr, 2009
Hi r2ks,

Looks good to me

Bob
r2ks 02 Apr, 2009
Bob,
Thank you for responding i have read some of the stuff on here from you. Great stuff !

I hope this make since what i am going to write.
say i login and i go to the area to in put my pledge info how would i get the user id field populated with the logged in user.

does joomla use $session or $cookie to trap the logged in user ??
so i login goto the form fill in all the pledge info hit submit it populates the data base i know i would have to create a hidden field and populate it with the $session varible ??? i think
Thanks dan
GreyHead 02 Apr, 2009
Hi dan,

The current user is always available as a user object:
<?php
$user =& JFactory::getUser();
echo $user->id;
echo $user->name;
. . .
?>
That's by far the easiest way of accessing it.

Bob

PS It is also in the session but why bother.
r2ks 02 Apr, 2009
lol i just found the same info🙂 thanks so much
i tried to create a new artical and place the code in it does not give the ability for php code ???
GreyHead 02 Apr, 2009
Hi dan,

No, normal Joomla articles do not take PHP - just HTML/CSS. Mostly that's for security reasons.

Bob
r2ks 03 Apr, 2009
Bob,
this is interesting i noticed that i can use PhP in chrono forms,
Again thanks for your Help i am working on that form Page right know.
Dan
This topic is locked and no more replies can be posted.