-
Notifications
You must be signed in to change notification settings - Fork 37
/
Copy pathshow_archives.php
48 lines (38 loc) · 1.01 KB
/
show_archives.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
<?php
/**
* @desc show_archives.php is DEPRECATED, use show_news.php instead
* In news is [archid] field, copied by migration script
*/
require_once ('core/init.php');
// Check including & init
check_direct_including('show_archives.php');
$_list_archives = db_get_archives();
if (isset($static) && $static)
$_archive = 0;
else
$_archive = REQ('archive');
// Select
if (!$_archive)
{
krsort($_list_archives);
foreach ($_list_archives as $id => $info)
{
$count = intval($info['c']);
if ($url = cn_rewrite('archive', $id))
{
$arch_url = $url;
}
else
{
$arch_url = cn_url_modify('archive='.$id);
}
echo "<a href=\"$arch_url\">".date("d M Y", $info['min']) ." – ".date("d M Y", $info['max'])." (<b>$count</b>)</a><br />";
}
$_found_archives = count($_list_archives);
unset($static, $id);
}
// Delegate all deprecated archive list to show news
else
{
include 'show_news.php';
}