ltwCalendar
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsProjectsltwCalendar

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
  #1  
Old July 15th, 2003, 06:54 AM
cshiyuan cshiyuan is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: malaysia
Posts: 19 cshiyuan User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via Yahoo to cshiyuan
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

Reply With Quote
  #2  
Old July 15th, 2003, 12:05 PM
prrk47002 prrk47002 is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Pennsylvania
Posts: 275 prrk47002 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 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.

Reply With Quote
  #3  
Old August 9th, 2003, 01:31 AM
cshiyuan cshiyuan is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: malaysia
Posts: 19 cshiyuan User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via Yahoo to cshiyuan
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.

Reply With Quote
  #4  
Old August 9th, 2003, 09:01 PM
prrk47002 prrk47002 is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Pennsylvania
Posts: 275 prrk47002 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
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?

Reply With Quote
  #5  
Old August 21st, 2003, 04:44 AM
cshiyuan cshiyuan is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: malaysia
Posts: 19 cshiyuan User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via Yahoo to cshiyuan
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

Reply With Quote
  #6  
Old August 21st, 2003, 09:45 AM
prrk47002 prrk47002 is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Pennsylvania
Posts: 275 prrk47002 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
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));
}

Reply With Quote
  #7  
Old August 22nd, 2003, 03:04 AM
cshiyuan cshiyuan is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: malaysia
Posts: 19 cshiyuan User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via Yahoo to cshiyuan
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.

Reply With Quote
  #8  
Old August 22nd, 2003, 09:56 AM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
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.

Reply With Quote
  #9  
Old August 22nd, 2003, 10:04 AM
prrk47002 prrk47002 is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Pennsylvania
Posts: 275 prrk47002 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
RE: Further Explaination about calendar source code

Eh, I posted the last response, just wasn't logged in...

Reply With Quote
  #10  
Old August 22nd, 2003, 11:43 PM
cshiyuan cshiyuan is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: malaysia
Posts: 19 cshiyuan User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via Yahoo to cshiyuan
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 .

Reply With Quote
  #11  
Old August 24th, 2003, 06:25 PM
prrk47002 prrk47002 is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Pennsylvania
Posts: 275 prrk47002 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
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.

Reply With Quote
  #12  
Old August 26th, 2003, 07:35 AM
cshiyuan cshiyuan is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: malaysia
Posts: 19 cshiyuan User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via Yahoo to cshiyuan
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...

Reply With Quote
  #13  
Old August 27th, 2003, 09:45 AM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
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.

Reply With Quote
  #14  
Old August 27th, 2003, 09:52 AM
prrk47002 prrk47002 is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Pennsylvania
Posts: 275 prrk47002 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
RE: Further Explaination about calendar source code

last post was me, not logged in.

Reply With Quote
  #15  
Old August 29th, 2003, 07:32 AM
cshiyuan cshiyuan is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: malaysia
Posts: 19 cshiyuan User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via Yahoo to cshiyuan
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....

Reply With Quote
Reply

Viewing: Codewalkers ForumsProjectsltwCalendar > Further Explaination about calendar source code


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump