$file, 'date' => $date, 'channel' => $channel, ); $files[$key] = $e; if (!isset($last_date_by_file[$file]) || $date > $last_date_by_file[$file]) { $last_date_by_file[$file] = $date; } $a['mday']++; $date = mktime($a['hours'], $a['minutes'], $a['seconds'], $a['mon'], $a['mday'], $a['year']); } if (!$r_log) { if ($r_channel && !$r_date && $r_channel == $channel) { $r_log = $file; } if ($r_date && !$r_channel && $r_date == $date) { $r_log = $file; } if ($r_channel && $r_date && $r_channel == $channel && $r_date == $date) { $r_log = $file; } } } ksort ($files); $irc_log_options = array(); $first_file = ''; foreach ($files as $key => $value) { $file = $value['file']; $date = $value['date']; $channel = $value['channel']; $yymmdd = date('ymd', $date); $f = IRC_LOG_DIR . '/' . $file; $irc_log_options[$file . '/' . $yymmdd . '/' . $channel] = $tikilib->get_long_date($date, $user). ' #' . $channel . ' (' .@filesize($f). ')'; if (!$first_file) { $first_file = $file; } } $file = ''; if ($r_log) { $fullname = IRC_LOG_DIR . '/' . $r_log; if (@is_file($fullname)) { $file = $r_log; } } if (!$file) { $file = $first_file; } $fullname = IRC_LOG_DIR . '/' . $file; if (!$r_date) { $a = @$last_date_by_file[$file]; $r_date = $a['date']; } if (!$r_channel) { $a = @$last_date_by_file[$file]; $r_channel = $a['channel']; } $irc_log_selected = $file . '/' . $r_date . '/' . $r_channel; $irc_log_rows = array(); if (@is_file($fullname)) { $irc_log_rows = IRC_Log_Parser::parseFile($fullname, $r_date, $r_filter); } $irc_log_channel = '#' . $r_channel; $irc_log_time = mktime(12, 0, 0, substr($r_date, 2, 2), substr($r_date, 4, 2), substr($r_date, 0, 2)); $smarty->assign('irc_log_channel', $irc_log_channel); $smarty->assign('irc_log_time', $irc_log_time); $smarty->assign('irc_log_options', $irc_log_options); $smarty->assign('irc_log_rows', $irc_log_rows); $smarty->assign('irc_log_selected', $irc_log_selected); $smarty->assign('showall', $r_showall); $smarty->assign('filter', $r_filter); // Display the template $smarty->assign('mid', 'tiki-view_irc.tpl'); $smarty->display("tiki.tpl"); ?>