$serendipity['GET']['action'] = null;
$serendipity['GET']['hidefooter'] = null;
}
-
+
switch($serendipity['calendar']) {
case 'gregorian':
default:
$gday = 1;
-
+
if ($week) {
$tm = strtotime('+ '. ($week-2) .' WEEKS monday', mktime(0, 0, 0, 1, 1, $year));
$ts = mktime(0, 0, 0, date('m', $tm), date('j', $tm), $year);
}
}
break;
-
+
case 'jalali-utf8':
require_once S9Y_INCLUDE_PATH . 'include/functions_calendars.inc.php';
$gday = 1;
$week *= 7;
++$week;
$day = $week;
-
+
// convert day number of year to day number of month AND month number of year
$j_days_in_month = array(0, 31, 31, 31, 31, 31, 31, 30, 30, 30, 30, 30, 29);
if(($g_y % 4) == 3) $j_days_in_month[12]++;
-
+
for($i=1; isset($j_days_in_month[$i]); ++$i){
if(($day-$j_days_in_month[$i])>0){
$day -= $j_days_in_month[$i];
break;
}
}
-
+
$tm = jalali_mktime(0, 0, 0, $i, $day, $year);
$ts = jalali_mktime(0, 0, 0, jalali_date_utf('m', $tm), jalali_date_utf('j', $tm), $year);
$te = jalali_mktime(23, 59, 59, jalali_date_utf('m', $tm), jalali_date_utf('j', $tm)+7, $year);
$date = serendipity_formatTime('%B %Y', $ts, false);
}
}
-
+
list($year, $month, $day) = j2g ($year, $month, $day);
break;
}
}
}
}
-
+
ob_start();
include_once(S9Y_INCLUDE_PATH . 'rss.php');
$data = ob_get_contents();
include_once(S9Y_INCLUDE_PATH . 'include/genpage.inc.php');
} else if (preg_match(PAT_PLUGIN, $uri, $matches)) {
serendipity_plugin_api::hook_event('external_plugin', $matches[2]);
- exit;
+ if (!defined('NO_EXIT')) {
+ exit;
+ }
} else if ($is_multicat || preg_match(PAT_PERMALINK_CATEGORIES, $uri, $matches)) {
if ($is_multicat) {
serendipity_track_referrer();
}
-$raw_data = ob_get_contents();
-ob_end_clean();
-$serendipity['smarty']->assign('raw_data', $raw_data);
-if (empty($serendipity['smarty_file'])) {
- $serendipity['smarty_file'] = '404.tpl';
-}
+if (!defined('NO_EXIT')) {
+ $raw_data = ob_get_contents();
+ ob_end_clean();
+ $serendipity['smarty']->assign('raw_data', $raw_data);
+ if (empty($serendipity['smarty_file'])) {
+ $serendipity['smarty_file'] = '404.tpl';
+ }
-serendipity_gzCompression();
+ serendipity_gzCompression();
-$serendipity['smarty']->display(serendipity_getTemplateFile($serendipity['smarty_file'], 'serendipityPath'));
+ $serendipity['smarty']->display(serendipity_getTemplateFile($serendipity['smarty_file'], 'serendipityPath'));
+}
if ($global_debug) {
/* TODO: Remove (hide) this debug */