Welcome to Geeklog, Anonymous Friday, December 27 2024 @ 02:23 pm EST

Geeklog Forums

Calendar search by date seems broken in 1.4.1


Status: offline

jeffhare

Forum User
Junior
Registered: 12/04/03
Posts: 24
confused
Hello,

If I search (this site too) for events with matching start and end dates, I just get all the calendar events. In fact, it doesn't seem to matter what I enter when searching the calendar.

This appears to be a bug, but I could be doing something wrong.

Searching events with a Search phrase seems to work, but for events, the dates and date ranges are more useful. Especially, when I try to search from things like MyCal block, etc..

Any ideas here?
-Jeff
 Quote

Status: offline

jeffhare

Forum User
Junior
Registered: 12/04/03
Posts: 24
NOTE: GL 1.4.1 (don't know if it was present in 1.4.0)

It appears that the block of code handling the dates was using the wrong variables for the datestart/end.

geeklog/plugins/calendar/functions.inc : line 1460

Text Formatted Code

    if (!empty($dateStart) AND !empty($dateEnd)) {
        $delim = substr($dateStart, 4, 1);
        if (!empty($delim)) {
            $DS = explode($delim, $dateStart);
            $DE = explode($delim, $dateEnd);
            $startdate = mktime(0, 0, 0, $DS[1], $DS[2], $DS[0]);
            $enddate = mktime(23, 59, 59, $DE[1], $DE[2], $DE[0]);
            $sql .= "AND (UNIX_TIMESTAMP(datestart) BETWEEN '$startdate' AND '$enddate') ";
        }
    }
 


Changed $dateStart ==> $datestart and $dateEnd ==> $dateend and it now seems to work fine...

Text Formatted Code
   
  if (!empty($datestart) AND !empty($dateend)) {
        $delim = substr($datestart, 4, 1);
        if (!empty($delim)) {
            $DS = explode($delim, $datestart);
            $DE = explode($delim, $dateend);
            $startdate = mktime(0, 0, 0, $DS[1], $DS[2], $DS[0]);
            $enddate = mktime(23, 59, 59, $DE[1], $DE[2], $DE[0]);
            $sql .= "AND (UNIX_TIMESTAMP(datestart) BETWEEN '$startdate' AND '$enddate') ";
        }
  }
 


:banana:

Can we get this fixed in CVS? This fix also corrects the MyCal block behavior when clicking on a date.

Thanks!
-Jeff
 Quote

All times are EST. The time is now 02:23 pm.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content