Beispiel #1
0
<? engine::error_headers(); ?>
<? include_once('templates'.SL.'side'.SL.'head.php'); ?>
<body>	
	<? include_once('templates'.SL.'side'.SL.'header.php'); ?>
	<table width="100%">
		<tr>
			<td valign="top" id="sidebar">
				<? include_once('templates'.SL.'side'.SL.'sidebar.php'); ?>
			</td>		
			<td valign="top" id="content">
				<div class="post">
					<? include_once('templates'.SL.'side'.SL.'top.php'); ?>
					<table width="100%" id="error">
						<tr>
							<td>
								<img src="<?php 
echo $def['site']['dir'];
?>
/images/booru_404_<?php 
echo rand(1, 2);
?>
.jpg">
							</td>
						</tr>			
					</table>
				</div>
			</td>
		</tr>
		<tr>
			<td colspan="2" id="footer">
Beispiel #2
0
 function get_data()
 {
     global $url;
     if ($url[2] == 'search') {
         $page = empty($url[5]) ? 1 : $url[5];
         return $this->search($url[3], $page);
     }
     $return['display'] = array('logs_navi', 'logs_search', 'logs_body', 'logs_arrows');
     if (!$this->nocache) {
         $return['logs'] = base64_decode(obj::db()->sql('select cache from logs where (year=' . $url[2] . ' and month =' . $url[3] . ' and day=' . $url[4] . ' and cache_key =' . static::$cache_key . ')', 2, 'cache'));
     }
     if (!$return['logs']) {
         $today = mktime(0, 0, 0, $url[3], $url[4], $url[2]) * 1000;
         $rooms = 'roomID = ' . implode(' or roomID = ', static::$room_ids);
         $return['logs'] = obj::db('chat')->sql('select nickname, logTime, body from ofMucConversationLog where ((' . $rooms . ') and cast(logTime as unsigned) > ' . $today . ' and cast(logTime as unsigned) < ' . ($today + 86400000) . ') order by logTime');
         if (is_array($return['logs'])) {
             foreach ($return['logs'] as $key => &$log) {
                 if (trim($log['body'])) {
                     $log['text'] = $this->format_logs($log['body'], $log['nickname']);
                 } else {
                     unset($return['logs'][$key]);
                 }
             }
         }
     }
     if (!$return['logs']) {
         $return['nologs'] = 'За этот день нет ни одного лога.';
     }
     $start = array($this->start_year, $this->start_month, $this->start_day);
     $end = array(date("Y"), date("n"), date("j"));
     $current = array($url[2], $url[3], $url[4]);
     $base = substr(get_called_class(), 8);
     if (array_diff_assoc($end, $current) && is_array($return['logs'])) {
         $this->make_logs_cache($return['logs'], $url[2], $url[3], $url[4]);
     }
     $rumonth = array('Январь', 'Февраль', 'Март', 'Апрель', 'Май', 'Июнь', 'Июль', 'Август', 'Сентябрь', 'Октябрь', 'Ноябрь', 'Декабрь');
     for ($i = $start[0]; $i <= $end[0]; $i++) {
         $start_month = $i == $start[0] ? $start[1] : 1;
         $end_month = $i == $end[0] ? $end[1] : 12;
         for ($j = $start_month; $j <= $end_month; $j++) {
             $return['month'][$i == $current[0] && $j == $current[1] ? 'current' : '/' . $base . '/' . $i . '/' . $j . '/' . ($j > $start[1] ? 1 : $start[2]) . '/'] = $rumonth[$j - 1] . ' ' . $i;
         }
     }
     $return['log_base'] = $base;
     $yesterday = mktime(12, 0, 0, $url[3], $url[4] - 1, $url[2]);
     $tomorrow = mktime(12, 0, 0, $url[3], $url[4] + 1, $url[2]);
     $start_time = mktime(0, 0, 0, $start[1], $start[2], $start[0]);
     if ($yesterday > $start_time) {
         $return['navi']['yesterday'] = array('url' => '/' . $base . '/' . date("Y", $yesterday) . '/' . date("n", $yesterday) . '/' . date("j", $yesterday) . '/', 'name' => $rumonth[date("n", $yesterday) - 1] . ' ' . date("j", $yesterday));
     } elseif ($yesterday < mktime(0, 0, 0, $start[1], $start[2] - 1, $start[0])) {
         $return['nologs'] = "Логов раньше, чем за " . Transform_Time::to_string($start_time) . " попросту нет, комната появилась в тот день.";
         engine::error_headers();
     }
     $return['navi']['today'] = array('name' => $rumonth[$url[3] - 1] . ' ' . $url[4]);
     if ($tomorrow < mktime(24, 0, 0, $end[1], $end[2], $end[0])) {
         $return['navi']['tomorrow'] = array('url' => '/' . $base . '/' . date("Y", $tomorrow) . '/' . date("n", $tomorrow) . '/' . date("j", $tomorrow) . '/', 'name' => $rumonth[date("n", $tomorrow) - 1] . ' ' . date("j", $tomorrow));
     } elseif ($tomorrow > mktime(24, 0, 0, $end[1], $end[2] + 1, $end[0])) {
         $return['nologs'] = "Забегаем в будущее?";
         engine::error_headers();
     }
     return $return;
 }