$lunarym = "<br/>{$lunarstream['year']}"; } else { $lunarstream = ''; } $calendarbody = makecalendar($cm, $cy, $month_calendar, $lunarstream); $nextmonth = $cm == 12 ? 1 : $cm + 1; $lastmonth = $cm == 1 ? 12 : $cm - 1; $yearofnextmonth = $cm == 12 ? $cy + 1 : $cy; $yearoflastmonth = $cm == 1 ? $cy - 1 : $cy; $nextyear = $cy + 1; $lastyear = $cy - 1; $nextmonthurl = getlink_archive($nextmonth, $yearofnextmonth); $lastmonthurl = getlink_archive($lastmonth, $yearoflastmonth); $nextyearurl = getlink_archive($cm, $nextyear); $lastyearurl = getlink_archive($cm, $lastyear); $thismonthurl = getlink_archive($cm, $cy); $thisyearurl = "archive.php"; $cal_body = <<<eot <table id="calendar" cellspacing="1" width="100%"> <tbody><tr><td colspan="7" class="calendar-top"> <a href="{$lastyearurl}" rel="noindex,nofollow"><</a> <a href="{$thisyearurl}" rel="noindex,nofollow"><span class="calendar-year">{$cy}</span></a> <a href="{$nextyearurl}" rel="noindex,nofollow">></a> \t <a href="{$lastmonthurl}" rel="noindex,nofollow"><</a> <a href="{$thismonthurl}" rel="noindex,nofollow"><span class="calendar-month">{$cm}</span></a> <a href="{$nextmonthurl}" rel="noindex,nofollow">></a>{$lunarym} </td></tr> <tr class="calendar-weekdays"> \t<td class="calendar-weekday-cell">{$lnc[115]}</td> \t<td class="calendar-weekday-cell">{$lnc[116]}</td>
$partialquery = "{$limitation2} blogid in({$jointstr}) ORDER BY `pubtime` DESC"; $urlpattern = getlink_archive($month, $year, '%s', '1'); if ($flset['modeselectable'] != 1) { $pagebaritem = ""; } $timeperiod_start = gmmktime(0, 0, 0, $month, 1, $year); $archiveformat = $mbcon['archiveformat'] == 'custom' ? $mbcon['customarchiveformat'] : $mbcon['archiveformat']; $pagetitle = zhgmdate($archiveformat, $timeperiod_start) . " {$lnc[106]} × "; if ($mbcon['archive_list'] == 1) { $perpagevalue = $mbcon['listitemperpage']; $actionforexc = 'list'; $urlref = getlink_archive($month, $year, '2', '%s'); } else { $perpagevalue = $mbcon['exceptperpage']; $actionforexc = 'excerpt'; $urlref = getlink_archive($month, $year, '1', '%s'); } break; case 'showday': if (!$itemid) { @header("Location: index.php"); } else { @(list($year, $month, $day) = @explode('-', $itemid)); } $year = intval($year); $month = intval($month); $day = intval($day); $timeperiod_start = gmmktime(0, 0, 0, $month, $day, $year) - $config['timezone'] * 3600; $timeperiod_end = gmmktime(0, 0, 0, $month, $day + 1, $year) - $config['timezone'] * 3600; $counter_now = $blog->countbyquery("SELECT COUNT(blogid) FROM `{$db_prefix}blogs` {$limitation2} `pubtime`>'{$timeperiod_start}' AND `pubtime`<'{$timeperiod_end}' ORDER BY `pubtime` DESC"); $urlpattern = getlink_date($year, $month, $day, '%s', '1');
function recache_currentmonthentries() { global $blog, $db_prefix, $nowtime, $lna, $lnc, $mbcon, $config; $cm = $nowtime['month']; $cy = $nowtime['year']; $result = $blog->getarraybyquery("SELECT (cday) FROM `{$db_prefix}calendar` WHERE `cyearmonth`='{$nowtime['Ym']}'"); $month_calendar = is_array($result['cday']) ? array_unique($result['cday']) : array(); if ($mbcon['lunarcalendar'] != 0) { $lunarstream = lunarcalendar($cm, $cy); $lunarym = "<br/>{$lunarstream['year']}"; } else { $lunarstream = ''; } $calendarbody = makecalendar($cm, $cy, $month_calendar, $lunarstream); $nextmonth = $cm == 12 ? 1 : $cm + 1; $lastmonth = $cm == 1 ? 12 : $cm - 1; $yearofnextmonth = $cm == 12 ? $cy + 1 : $cy; $yearoflastmonth = $cm == 1 ? $cy - 1 : $cy; $nextyear = $cy + 1; $lastyear = $cy - 1; $nextmonthurl = getlink_archive($nextmonth, $yearofnextmonth); $lastmonthurl = getlink_archive($lastmonth, $yearoflastmonth); $nextyearurl = getlink_archive($cm, $nextyear); $lastyearurl = getlink_archive($cm, $lastyear); $thismonthurl = getlink_archive($cm, $cy); $thisyearurl = "archive.php"; $out = <<<eot <table id="calendar" cellspacing="1" width="100%"> <tbody><tr><td colspan="7" class="calendar-top"> <a href="{$lastyearurl}" rel="noindex,nofollow"><</a> <a href="{$thisyearurl}" rel="noindex,nofollow"><span class="calendar-year">{$cy}</span></a> <a href="{$nextyearurl}" rel="noindex,nofollow">></a> \t <a href="{$lastmonthurl}" rel="noindex,nofollow"><</a> <a href="{$thismonthurl}" rel="noindex,nofollow"><span class="calendar-month">{$cm}</span></a> <a href="{$nextmonthurl}" rel="noindex,nofollow">></a>{$lunarym} </td></tr> <tr class="calendar-weekdays"> \t<td class="calendar-weekday-cell">{$lnc[115]}</td> \t<td class="calendar-weekday-cell">{$lnc[116]}</td> \t<td class="calendar-weekday-cell">{$lnc[117]}</td> \t<td class="calendar-weekday-cell">{$lnc[118]}</td> \t<td class="calendar-weekday-cell">{$lnc[119]}</td> \t<td class="calendar-weekday-cell">{$lnc[120]}</td> \t<td class="calendar-weekday-cell">{$lnc[121]}</td> </tr> {$calendarbody} </tbody></table> eot; //$out="<?PHP\n\$month_calendar=array(".@implode(',', $result_all).");"; if (!writetofile("data/cache_currentmonth.php", $out)) { catcherror($lna[66] . "data/cache_currentmonth.php"); } }
} if ($job == 'archivelist') { $allvaliddates = $blog->getarraybyquery("SELECT `pubtime` FROM `{$db_prefix}blogs` ORDER BY `pubtime` DESC"); $allvaliddates = $allvaliddates['pubtime']; $resultdates = array(); $result = "<table width=\"100%\">"; if (is_array($allvaliddates)) { foreach ($allvaliddates as $time) { $y = gmdate('Y', $time + 3600 * $config['timezone']); $m = gmdate('n', $time + 3600 * $config['timezone']); $resultdates[$y][$m] += 1; } $uniquedates = array_keys($resultdates); for ($i = 0; $i < count($uniquedates); $i++) { $y = $uniquedates[$i]; $result .= "<tr><td colspan=\"4\"><strong>{$y}{$lnc[299]}</strong></td></tr>\n<tr>"; for ($j = 1; $j < 13; $j++) { $resultdates[$y][$j] = floor($resultdates[$y][$j]); $result .= "<td><a href=\"" . getlink_archive($j, $y) . "\" rel=\"noindex,nofollow\"><strong>{$j}{$lnc[298]}</strong></a> ({$resultdates[$y][$j]})</td>"; if ($j % 4 == 0) { $result .= "</tr><tr>"; } } $result .= "</tr>\n"; } } $result .= "</table>"; $section_body_main = $t->set('contentpage', array('title' => $lnc[106], 'contentbody' => $result)); announcebar(); $bodymenu = $t->set('mainpage', array('pagebar' => '', 'iftoppage' => 'none', 'ifbottompage' => 'none', 'ifannouncement' => $ifannouncement, 'topannounce' => $topannounce, 'mainpart' => $section_body_main, 'currentpage' => '', 'previouspageurl' => '', 'nextpageurl' => '', 'turningpages' => '', 'totalpages' => '', 'previouspageexists' => '', 'nextpageexists' => '')); }