-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path1page.php
More file actions
62 lines (55 loc) · 2.31 KB
/
1page.php
File metadata and controls
62 lines (55 loc) · 2.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
<?php
/**
* 新建页面
*/
if(!defined('EMLOG_ROOT')) {exit('error!');}
?>
<div id="wrapper">
<main id="primary" class="main items post-content post-single" role="main" itemprop="mainContentOfPage">
<article id="post-1" class="post-1 post type-post status-publish format-standard hentry category-uncategorized" itemscope itemtype="http://schema.org/BlogPosting" itemprop="blogPost">
<div class="entry-content" itemprop="mainEntity">
<?php echo $log_content; ?>
<?php
function displayRecord(){
global $CACHE;
$record_cache = $CACHE->readCache('record');
$output = '';
foreach($record_cache as $value){
$output .= '<div class="archive-title"><h3>'.$value['record'].'('.$value['lognum'].')</h3>'.displayRecordItem($value['date']).'';
}
$output = '<div id="archives-temp">'.$output.'</div>';
return $output;
}
function displayRecordItem($record){
if (preg_match("/^([\d]{4})([\d]{2})$/", $record, $match)) {
$days = getMonthDayNum($match[2], $match[1]);
$record_stime = emStrtotime($record . '01');
$record_etime = $record_stime + 3600 * 24 * $days;
} else {
$record_stime = emStrtotime($record);
$record_etime = $record_stime + 3600 * 24;
}
$sql = "and date>=$record_stime and date<$record_etime order by top desc ,date desc";
$result = archiver_db($sql);
return $result;
}
function archiver_db($condition = ''){
$DB = MySql::getInstance();
$sql = "SELECT gid, title, date, views FROM " . DB_PREFIX . "blog WHERE type='blog' and hide='n' $condition";
$result = $DB->query($sql);
$output = '';
while ($row = $DB->fetch_array($result)) {
$log_url = Url::log($row['gid']);
$output .= '<div class="brick"><a href="'.$log_url.'"><span class="time"><i class="iconfont"></i>'.date('Y年m月d日',$row['date']).'</span>'.$row['title'].'<em></em></a></div>';
}
$output = empty($output) ? '<span class="ar-circle"></span><div class="arrow-left-ar"></div><div class="brick">暂无文章</div>' : $output;
$output = '<div class="archives" id="monlist">'.$output.'</div></div>';
return $output;
}
echo displayRecord();
?>
</div><!-- .entry-content -->
</article>
<!-- You can start editing here. -->
</main><!-- .main -->
<?php include View::getView('footer');?>