|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Further Explaination about calendar source code
Is there anyway i can get more explaination about the calendar source code,since i am new in php, so i am now having some problem in understanding the code.thx
|
|
#2
|
|||
|
|||
|
RE: Further Explaination about calendar source code
WHat would you like to know?
We can answer specific questions, but a detailed explanation of how the wholde thing works is really not possible. |
|
#3
|
|||
|
|||
|
RE: Further Explaination about calendar source code
I would like to know what is the function of the start time and end time? Is that refer to the time duration of the event?
Besides, what is the function of all day event check box?Antway thx in advance. |
|
#4
|
|||
|
|||
|
RE: Further Explaination about calendar source code
Start_time and end_time define what time the events starts & ends. If the meeting runs from 7:00pm to 9:00pm, the start_time is 7:00pm and the end_time is 9:00pm. The start_time is used in the "ORDER BY" clause of the SQL query so the events ge listed from earliest to latest as they occur during the day.
(Note, times are stored in the database in 24hr format). The "All Day event" checkbox allows you to define an event with no start or end time. For example, on web site I run, our group camps once a month, We leave Friday at 6:00pm, are there "All Day" Saturday, and return sometime Sunday. Since the current version of the calendar does not support multiple day events, I create one for Friday (starting at 6:00pm), and "all day events" for Saturday & Sunday, so they show up on the calendar, butthey don't really have start or stop times I want to display. The day_event column in the DB is also part of the "ORDER BY" SQL query for pulling events from the database. Does this help? |
|
#5
|
|||
|
|||
|
Urgent
Can i know which part of the source code carry the task of calculating how many days in a month and how it know what is the first day of the month?
Any function calculating about it in the source code? or any built in function to straight away generate it? N can any one explain how it function/work? thx lot...really need help |
|
#6
|
|||
|
|||
|
RE: Further Explaination about calendar source code
The day of the week that is the first day of the month is calculated as follows:
1)In the CLASS constructor for ltwCalendar(~line 417): $this->first_day_of_month = $this->_firstDayOfMonth($timestamp); function _firstDayOfMonth($timestamp) { return $this->_dayOfWeek(mktime( 12, 12, 12, $this->month, 1, $this->year)); } function _dayOfWeek($timestamp) { return intval(strftime("%w",$timestamp)); } |
|
#7
|
|||
|
|||
|
correction?
ERm. 1stly thx for the info... so, this means the time() in the calendar.php will return the current timestamp and pass as parameter to the dayOf week n firstDayOf Month function to gererate the first day of the month? correct?but y put mktime parameter as ( 12,12,12.....)?
and for the 3 table that create in install.php..do they have any relationship to each and other such as 1-to-1 realionship?n wat is the minimum size of the database require to store the data? and what is the maximum size? lastly, for the event database , what is the use of "recurring", "recur_day of week"? y the attribute use tinyint? Any way thx for the help. |
|
#8
|
|||
|
|||
|
RE: Further Explaination about calendar source code
1) mktime()
The first three args are the hour, minute and second for timestamp being created. Since we are making a timestamp where we only care about the date, these are arbitrary numbers representing the middle of the day. Thes could just as easily be 1,1,1 or 10,10,10. 2) 'recurring' is used to represent an event that repeats every week on day 'recur_dayofweek'. Its an easy way to create an event that happens at the same time every Monday (for example). 3)use of tinyint() Saves space since 'recurring' is really a Boolean and 'recur_dayofweek' is a number between 0 and 6. 4) There are no established 'relationships' in the database. 5) Database minimum size -s ~ 50k (on my system), which includes the required mysql & the calendar db's. Refer to the mysql documentation for maximum sizes on dbs. |
|
#9
|
|||
|
|||
|
RE: Further Explaination about calendar source code
Eh, I posted the last response, just wasn't logged in...
|
|
#10
|
|||
|
|||
|
Erm....
ERm. 1stly thx for the info... so, this means the time() in the calendar.php will return the current timestamp and pass as parameter to the dayOf week n firstDayOf Month function to gererate the first day of the month?
so am i correct for the statement above?anyway...really appreciate the help...thx specially to prrk47002 . |
|
#11
|
|||
|
|||
|
RE: Further Explaination about calendar source code
Yes,
_firstDayOfMonth(time()) will tell you the numeric value (Sun=0) that the first day of the current month is. |
|
#12
|
|||
|
|||
|
ERM....
is that by using the crypt(...) , the user password will be crypt?
then y we use the set cookie("ltw","$uname:$secret)? Actually y the php code mainly use pointer access the function? lastly, in what situation is consider"BAD TIME"? thx lot... |
|
#13
|
|||
|
|||
|
RE: Further Explaination about calendar source code
is that by using the crypt(...) , the user password will be crypt?
=> The password is encrypted to make storing it more secure. Unencrypted passwords in a database are always a bad idea. then y we use the set cookie("ltw","$uname:$secret)? =>Another 'security' thing. Each function that requires you to login checks the cookie is set. Otherwise, anybody could call calendar.php?display=admin&task=add and put new events in the calendar, or worse yet delete them. Actually y the php code mainly use pointer access the function? ->I'm not sure what you mean. lastly, in what situation is consider"BAD TIME"? -> It is when the event's end_time < the start_time. |
|
#14
|
|||
|
|||
|
RE: Further Explaination about calendar source code
last post was me, not logged in.
|
|
#15
|
|||
|
|||
|
RE: Further Explaination about calendar source code
what is the different between display function, displayDay function?
the display event function is to display the events details for the small browser when date is click? thx lot.... |
![]() |
| Viewing: Codewalkers Forums > Projects > ltwCalendar > Further Explaination about calendar source code |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|