Solved

Have date with event change color in minical

Posted on 2014-01-23
5
356 Views
Last Modified: 2014-01-31
I am using the minical.php system for a calendar on our website. Everything is working great, but I need any date with an event to change to a different color.

I am attaching the PHP file here.. any help would be appreciated.

The css for the dates with events is "date-event"

Thanks..
minical.php
0
Comment
Question by:socialbutterfly
  • 3
  • 2
5 Comments
 
LVL 24

Accepted Solution

by:
mankowitz earned 500 total points
ID: 39805493
The best way to do it is to set the style of the td for the respective event day to have some bgcolor.

If I am reading correctly, a day has an event when in_array($i,$activedays) is true, so do something like this:

echo $adj."<td ";
if (in_array($i,$activedays)) echo 'bgcolor="#FF0000" ';

Open in new window


If you want more complex formatting, you may decide to add a style or a class, but this should work for now.
0
 

Author Closing Comment

by:socialbutterfly
ID: 39805595
Thank you soooo much!
0
 

Author Comment

by:socialbutterfly
ID: 39819768
Just found out that this only works on the current month.

I have


if (in_array($i,$activedays))

{ echo 'class=today-event ';
}

if (($i == date('d')) && ($m ==date('m'))){

echo "class=today";

}

 it gives this error when I go to a new month...

Warning in_array()[; Wrong datatype for second argument in ... on line 181
0
 
LVL 24

Expert Comment

by:mankowitz
ID: 39823704
Look at your code. You probably have to reset $activedays whenever you change the month.
0
 

Author Comment

by:socialbutterfly
ID: 39825167
It only does it if there isn't an event for that month. Trying to figure out how to check to see if it is empty or not.
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
In this tutorial viewers will learn how to embed custom externally-hosted Google Fonts using the Google Font API in CSS Go to the Google Fonts website at google.com/fonts: Browse or search based on font properties or name to find a suitable font for…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question