-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathtimeline_theme.php
More file actions
70 lines (58 loc) · 1.82 KB
/
timeline_theme.php
File metadata and controls
70 lines (58 loc) · 1.82 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
63
64
65
66
67
68
69
70
<?php
/**
* 神奇的timeline主题版
*
* @package custom
*/
?>
<html>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta name="author" content="leton,leton2008(at)yahoo.com.cn" />
<title>
<?php $this->options->title(); ?>
<?php $this->archiveTitle(); ?>
</title>
<link rel="stylesheet" type="text/css" media="all" href="<?php $this->options->themeUrl('Timeline/timeline.css'); ?>" />
<!-- JavaScript -->
<script type="text/javascript" src="<?php $this->options->themeUrl('Timeline/jquery-min.js'); ?>"></script>
<!-- <script type="text/javascript" src="jquery.mobile-1.0.min.js"></script> -->
<script type="text/javascript" src="<?php $this->options->themeUrl('Timeline/timeline-min.js'); ?>"></script>
<script>
$(document).ready(function() {
timeline = new VMM.Timeline();
timeline.init();
});
</script>
<body>
<div id="timeline">
<section>
<time>2006,1,1</time>
<h2><?php $this->options->title(); ?></h2>
<article>
<p><?php $this->options->description(); ?></p>
</article>
</section>
<ul>
<?php
/**获取适配器名称 , Typecho_Db::SORT_DESC*/
$db = Typecho_Db::get();
/**获取日志总数*/
$result = $db->fetchAll($db->select()->from('table.contents')
->where('table.contents.status = ?', 'publish')
->where('table.contents.type = ?', 'post')
->order('table.contents.created'));
$size = sizeof($result);
for($i =0;$i < $size ; ++$i)
{
$post = $result[$i];
$value = Typecho_Widget::widget('Widget_Abstract_Contents')->push($post);
echo '<li>';
echo '<time>'.$value['date']->year.','.$value['date']->month.','. $value['date']->day .'</time>';
echo '<h3>' .$value['title'].'</h3>';
echo '</li>';
}
?>
</ul>
</div>
</body>
</html>