/* Decoded by unphp.net */ ?>= date( 'Ym' ) AND !$config['news_future'] ) $next = false; $cur_date=date( 'Ymj', time() ); $cal_date = $cal_year.$cal_month; $cal_month = intval( $cal_month ); $cal_year = intval( $cal_year ); if( $cal_month < 0 ) $cal_month = 1; if( $cal_year < 0 ) $cal_year = 2008; $first_of_month = mktime( 0, 0, 0, $cal_month, 7, $cal_year ); $maxdays = date( 't', $first_of_month ) + 1; // 28-31 $prev_of_month = mktime( 0, 0, 0, ($cal_month - 1), 7, $cal_year ); $next_of_month = mktime( 0, 0, 0, ($cal_month + 1), 7, $cal_year ); $cal_day = 1; $weekday = date( 'w', $first_of_month ); // 0-6 if( $config['allow_alt_url'] ) { $date_link['prev'] = '«    '; $date_link['next'] = '    »'; } else { $date_link['prev'] = '«    '; $date_link['next'] = '    »'; } if( ! $next ) $date_link['next'] = "    »"; $buffer = '
'; $buffer = str_replace( $f, $r, $buffer ); for($it = 1; $it < 6; $it ++) $buffer .= ''; $buffer .= ''; $buffer .= ''; $buffer .= ''; if( $weekday > 0 ) { $buffer .= ''; } while ( $maxdays > $cal_day ) { $cal_pos = $cal_date.$cal_day; if( $weekday == 7 ) { $buffer .= ''; $weekday = 0; } if( isset( $events[$cal_day] ) ) { $date['title'] = langdate( 'd F Y', $events[$cal_day], true ); if( $weekday == '5' or $weekday == '6' ) { if( $config['allow_alt_url'] ) $buffer .= ''; else $buffer .= ''; } else { if( $config['allow_alt_url'] ) $buffer .= ''; else $buffer .= ''; } } else { if( $weekday == "5" or $weekday == "6" ) { $buffer .= ''; } else { $buffer .= ''; } } $cal_day ++; $weekday ++; } if( $weekday != 7 ) { $buffer .= ''; } return $buffer . '
' . $date_link['prev'] . langdate( 'F', $first_of_month, true ) . ' ' . $cal_year . $date_link['next'] . '
' . $langdateshortweekdays[$it] . '' . $langdateshortweekdays[6] . '' . $langdateshortweekdays[0] . '
 
' . $cal_day . '' . $cal_day . '' . $cal_day . '' . $cal_day . '' . $cal_day . '' . $cal_day . ' 
'; } if( $config['allow_calendar'] ) { $events = array (); $thisdate = date( "Y-m-d H:i:s", $_TIME ); if( $config['no_date'] AND !$config['news_future'] ) $where_date = " AND date < '" . $thisdate . "'"; else $where_date = ""; $this_month = date( 'm', $_TIME ); $this_year = date( 'Y', $_TIME ); $sql = ""; if( $year != '' AND $month != '' ) $cache_id = $config['skin'] . $month . $year; else $cache_id = $config['skin'] . $this_month . $this_year; $tpl->result['calendar'] = dle_cache( "calendar", $cache_id ); if( ! $tpl->result['calendar'] ) { if( $year != '' AND $month != '' ) { $month = totranslit($month, true, false); if( ($year == $this_year and $month < $this_month) or ($year < $this_year) ) { $where_date = ""; $approve = ""; } else { $approve = " AND approve=1"; } $sql = "SELECT DISTINCT DAYOFMONTH(date) as day FROM " . PREFIX . "_post WHERE date >= '{$year}-{$month}-01' AND date < '{$year}-{$month}-01' + INTERVAL 1 MONTH" . $approve . $where_date; $this_month = $month; $this_year = $year; } else { $sql = "SELECT DISTINCT DAYOFMONTH(date) as day FROM " . PREFIX . "_post WHERE date >= '{$this_year}-{$this_month}-01' AND date < '{$this_year}-{$this_month}-01' + INTERVAL 1 MONTH AND approve=1" . $where_date; } $db->query( $sql ); while ( $row = $db->get_row() ) { $events[$row['day']] = strtotime( $this_year . "-" . $this_month . "-" . $row['day'] ); } $db->free(); $tpl->result['calendar'] = cal( $this_month, $this_year, $events ); create_cache( "calendar", $tpl->result['calendar'], $cache_id ); } } if( $config['allow_archives'] ) { $tpl->result['archive'] = dle_cache( "archives", $config['skin'] ); if( ! $tpl->result['archive'] ) { $f2 = array ('01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12' ); $f3 = array ('Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec' ); if( $config['no_date'] AND !$config['news_future'] ) { $thisdate = date( "Y-m-d H:i:s", $_TIME ); $where_date = " AND date < '" . $thisdate . "'"; } else $where_date = ""; $db->query( "SELECT DATE_FORMAT(date,'%b %Y') AS m_date, MAX(date) AS max, COUNT(id) AS cnt FROM " . PREFIX . "_post WHERE approve=1" . $where_date . " GROUP BY m_date ORDER BY max desc" ); $news_archive = array (); while ( $row = $db->get_row() ) { $arch_title['ru'] = str_replace( $f3, $r, $row['m_date'] ); $arch_title['en'] = str_replace( $f3, $f2, $row['m_date'] ); $arch_url = explode( " ", $arch_title['en'] ); $arch_title['en'] = $arch_url[1] . "/" . $arch_url[0]; if( $config['allow_alt_url'] ) $news_archive[] = '' . $arch_title['ru'] . ' (' . $row['cnt'] . ')'; else $news_archive[] = "" . $arch_title['ru'] . " (" . $row['cnt'] . ")"; } $db->free(); $i = count( $news_archive ); if( $i > 6 ) { $news_archive[6] = "
" . $news_archive[6]; $news_archive[] = "

" . $lang['show_archive'] . "
"; } if( $i ) $tpl->result['archive'] = implode( "
", $news_archive ); else $tpl->result['archive'] = ""; create_cache( "archives", $tpl->result['archive'], $config['skin'] ); } } if ($is_change) $config['allow_cache'] = false; ?>