-
Notifications
You must be signed in to change notification settings - Fork 2
/
archivo.php
61 lines (47 loc) · 1.7 KB
/
archivo.php
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
<?php
require_once('config.inc.php');
require_once('conexion.inc.php');
require_once('modelos.inc.php');
require_once('util.inc.php');
$mes = rb_mes_desde_url();
$anio = rb_anio_desde_url();
$posts = rb_mes_posts($mes, $anio);
$valor = sprintf("%04d-%02d", $anio, $mes);
$formateado = rb_mes_formatear($valor);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>Redis Blog Demo</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="/style.css" />
</head>
<body>
<h1><?php echo $CONF['titulo_blog'] ?></h1>
<div class="main">
<h2>Post para '<?= $formateado ?>'</h2>
<?php if (count($posts) > 0) { ?>
<?php foreach($posts as $post) { ?>
<p><?= date("Y-m-d", strtotime($post['fecha_pub'])) ?> <a href="<?= $CONF['base_url'] ?>post.php/<?= $post['slug'] ?>"><?= $post['titulo']; ?></a></p>
<p><i>Tags:
<?php foreach($post['tags'] as $tag) { ?>
<a href="<?= $CONF['base_url'] ?>tag.php/<?= urlencode($tag) ?>"><?= $tag ?></a>
<?php } ?>
<?php } ?>
<?php } else { ?>
<p><i>No hay posts para este mes en el blog por el momento.</i</p>
<?php } ?>
</div>
<div class="sidebar">
<div class="tag-cloud">
<h2>Nube de tags</h2>
<?php include('nube.inc.php'); ?>
</div>
<div class="archive-block">
<h2>Archivo</h2>
<?php include('archivo.inc.php'); ?>
</div>
</div>
</body>
</html>