{$language_block['Events title']}"; elseif($_SESSION["$random_code"] == "off") $links = " {$language_block['Events title']}"; $template_block = implode("", file("templates/$template/block.php")); $template_block = str_replace("{template}", $template, $template_block); $template_block = str_replace("{links}", $links, $template_block); if(!isset($_SESSION["$random_code"]) || $_SESSION["$random_code"] == "on") { //----------------------------------------------------------------- // Get users and today's events //----------------------------------------------------------------- $today_events = $db->getTable("SELECT type, user_id, user_user, start, end, message, age FROM events LEFT JOIN users ON events.user_id = users.id WHERE day = '".date('j')."' AND month = '".date('n')."' AND year = '".date('Y')."' ORDER BY start ASC,type DESC"); //----------------------------------------------------------------- // Do foreach //----------------------------------------------------------------- if($today_events != FALSE) { foreach($today_events as $idx=>$today_event) { if($today_event['start'] != 0 || $today_event['end'] != 0) $start_end = "".date("H:i",$today_event['start'])." - ".date("H:i",$today_event['end']).""; else $start_end = "{$language_block['Events allday']}"; if($today_event['type'] == "bday") $content .= "{$language_block['Events bday1']} {$today_event['user_user']} {$language_block['Events bday2']} ".find_age("{$today_event['age']}")." {$language_block['Events bday3']}"; else { if(isset($today_event['age'])) $content .= "[ $start_end ]
{$today_event['user_user']}: ".parse_message($today_event['message']).""; else $content .= "[ $start_end ]
{$today_event['user_user']}: ".parse_message($today_event['message']).""; } } } else $content .= "{$language_block['Events none']}"; } $template_block = str_replace("{content}", $content, $template_block); $output = $template_block; return $output; } ?>