Page 1 of 1

Small hack for calendar

Posted: Wed Feb 16, 2005 6:05 am
by tomza
This small hack tio the calendar code will show the Entry Title on mouseover on the Calendar.

Version 0.7.1
Module: serendipity_functions.inc.php
Function: serendipity_drawCalendar

1. change SQL at line 421 to

$querystring = "SELECT timestamp,title
FROM {$serendipity['dbPrefix']}entries e

2. change code at line 430 to include $activeTitle

foreach ($rows as $row) {
$activeKey = date('j', $row['timestamp']); // Mod. TRS 05/02/15
//$activeDays[date('j', $row['timestamp'])] = $row['timestamp'];
$activeDays[$activeKey] = $row['timestamp'];
$activeTitle[$activeKey] = $row['title'];
}

3. Change output code at +/- 525 to :

if (isset($activeDays[$currDay]) && $activeDays[$currDay] > 1) {
$printDay = '<a href="' . serendipity_archiveDateUrl(sprintf('%4d%02d%02d', $year, $month, $currDay)) . $base_query . '"'
. ' title="' . $activeTitle[$currDay] . '" >'. $printDay . '</a>';
}

Great product - hope this small change helps.

Posted: Sun Oct 15, 2006 5:52 pm
by michele
I am posting only one entry on any given day.

Is there a way for this mod to also change the title of the entry from "Entries from Day, Month. Day" to the title of the entry?