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


Simple Calendar script





joostvane
Hello,

I am looking for a simple calendar I can add to my site. I went to do some googling, but most of the calendars out there are WAY too advanced for my use.

What I basicly need is a calendar (monthly calendar) that lists all the days of the month. I should be able to add events, that will make the date look colored on the calendar. If people would click on the date, they would be redirected to a page I costumly made.

If anyone got any suggestions of websites with scripts/what would the best way to do it, please let me know!
jmraker
Not knowing what's too advanced for you I would suggest using a calendar class, like from
http://phpclasses.ranchoweb.com/browse/package/1616.html

http://www.google.com/custom?domains=www.phpclasses.org&q=calendar&sa=Search&sitesearch=www.phpclasses.org

and entering the events into a database

I made my first calendar a few weeks ago by moving an old calendar function into a class and hacked on selecting a week onto it. http://nationalspeedsportnews.com/schedule.php
Damascus_Steel
Try this


Code:

<?
if(isset($prm) and $prm > 0){
$m=$prm+$chm;}else{
$m= date("m");}

$d= date("d");     // Finds today's date
$y= date("Y");     // Finds today's year

$no_of_days = date('t',mktime(0,0,0,$m,1,$y)); // This is to calculate number of days in a month

$mn=date('M',mktime(0,0,0,$m,1,$y)); // Month is calculated to display at the top of the calendar

$yn=date('Y',mktime(0,0,0,$m,1,$y)); // Year is calculated to display at the top of the calendar

$j= date('w',mktime(0,0,0,$m,1,$y)); // This will calculate the week day of the first day of the month

for($k=1; $k<=$j; $k++){ // Adjustment of date starting
$adj .="<td>&nbsp;</td>";
}

/// Starting of top line showing name of the days of the week

echo " <table border='1' bordercolor='#FFFF00' cellspacing='0' cellpadding='0' align=center>

<tr><td>";

echo "<table cellspacing='0' cellpadding='0' align=center width='100' border='1'><td align=center bgcolor='#ffff00'><font size='3' face='Tahoma'> <a href='php_calendar.php?prm=$m&chm=-1'><</a> </td><td colspan=5 align=center bgcolor='#ffff00'><font size='3' face='Tahoma'>$mn $yn </td><td align=center bgcolor='#ffff00'><font size='3' face='Tahoma'> <a href='php_calendar.php?prm=$m&chm=1'>></a> </td></tr><tr>";

echo "<td><font size='3' face='Tahoma'><b>Sun</b></font></td><td><font size='3' face='Tahoma'><b>Mon</b></font></td><td><font size='3' face='Tahoma'><b>Tue</b></font></td><td><font size='3' face='Tahoma'><b>Wed</b></font></td><td><font size='3' face='Tahoma'><b>Thu</b></font></td><td><font size='3' face='Tahoma'><b>Fri</b></font></td><td><font size='3' face='Tahoma'><b>Sat</b></font></td></tr><tr>";

////// End of the top line showing name of the days of the week//////////

//////// Starting of the days//////////
for($i=1;$i<=$no_of_days;$i++){
echo $adj."<td valign=top><font size='2' face='Tahoma'>$i<br>"; // This will display the date inside the calendar cell
echo " </font></td>";
$adj='';
$j ++;
if($j==7){echo "</tr><tr>";
$j=0;}

}

echo "<tr><td colspan=7 align=center><font face='Verdana' size='2'><a href='http://www.plus2net.com'><b>plus2net.com Calendar</b></a></font></td></tr>";
echo "</tr></table></td></tr></table>";
echo "<center><font face='Verdana' size='2'><a href=php_calendar.php>Reset PHP Calendar</a></center></font>";

?>

aningbo
you should try hotscripts dot com for your calender.

your preferences required that you have a database. which could be either mysql or flatfile. the above code is fine but ur requirement is much more than that/

good luck
oly0015
Honestly I think I had the same problem at the start of October really, I wanted a basic calendar that would accept data from different tables in SQL. In a case like this my best suggestion is that you just make one yourself so you get what you want. I think mine in total was only about 200 lines and most of that was just formatting. Just try to use what is above as a guide and work from there, should only take about an hour or two really.
frenzy
As I understand your calendar would be located at your web page? As for forms you can use form builder. With it you can just set up properties to your forms without coding.
Related topics
simple login script
Simple PHP script not working
Install a autosurf script
Upload Script
I need a VERY simple php script
another simple php request
Uploader v6,Shoutbox,Simple Gallery,Simple Directory indexer
Simple (but not too simple) calendar in php
30frih for a php rotator script
Stopping rest of script if certain thing happens...
does someone have a simple "save to txt file" scri
Linux - simple shell script how to turn ECHO off ?
Will work for FRIH$
Protect Your Page With Simple Login But Yet Powerful 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.