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
Pages: [1]   Go Down
Print
Author Topic: Wider cells for weekend days???  (Read 710 times)
0 Members and 1 Guest are viewing this topic.
KellyBliss
New Member
*

Karma: 0
Offline Offline

Posts: 0

psychotherapist and fitness professional


WWW
« on: January 31, 2003, 10:36:00 AM »

How can I get Sat & Sun to be wider (and weekdays more narrow) in the grid view of the calendar?

My goal is to have wider cells on Sat & Sun so that the cells are not so long when lots of events are posted.

thanks.

Logged

Kelly Bliss

For healthy eating, fitness, & self-acceptance,
check out http://www.kellybliss.com  

DanO
Moderator
Full Member
*****

Karma: 13
Offline Offline

Posts: 230

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


WWW
« Reply #1 on: January 31, 2003, 02:48:00 PM »

** How can I get Sat & Sun to be wider (and weekdays more narrow) in the grid view of the calendar? **

I believe the grid size is controlled by the default.html template's code:

<TD CLASS="thinborder" VALIGN=TOP ROWSPAN="<%= $currSpan %>" WIDTH=14% <%=$rowheight%> BGCOLOR="<%IF SELECTED%><%=$_GRID_CELL_SELECTED_BGCOLOR%><%ELSE%><%=$_GRID_CELL_BGCOLOR%><%/IF%>">

Assuming your Sunday falls on the first day of the week and Saturday on the last, changing the WIDTH=14% in the line above to:

WIDTH=<%=(($currSpan == 1 | | $currSpan == 7 )?"20":"12")%>%

should cause the first and last grid columns to each be 20% of the table width wide and the others 12%. You can adjust those percentages as necessary (making them add up to 100%).

This is untested so keep a back up of the original, unmodified file just in case.

Dan O.

« Last Edit: November 14, 2008, 02:39:21 AM by DanO » Logged
kd4rdb
New Member
*

Karma: 0
Offline Offline

Posts: 0

engineer


WWW
« Reply #2 on: March 19, 2003, 11:14:00 AM »

I found it necessary to add <% $currSpan++; %>

and
WIDTH=<%=(($currSpan == 1 | $currSpan == 7 )?"20":"12")%>%

and after <%/FOREACH%>, add
<% $currSpan=0; %>

Thanks for the tip and getting me started!

Logged
DanO
Moderator
Full Member
*****

Karma: 13
Offline Offline

Posts: 230

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


WWW
« Reply #3 on: January 24, 2006, 05:10:00 PM »

** I found it necessary to add <% $currSpan++; %> **

Yes, sorry. I must have been looking at the Dayspan templates where that variable is used. This line should work for the original default.html template:

WIDTH=<%=(($COL == 0 | | $COL == 6 )?"20":"12")%>%

... that is, assuming it is the column of first and last days of the displayed week you want widened.

BTW. The total of all the columns should be exactly 100. In the above example the columns would be day1 = 20, day2 = 12, 12, 12, 12, 12, day7 = 20 for a total of 100

  BTW. This forum software adds a space between | | characters. If copying and pasting such code, the space between those symbols will have to be removed before use.

JFYI

Dan O.

« Last Edit: November 14, 2008, 02:46:37 AM by DanO » Logged
CWwebmaster
New Member
*

Karma: 0
Offline Offline

Posts: 0

retired


WWW
« Reply #4 on: January 24, 2006, 05:19:00 PM »

I get error-------
syntax error at (eval 1) line 169, near ""18":"
-------------

which is this long line:-------------
print "
\n                  <td class=\"thinborder\" valign=\"TOP\" WIDTH=";print (($currSpan == 1 | $currSpan == 2 | $currSpan == 3 | $currSpan == 4 | $currSpan == 5 | $currSpan == 6 | $currSpan == 7 )?"5":"18":"18":"18":"18":"18":"5");print "%  bgcolor=\"";if ($DAY->{'selected'}) {print "";print $_GRID_CELL_SELECTED_BGCOLOR;print "";}else{print "";print $_GRID_CELL_BGCOLOR;print "";}print "\">
\n                     ";
----------------

Please, what error did I make?

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

Logged
DanO
Moderator
Full Member
*****

Karma: 13
Offline Offline

Posts: 230

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


WWW
« Reply #5 on: January 24, 2006, 08:28:00 PM »

** (($currSpan == 1 | $currSpan == 2 | $currSpan == 3 | $currSpan == 4 | $currSpan == 5 | $currSpan == 6 | $currSpan == 7 )?"5":"18":"18":"18":"18":"18":"5"); **

Is that actually what you have in your template??

If so, you can NOT have multiple "5":"18":"18":"18":"18":"18":"5". The statement only accepts 2 arguments only there.

PLUS. The | should be double | | (with no space between them).

Look at the very last message I posted and try it... after removing the space between the | | which this forum adds.

BTW. If you want different widths than what is listed there, change the "20":"12" to "5":"18" only.

Dan O.
« Last Edit: November 14, 2008, 02:49:40 AM by DanO » Logged
CWwebmaster
New Member
*

Karma: 0
Offline Offline

Posts: 0

retired


WWW
« Reply #6 on: January 26, 2006, 11:24:00 AM »

Dan,

Thank you very much.  I am so grateful for your dedication.  I used the following and it did exactly what I wanted.

<%FOREACH GRID COLUMN%><% $currSpan=0; %>
<% $i=0; %><% $currSpan++; %>
<td class="thinborder" valign="TOP"
WIDTH=<%=(($COL == 0 | | $COL == 6 )?"5":"18")%>%

I guess someday I need to study some book on PERL

Dick R

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

Logged
DanO
Moderator
Full Member
*****

Karma: 13
Offline Offline

Posts: 230

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


WWW
« Reply #7 on: January 26, 2006, 12:51:00 PM »

Glad to hear you figured it out.

Dan O.
« Last Edit: November 14, 2008, 02:50:58 AM by DanO » 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: January 26, 2006, 09:38:00 PM »

BTW. If you're using $COL in the conditional expression, you don't need the
<% $currSpan=0; %><% $i=0; %><% $currSpan++; %> stuff.

That would only be needed if you were using the $currSpan variable from my original
code suggestion in the conditional (which as I said, was actually from a different
template I must have been looking at at the time     my bad).

JFYI

Dan O.

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

Logged
DanO
Moderator
Full Member
*****

Karma: 13
Offline Offline

Posts: 230

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


WWW
« Reply #9 on: January 26, 2006, 09:47:00 PM »

PS. The Perl statement (($COL == 0 | | $COL == 6 )?"5":"18")) is just a shorthand version of an if/then statement. It actually means:

if $COL is equal to 0 OR 6, use "5"
if not, use "18"

** I guess someday I need to study some book on PERL **

You can find a couple of the better written ones linked from the Unofficial CalendarScript - Mods and Plugins site. The 'Perl Cookbook' has lots of examples with explanations too!

JFYI

Dan O.

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

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