Solved

Have date with event change color in minical

Posted on 2014-01-23
5
364 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Don't Cry: How Liquid Web is Ensuring Security

WannaCry is just the start. Read how Liquid Web is protecting itself and its customers against new threats.

Question has a verified solution.

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

This article discusses four methods for overlaying images in a container on a web page
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 style a decorative dropcap for the first letter in a paragraph using CSS. In CSS, create a new paragraph class by typing "p.fancy": Then, to style only the first letter of the first sentence, include the ps…
In this tutorial viewers will learn how to style rounded corners for elements in CSS using the border-radius property Begin with a normal styled element such as a div: To style all four corners of the div to be the same degree of roundness, use the …

717 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