Welcome, Guest. Please login or register.
Did you miss your activation email?


Login with username, password and session length

Search

 
Advanced search

8043 Posts in 1856 Topics- by 2099 Members - Latest Member: roi
Calendar Script CommunityCustomizationCustomizing CalendarScript (Moderators: scott, DanO, Marty)Selected Command Option Background Color
Pages: [1]   Go Down
Print
Author Topic: Selected Command Option Background Color  (Read 482 times)
0 Members and 1 Guest are viewing this topic.
vanessa
New Member
*

Karma: 0
Offline Offline

Posts: 0


WWW
« on: August 02, 2004, 02:17:00 AM »

Selected Command Option Background Color seems to work for every command except "Today"

Visit http://www.lifechurchministries.org/cgi-bin/calendar.cgi  to see
Thanks.
vanessa

Logged
DanO
Moderator
Full Member
*****

Karma: 13
Offline Offline

Posts: 230

Please don't PM me. Post in the open forum.


WWW
« Reply #1 on: August 02, 2004, 12:57:00 PM »

I'm afraid you'll have to check the code in the default.html template file to see that is
different between that link and the others in the same menu.

Dan O.

[This message has been edited by DanO (edited August 02, 2004).]

Logged
DanO
Moderator
Full Member
*****

Karma: 13
Offline Offline

Posts: 230

Please don't PM me. Post in the open forum.


WWW
« Reply #2 on: August 02, 2004, 07:41:00 PM »

I finally had a chance to look into it and it looks like the template was never designed to highlight that particular link.

If you want it highlighted you can try editing the default.html template file as follows.

Replace start of the second line after <% if ($_SHOW_VIEW) { %> which looks like this:

<TR><TD BGCOLOR="<%=$_COMMAND_OPTION_BGCOLOR%>">

with

code:
<TR><TD BGCOLOR="<%=(($TODAY_DATESTRING == $DATESTRING)?$_COMMAND_OPTION_SELECTED_BGCOLOR:$_COMMAND_OPTION_BGCOLOR)%>">

The rest of that initial line stays as it is.

This is untested but should work but as always, keep a backup of original fines just in case.

Dan O.

[This message has been edited by DanO (edited August 02, 2004).]

Logged
vanessa
New Member
*

Karma: 0
Offline Offline

Posts: 0


WWW
« Reply #3 on: August 02, 2004, 10:54:00 PM »

Thanks Dan. With your suggestion and some additional tweaking, I think I got it.

<TR><TD BGCOLOR="<%=(($VIEW eq "Day")?$_COMMAND_OPTION_SELECTED_BGCOLOR:$_COMMAND_OPTION_BGCOLOR)%>"><a href="<%= $CGI_URL_QUERYSTRING %>view=Day&datestring=<%=$TODAY_DATESTRING%>&selected_datestring=<%=$TODAY_DATESTRING%>" CLASS="<%=(($VIEW eq "Day")?"selectedcommandtext":"commandtext")%>">Today</A></TD></TR>

Sincerely,
vanessa

Logged
DanO
Moderator
Full Member
*****

Karma: 13
Offline Offline

Posts: 230

Please don't PM me. Post in the open forum.


WWW
« Reply #4 on: August 03, 2004, 01:43:00 AM »

** I think I got it. **

Not quite I don't think. That will highlight the "Today" link no matter what single day's events is being viewed.

Did the code I supplied not work?

Dan O.

------------------

Logged
vanessa
New Member
*

Karma: 0
Offline Offline

Posts: 0


WWW
« Reply #5 on: August 03, 2004, 07:57:00 AM »

Hey Dan,

When I tried the code that you gave me, the Today link stayed active. When I compared that code to that of the time periods, I noticed that nothing in the command would tell the link to exhibit a different appearance: the commandtext versus selectedcommandtext format. Though I am on a Mac, when I tried my code, Safari, IE 5.2, Firefox, and Opera, it worked as desired.

What language is this script written in, I think I need to learn more?

Thanks for being part of the forum.  Without you, I would not have gotten the calendar working.

Sincerely,
Vanessa

Logged
DanO
Moderator
Full Member
*****

Karma: 13
Offline Offline

Posts: 230

Please don't PM me. Post in the open forum.


WWW
« Reply #6 on: August 03, 2004, 03:50:00 PM »

** when I tried my code [in] Safari, IE 5.2, Firefox, and Opera, it worked as desired. **

How about when you clicked the 14th of August (or July or December, etc.) for instance?
Those dates are not "Today" so that link should not be highlighted. I believe
the "Today" link would be highlighted with your modification.

** What language is this script written in, I think I need to learn more? **

Perl... although the template files do not contain pure Perl. Only the script files do.
You can find some of the best Perl books linked from the
Unofficial CalendarScript - Mods and Plugins site.

JFYI

Dan O.

[This message has been edited by DanO (edited August 03, 2004).]

Logged
vanessa
New Member
*

Karma: 0
Offline Offline

Posts: 0


WWW
« Reply #7 on: August 03, 2004, 05:41:00 PM »

Hey Dan,
You are right. I guess I will have to live with Today not changing.

Thanks for the great support.

Sincerely,
Vanessa

------------------

Logged
DanO
Moderator
Full Member
*****

Karma: 13
Offline Offline

Posts: 230

Please don't PM me. Post in the open forum.


WWW
« Reply #8 on: August 03, 2004, 09:00:00 PM »

** I guess I will have to live with Today not changing. **

Try changes the conditional in the expression I posted from:

$TODAY_DATESTRING == $DATESTRING

to

$TODAY_DATESTRING == $DATESTRING && $VIEW eq "Day"

I'm pretty sure that should fix it.

Dan O.

------------------

Logged
vanessa
New Member
*

Karma: 0
Offline Offline

Posts: 0


WWW
« Reply #9 on: August 03, 2004, 11:23:00 PM »

Hey Dan,

I think that's it. Seems to be working in the desired fashion.

Sincerely,
Vanessa

Logged
Pages: [1]   Go Up
Print
Jump to: