PHP Calendar Tricks
Basics:
Including additional variables in your database & using them in different ways adds flexability to the PHP Calendar.
Possibilities for PHP variables.:
A typical entry in a Php Calendar is output as a traditional table entry:
<tr><td class='verdana12px' align='center'>Friday</td>
Such an entry in a Php Calendar is typically input as:
echo("\t<tr>\n\t\t<td class='verdana12px' align='center'>$the_bigday</td>...
But additioanal variables can be added as desired for a particular entry:
echo("\t<tr>\n\t\t...
<td class='$the_twnclass' align='$the_divtag'>$the_town</td>
...\n\t\t</tr>\n");
Including additional variables in your database allows you to abbreviate lines, make unusual
entries, add calendar divisions, and vary or add to the space between events.
Trick 1:
Abbreviating long Venue and Address lines using $the_*class variables.
Font swapping: Include Arial & Verdana fonts in your CSS file or <Head><Style> section.
Calendar setups often face width restrictions which make long venue names and addresses a forseeable problem.
Verdana fonts are generally preferred due to their legability. The ability to substitute the equally common Arial fonts offers flexibility
when width adjustment is required. Forunately the two fonts are very compatible and, on our machines, Arial has the appearance of "pinched" Verdana.
19152 Santiago Canyon Rd 12 verdana bold = reg
Trabuco Canyon, CA
reg
19152 Santiago Canyon Rd 13 arial bold = a13
Trabuco Canyon, CA
reg
19152 Santiago Canyon Rd 12 arial bold = a12
Trabuco Canyon, CA
reg
19152 Santiago Canyon Rd 11 verdana bold = reg11
Trabuco Canyon, CA
reg11
19152 Santiago Canyon Rd 12 arial bold
Trabuco Canyon, CA
reg11
19152 Santiago Canyon Rd
11 arial bold = a11
Trabuco Canyon, CA
reg11
19152 Santiago Canyon Rd
10 verdana bold = reg10
Trabuco Canyon, CA
Conclusions:
Use Verdana 12 or 11 as the default font.
Use Arial 13,12 & 11 for long line abbreviation.
When designing a narrow calendar, make several entries using Verdana. Then make an entry using your longest venue name & the longest address line using Arial. The table width required for these entries should be a safe minimum.
Trick 2:
Using the spacer and "wildcard" variables for occasional added content in "offset" calendars.
row 1
row 2
row 3
row 4
Spacer
Saturday
July 16th
9:30pm-
12am
The Savoy Ballroom
4733 So. Parkway
Chicago, Illinois
(987) 654-3210
Earl Hines
Mancy Carr
Jms Strong
Pete Briggs
row 1
row 2
row 3
row 4
Spacer
$the_bigday
$the_damon
$the_hours
$the_stamp
$the_venue
$the_address
$the_town
$the_phone
$the_details
$the_sideman
$the_guest
$the_ticket
Trick 3:
Using variables as table tags to center calendar dividers.
$the_nexclass = V18px
$the_addtag = right
$the_ticket = Coming up
$the_twnclass = V18px
$the_divtag = left
$the_town = in August
<tr><td class='reg' align='center' > </td>
<td class='$the_tktclass' align='$the_addtag'>$the_ticket</td>
<td class='$the_twnclass' align='$the_divtag'>$the_town</td>
<td class='reg' align='center' > </td></tr>
| |
| |
| |
| |
Date | Venue |
Location | Details |
| |
| |
| Saturday |
The Savoy Ballroom |
4733 So. Parkway |
Earl Hines, piano |
| August 28th |
|
Chicago, Illinois |
Mancy Carr, banjo |
| 9pm-2am |
|
(987) 654-3210 |
Pete Briggs, tuba |
| |
| |
| |
Coming up |
in August |
|
| |
| |
| Saturday |
The Savoy Ballroom |
4733 So. Parkway |
Earl Hines, piano |
| August 28th |
& Saloon |
Chicago, Illinois |
Mancy Carr, banjo |
| 9pm-2am |
Jms. Strong, sax |
(987) 654-3210 |
Pete Briggs, tuba |
| |
| |
| Saturday |
The Savoy Ballroom |
4733 So. Parkway |
Earl Hines, piano |
| August 28th |
Guest Artist |
Chicago, Illinois |
Mancy Carr, banjo |
| 9pm-2am |
Jms. Strong, sax |
(987) 654-3210 |
Pete Briggs, tuba |
| |
| |
| $the_bigday |
$the_venue |
$the_address |
$the_details |
| $the_damon |
$the_ticket |
$the_town |
$the_sideman |
| $the_hours |
$the_stamp |
$the_phone |
$the_guest |
"wildcard" variables: $the_ticket & $the_stamp are normally used in this setup for occassional input.
Variables for font "classes" have been used here as well.
<td class='$the_dayclass' align='center'>$the_bigday</td>
Trick 4:
Using "*class" & "wildcard" variables for calendar divisions.
The following method often makes for a neater look especially when your calendar event entries exceed 3 rows.
Here we use the variables to add space as well as change font size. This trick is used as part of the last entry of a month to introduce a new month.
Using the the calendar layout from Trick 2 we get:
row 1
row 2
row 3
row 4
Saturday
July 16th
9pm-12am
The Savoy Ballroom
4733 So. Parkway
Chicago, Illinois
(987) 654-3210
Earl Hines
Mancy Carr
Jms Strong
August
row 1
row 2
row 3
row 4
spacer
$the_bigday
$the_damon
$the_hours
$the_stamp
$the_venue
$the_address
$the_town
$the_phone
$the_details
$the_sideman
$the_guest
$the_ticket
by using our "wildcard" variables to make & position the monthly divider:
$the_stpclass = reg
$the_stamp = </td><tr></tr><td>
$the_tktclass = V18px
$the_ticket = August</td></tr><tr><td></td></tr>
Trick 5:
Using a smaller font in your spacer will compress the calendar vertically.
//spacer
<tr><td class='arial-8px' align='center'> </td>
<td class='arial-8px' align='center'> </td>
<td class='arial-8px' align='center'> </td></tr>
Trick 6?:
If you you have a PHP Calendar Trick or a link to add here, please let us know: