FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


Calendar





hcaracol
Hi,
I wants to put one calendar in my site that it's possible to add some topic in one day and then those day appears in bold, how can i do this
rickylau
hcaracol wrote:
Hi,
I wants to put one calendar in my site that it's possible to add some topic in one day and then those day appears in bold, how can i do this
All you need are
  • date function
  • mktime function
  • database manipulation functions


The date and mktime functions give you all necessary information about calendar:
Code:
date ('t', $timestamp) // This gives you the number of days in the month $timestamp is at

//These give you the week day of the given $timestamp
date ('D', $timestamp) // returns "Mon" - "Sun"
date ('l', $timestamp) // (l = lowercase 'L') returns "Monday" - "Sunday"
date ('N', $timestamp) // returns 1 for Monday - 7 Sunday
date ('w', $timestamp) // returns 0 for Sunday - 6 Saturday
With those function calls it is not difficult to render a calendar

For the database part, as I see in your post, you need 2 fields in the table, timestamp (or a string expression of date in form like YYYYMMDD) and topic. While rendering the calendar, if a date exists in the table, simply add the bold tag around the date.
Related topics
Calendar with PHP
phpMyAdmin + calendar
PHP Calendar Bug
Generating a Calendar in HTML
Simple (but not too simple) calendar in php
Calendar Reform
PSA: Google Calendar (with SMS reminders!)
Will work for FRIH$
Bill Calendar 1.0
Help me for a dynamic calendar
Google calendar
The best mobile Phone
Requesting a free calendar program
Simple Calendar script
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.