PDA

View Full Version : Get variable from the programm


qenq
12-01-2007, 01:08 AM
Hi there,

first of all, the easyphpcalender is terrific!

I was wondering if i could use it to check if an specific date which someone on my website enters, is an date that is in the eventslist.

I tried to read out the $DF variable, but it did not work.

Can anyone tell me, if there is an possibility to check if an date entered by an user (for example 02.12.2007) is in the event list with an event?

I made a form where the user can enter a date, now i want to look if there is an event there and if there is an event i want to make an alert.

Thank you in advantage.
QenQ

ve9gra
12-02-2007, 11:09 AM
$DF is for "Date Format" which is what you use to format how you want the date to be displayed on the List.

There's nothing implemented that will allow you to do that "easily". The way that I've managed that is by using the Blog mode. The Blog mode can single out a day and uses a list too. What I did is by checking the output of the list side, I could tell whether an event was displayed or not. You have to create your own list template (based off of blog.php) and use output buffering to be able to parse out the output.

qenq
12-13-2007, 02:47 PM
Hi Ve9gra,

i see, do you have an php example on how you worked it out? It would multiple the use of the calendar. We are thinking to buy more licenses, but i have to implant this feature in our software.

Would be nice if i could have an helping hand.

Regards
QenQ

ve9gra
12-13-2007, 04:28 PM
I used it once on a site for catering (I think - foreign language) where someone could only make reservations on days where there wasn't already something planned.

Basically, the way it works is by using the Blog mode. Using the Blog template, you check to see if the output says "There is no event...". If that shows up, you display the form for someone to do a reservation. If there is an event, then the event is shown and you give a message saying "Sorry, this date is reserved".

Not really hard, but you have to know how to use output buffering (ob_start and ob_get_clean).

As the previous implementation was for a paying client, I cannot provide this solution for free. You can contact me using the link below to work out the details.