Solved

Have date with event change color in minical

Posted on 2014-01-23
5
340 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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
How to add a Chat functions to my PHP site ? 3 19
regex expression 9 23
Printing a Google Form 2 9
masking php string 4 10
Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
In this tutorial viewers will learn how to position overlapping items using z-index in CSS. They will also learn the restrictions on the z-index property.  Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Red.…
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 …

762 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now