kunzite (kunzite1) wrote in component_help,
kunzite
kunzite1
component_help

updated mini cal background image thingy

in response to panda_cookie's post here i have developed a thingy
# section one goes in the top of Page::print_custom_head() before the """
# mini cal
# original images 20x20 pixels
# background image for days with posts
var string cal_active_bg = "";

# background image for days without posts
var string cal_inactive_bg = "";

# year page
# background image for days with posts
var string ncal_active_bg = "";

# background image for days without posts
var string ncal_inactive_bg = "";

var string cal_active    = "background-color: $*comp_bgcolor;";
var string cal_inactive  = "background-color: $*comp_bgcolor;";
var string ncal_active   = "background-color: $*calendar_active;";
var string ncal_inactive = "background-color: $*calendar_inactive;";
$cal_active_bg           = $cal_active_bg    ? "background-image: url($cal_active_bg);"    : "";
$cal_inactive_bg         = $cal_inactive_bg  ? "background-image: url($cal_inactive_bg);"  : "";
$ncal_active_bg          = $ncal_active_bg   ? "background-image: url($ncal_active_bg);"   : "";
$ncal_inactive_bg        = $ncal_inactive_bg ? "background-image: url($ncal_inactive_bg);" : "";
# end section one
/* section two goes into the css declarations of Page::print_custom_head() */ /* mini cal */ .calendarInactive { $cal_inactive_bg background-repeat: no-repeat; background-position: center; $cal_inactive font-size: 9px; letter-spacing: 2px; color: $*calendar_fgcolor; text-align: center; } .calendarActive { $cal_active_bg background-repeat: no-repeat; background-position: center; color: $*calendar_link; $cal_active font-size: 9px; letter-spacing: 2px; text-align: center; } /* year page */ .NcalendarInactive { $ncal_inactive_bg background-repeat: no-repeat; background-position: center; color: $*calendar_fgcolor; $ncal_inactive font-size: 9px; letter-spacing: 2px; } .NcalendarActive { $ncal_active_bg background-repeat: no-repeat; background-position: center; color: $*calendar_link; $ncal_active font-size: 9px; letter-spacing: 2px; } /* end section two */
# this is a totally different function that handles the different css classes for the year page function YearWeek::print () { "<tr>"; if ($.pre_empty) { "<td colspan='$.pre_empty'>&nbsp;</td>"; } foreach var YearDay d ($.days) { if ($d.num_entries) { "<td width='26' valign='top' class='NcalendarActive'>"; } else { "<td width='26' valign='top' class='NcalendarInactive'>"; } "<b>$d.day</b>"; "<div align='center'>"; if ($d.num_entries) { """<a href="$d.url" class="NcalendarLink">$d.num_entries</a>"""; } else { "&nbsp;"; } "</div></td>"; } if ($.post_empty) { "<td colspan='$.post_empty' width='30'>&nbsp;</td>"; } "</tr>"; } # end totally different function
Subscribe

  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

  • 15 comments