From 4ea6f86b2089e0468139890a42cb5157f804c26e Mon Sep 17 00:00:00 2001 From: Friendika Date: Mon, 24 Oct 2011 22:07:42 -0700 Subject: bug #166 --- boot.php | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) (limited to 'boot.php') diff --git a/boot.php b/boot.php index 86a37ce90..636062136 100644 --- a/boot.php +++ b/boot.php @@ -1031,6 +1031,57 @@ function get_birthdays() { }} +if(! function_exists('get_events')) { +function get_events() { + + require_once('include/bbcode.php'); + + $a = get_app(); + $o = ''; + + if(! local_user()) + return $o; + + $bd_format = t('g A l F d') ; // 8 AM Friday January 18 + $bd_short = t('F d'); + + $r = q("SELECT `event`.* FROM `event` + WHERE `event`.`uid` = %d AND `type` != 'birthday' AND `start` < '%s' AND `finish` > '%s' + ORDER BY `start` DESC ", + intval(local_user()), + dbesc(datetime_convert('UTC','UTC','now + 6 days')), + dbesc(datetime_convert('UTC','UTC','now')) + ); + + if($r && count($r)) { + $o .= ''; + $o .= ''; + } + + return $o; +}} + + /** * * Wrap calls to proc_close(proc_open()) and call hook -- cgit v1.2.3