Jump to content

Event Calendar


Recommended Posts

I am workin on a event calendar and i ran into a problem.. it shows the calendar and the today's date and 1 event on each month but i want it to show all the events for each month. my problem is i can't figure out how to loop it so it will..

 

here is where im having trouble at..

for ($i=0; $i<($maxday+$startday); $i++) {
if(($i % 7) == 0 ){
echo "<tr>";
}
if($i < $startday){
echo ("<td bgcolor='414141'> </td>");
} else {
if (($i - $startday + 1) == $today && $currentmonth == $cMonth && $currentyear == $cYear){
echo ("<td bgcolor='FF0000'><center><font color='FFFFFF'>".($i - $startday + 1)."</font></center></td>");
} else {
[color=red]// this is where i need it to loop[/color]
if (($i - $startday + 1) == $eday && $eMonth == $cMonth && $eYear == $cYear){
echo ("<td bgcolor='0000FF'><center><a class='info' href='#'><font color='FFFFFF'>".($i - $startday + 1)."<span>".$event."<hr><br>".$event_des."</span></font></a></center></td>");
} else { 
echo ("<td bgcolor='595959'><center><font color='FFFFFF'>".($i - $startday + 1)."</font></center></td>");
}
}
if(($i % 7) == 6 ) {
echo "</tr>\n";
}
}
}

i marked where the loop needs to go in red..

 

currently i have the sql query right above it in my script but i tried putting it where i need the loop and i get a error in there or it duplicates the calender and sometimes the numbers. can some please help me?

 

Thank you

Outsider_Child

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.