garyL
New Member
Karma: 0
Offline
Posts: 0
|
 |
« Reply #15 on: May 08, 2003, 03:12:00 PM » |
|
I was wondering if anyone could help me out with a modification of calendar script. I made the changes as described by TubaDave to change text color for various categories and it works great. I would like to change the text background color instead. How could I do that? I hope I'm not asking for too much, but if anyone could write out the changes and give similar directions as TubaDave did with the text color, I would be greatly appreciative. Thank you for any help anyone can give me. Gary
------------------
|
|
|
|
|
Logged
|
|
|
|
DanO
Moderator
Full Member
   
Karma: 13
Offline
Posts: 235
Please don't PM me. Post in the open forum.
|
 |
« Reply #16 on: May 08, 2003, 08:38:00 PM » |
|
** I would like to change the text background color instead. How could I do that? ** Try changing: <A HREF="<%=$CGI_URL_QUERYSTRING%>view=Event&event_id=<%= EVENT FIELD(id) %>" CLASS="gridtext"><FONT COLOR="<%=$color%>"><%= EVENT FIELD(title) %></FONT></A><BR> to <span style="background:<%=$color%>"><A HREF="<%=$CGI_URL_QUERYSTRING%>view=Event&event_id=<%= EVENT FIELD(id) %>" CLASS="gridtext"><%= EVENT FIELD(title) %></A></span><BR> Dan O.
------------------
|
|
|
|
|
Logged
|
|
|
|
garyL
New Member
Karma: 0
Offline
Posts: 0
|
 |
« Reply #17 on: May 09, 2003, 02:36:00 PM » |
|
Dan O. Thanks for the help. I did have to modify your code to be the following for it to work, <A HREF="<%=$CGI_URL_QUERYSTRING%>view=Event&event_id=<%= EVENT FIELD(id) %>" CLASS="gridtext"> <span style="background:<%=$color%>"> <%= EVENT FIELD(title) %></A></span><BR> Thanks again for helping. Gary ------------------
|
|
|
|
|
Logged
|
|
|
|
DanO
Moderator
Full Member
   
Karma: 13
Offline
Posts: 235
Please don't PM me. Post in the open forum.
|
 |
« Reply #18 on: May 09, 2003, 03:16:00 PM » |
|
** I did have to modify your code ** Then you should probably change around the end tags as well to keep each HTML entity nested properly. Change </A></span><BR> to </span></A><BR> Dan O. ------------------
|
|
|
|
|
Logged
|
|
|
|
|
lselman
Guest
|
 |
« Reply #19 on: May 10, 2003, 04:05:00 PM » |
|
I am interested in letting the user choosing the color for the entry with a choice of say 4 or 5 colors this also would be used for the dayspan events. No categories involved. Can any one help with the mod. Larry
|
|
|
|
|
Logged
|
|
|
|
DanO
Moderator
Full Member
   
Karma: 13
Offline
Posts: 235
Please don't PM me. Post in the open forum.
|
 |
« Reply #20 on: May 10, 2003, 05:03:00 PM » |
|
> let the user choose the color for the entry < Like described in the previous forum message "add color choice display of event title"? Dan O. ------------------
|
|
|
|
|
Logged
|
|
|
|
|
Paddy
Guest
|
 |
« Reply #21 on: May 17, 2003, 10:49:00 AM » |
|
Hi, I wonder, can this approach (with tweaking so its conditional on whether an event is pending) also be used in to allow the display of pending events in the grid in a different colour, or is there something else needed? I have already seen the other posts on how to make pending event show, but wasn't sure of the best approach for the conditional colouring.
|
|
|
|
|
Logged
|
|
|
|
DanO
Moderator
Full Member
   
Karma: 13
Offline
Posts: 235
Please don't PM me. Post in the open forum.
|
 |
« Reply #22 on: May 17, 2003, 01:11:00 PM » |
|
** used in to allow the display of pending events in the grid in a different colour. I have already seen the other posts on how to make pending event show, but wasn't sure of the best approach for the conditional colouring. ** You mean the one discussed in the previous forum message "Showing pending events in grid template"? You could change the above code to something like: <% if (!$EVENT->{'details'}->{'approved'}) {$color="#FF0000";} elsif ($EVENT->{details}->{category} eq "cultural") {$color="#00FFFF";} elsif ($EVENT->{details}->{category} eq "political") {$color="#0000FF";} elsif ($EVENT->{details}->{category} eq "social") {$color="#00FF00";} elsif ($EVENT->{details}->{category} eq "student") {$color="#FF0000";} elsif ($EVENT->{details}->{category} eq "other") {$color="#FFFF00";} else {$color="#FFFFFF";} %> Which should colour pending events red. If not pending, it would colour them according to the list. However, it you're not already colour coding the events, this approach might be overkill? Dan O.
[This message has been edited by DanO (edited May 17, 2003).]
|
|
|
|
|
Logged
|
|
|
|
David H
New Member
Karma: 0
Offline
Posts: 0
Network Administrator
|
 |
« Reply #23 on: November 12, 2003, 08:05:00 AM » |
|
We currently are using the color coded events to coordinate the scheduling of tests for our school. 9th grade is Blue, 10th is yellow etc. What we want to do now is to have school wide events that teachers need to consider when scheduling events also included. I would be helpful to make these events stand out in the grid display (dayspan). Currently we have a new group "all" and are making its color "maroon". How could be add a "bold" style to this? and could we also change the backgroud color for this event as well in order to make this stand out even more? Here is our current if/else if code: elsif ($EVENT->{details}->{grade} eq "9th") {$color="#00FF00";} elsif ($EVENT->{details}->{grade} eq "10th") {$color="#9F5F9F";} elsif ($EVENT->{details}->{grade} eq "11th") {$color="#CC0033";} elsif ($EVENT->{details}->{grade} eq "12th") {$color="#003399";} elsif ($EVENT->{details}->{grade} eq "All") {$color="#990000";} else {$color="#000000";} %> ------------------
|
|
|
|
|
Logged
|
|
|
|
DanO
Moderator
Full Member
   
Karma: 13
Offline
Posts: 235
Please don't PM me. Post in the open forum.
|
 |
« Reply #24 on: November 12, 2003, 01:46:00 PM » |
|
** How could be add a "bold" style to this? ** How is the $color variable currently being used? (Hint: post the HTML code which is used to colour the links) Dan O. ------------------
|
|
|
|
|
Logged
|
|
|
|
David H
New Member
Karma: 0
Offline
Posts: 0
Network Administrator
|
 |
« Reply #25 on: November 13, 2003, 03:10:00 PM » |
|
I'm not sure how to respond to your question. I have simply implemented what has been prevously posted in this thread. To my knowledge I am not using any additional html code to the dayspan default.htm template to define the colors or $color variable. Perhaps I can emphasize that I only want the "all" selection to be colored #990000 (maroon) as indicated in my "if" statement but in addition to also have the "event description" text for this category in the grid be bold and have perhaps different background color other than white. All the other events (ie. 6th, 7th etc. would remain as they're currently displayed.) ------------------
|
|
|
|
|
Logged
|
|
|
|
DanO
Moderator
Full Member
   
Karma: 13
Offline
Posts: 235
Please don't PM me. Post in the open forum.
|
 |
« Reply #26 on: November 13, 2003, 09:33:00 PM » |
|
** I have simply implemented what has been prevously posted in this thread. ** If you used <font> tags around the links to change their color, there is not likely a simple way to make them also bold conditionally. There is also no way to easily change the background colour for those links conditionally. If you used a <div> or <span> tag to color the links, both the background colour and the boldness would have been more easily able to be specified conditionally. That way would use CSS code within a single HTML tag to do all 3 in a similar way to was shown in the very fist thread of this message. Dan O. [This message has been edited by DanO (edited November 13, 2003).]
|
|
|
|
|
Logged
|
|
|
|
k9barry
New Member
Karma: 0
Offline
Posts: 0
|
 |
« Reply #27 on: November 26, 2003, 01:12:00 PM » |
|
Using the previous posted code: *********************************** <% if (!$EVENT->{'details'}->{'approved'}) {$color="#FF0000";} elsif ($EVENT->{details}->{category} eq "cultural") {$color="#00FFFF";} elsif ($EVENT->{details}->{category} eq "political") {$color="#0000FF";} elsif ($EVENT->{details}->{category} eq "social") {$color="#00FF00";} elsif ($EVENT->{details}->{category} eq "student") {$color="#FF0000";} elsif ($EVENT->{details}->{category} eq "other") {$color="#FFFF00";} else {$color="#FFFFFF";} %> ***************************************** What do I change so the calendar grid text is different. I am using the Meta-Calendar plugin to show events from several calendars and would like the events to be distinguished by the calendar they come from. Would something like this work: if (!$EVENT->{'details'}->{'approved'}) {$color="#FF0000";} elsif ($cal->{key} eq "calendar1") {$color="#00FFFF";} elsif ($cal->{key} eq "calendar2") {$color="#FFFF00";} and so on. I am trying to learn this language!!!!!!!
------------------
|
|
|
|
|
Logged
|
|
|
|
DanO
Moderator
Full Member
   
Karma: 13
Offline
Posts: 235
Please don't PM me. Post in the open forum.
|
 |
« Reply #28 on: November 26, 2003, 09:32:00 PM » |
|
** I am using the Meta-Calendar plugin to show events from several calendars and would like the events to be distinguished by the calendar they come from. ** From the Meta Calendar _installation.txt file: quote: OPTIONS:There are some new variables available on the meta calendar output, (but only on the calendar designated as the 'meta calendar'). In the "Grid View", $EVENT->{'details'}->{calendarref} contains the calendar key the event was found on. This could be used to colour code the event titles on the grid view, etc. In the "Grid View", $site_cal->{$EVENT->{details}->{calendarref}} will contain the calendar name the event was found on. In the search results, $EVENT->{schedule}->{calendarref} contains the calendar key the event was found on, $site_cal->{$EVENT->{schedule}->{calendarref}} will contain the calendar name
** Would something like this work ** If you use the appropriate variables in the conditionals, yes. Dan O. [This message has been edited by DanO (edited November 26, 2003).]
|
|
|
|
|
Logged
|
|
|
|
k9barry
New Member
Karma: 0
Offline
Posts: 0
|
 |
« Reply #29 on: November 27, 2003, 01:12:00 PM » |
|
Thanks DanO for the tip. I took it and ran with it changing it a little to this: <% if ($EVENT->{details}->{calendarref} eq "day") {$color="#0000FF";} elsif ($CALENDAR_KEY eq "day") {$color="#0000FF";} elsif ($EVENT->{details}->{calendarref} eq "evening") {$color="#006600";} elsif ($CALENDAR_KEY eq "evening") {$color="#006600";} elsif ($EVENT->{details}->{calendarref} eq "midnight") {$color="#FF9900";} elsif ($CALENDAR_KEY eq "midnight") {$color="#FF9900";} elsif ($EVENT->{details}->{calendarref} eq "range") {$color="#FF0000";} elsif ($CALENDAR_KEY eq "range") {$color="#FF0000";} elsif ($EVENT->{details}->{calendarref} eq "training") {$color="#FFFF00";} elsif ($CALENDAR_KEY eq "training") {$color="#FFFF00";} elsif ($EVENT->{details}->{calendarref} eq "investigation") {$color="#996600";} elsif ($CALENDAR_KEY eq "investigation") {$color="#996600";} elsif ($EVENT->{details}->{calendarref} eq "holiday") {$color="#990000";} elsif ($CALENDAR_KEY eq "holiday") {$color="#990000";} elsif ($EVENT->{details}->{calendarref} eq "community") {$color="#FFFFFF";} elsif ($CALENDAR_KEY eq "community") {$color="#FFFFFF";} else {$color="$_GRID_CELL_TEXT_COLOR";} %> This will change the color of the event title according to the caledar it came from wether you are using the metacalendar plugin or not. I am using that and listing the calendar links in the command list I copied the code with minor changes to show the calendar link in the command list as the same color as the text. If there is interest I will post the entire file. ------------------
|
|
|
|
|
Logged
|
|
|
|
|