Small hack for calendar

Discussion corner for Developers of Serendipity.
Post Reply
tomza
Regular
Posts: 5
Joined: Wed Feb 16, 2005 5:17 am
Location: South Africa

Small hack for calendar

Post 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.
Linux is like a Tepee - No Gates - No Windows - Apache Inside!
michele
Regular
Posts: 19
Joined: Sat Oct 14, 2006 5:02 am
Location: North Carolina
Contact:

Post 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?
Post Reply