-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex.php
69 lines (61 loc) · 2.13 KB
/
index.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
62
63
64
65
66
67
68
69
<?php
include_once("settings.php");
$counter = new Counter();
$counter->update();
if (isset($_GET["page"])) {
$page = $_GET["page"];
} else {
$page = 1;
}
$cache_id = implode("_", $_GET) . $page;
$template = new UserTemplate('index.tpl', $cache_id);
if (isset($_GET["compile"])) {
$template->force_compile = true;
}
if (!$template->is_cached('index.tpl', $cache_id)) {
if ($page > 1) {
if ($blog_fancyurl == true) {
$template->assign('prev_page_link', $blog_baseurl . "/page/" . ($page - 1));
} else {
$template->assign('prev_page_link', "index.php?page=" . ($page - 1));
}
}
if (Entry::getEntryCount() > (($page) * $blog_entries_per_page)) {
if ($blog_fancyurl == true) {
$template->assign('next_page_link', $blog_baseurl . "/page/" . ($page + 1));
} else {
$template->assign('next_page_link', "index.php?page=" . ($page + 1));
}
}
if (isset($_GET["archive"])) {
$template->assign('view', 'archive');
$template->assign('keyword', $_GET["archive"]);
$archive = Archive::getArchive($_GET["archive"]);
$entries = $archive->getEntries();
$template->assign('entries', $entries);
} else if (isset($_GET["category"])) {
$template->assign('view', 'category');
$template->assign('keyword', $_GET["category"]);
$category = new Category($_GET["category"]);
$template->assign('entries', $category->getEntries());
} else if (isset($_GET["search"])) {
$template->assign('view', 'search');
$template->assign('keyword', $_GET["search"]);
$search_mode = "all";
if (isset($_GET["mode"])) {
$search_mode = $_GET["mode"];
}
$template->assign('entries', Entry::search($_GET["search"], $search_mode));
} else {
$template->assign('view', 'index');
$template->assign('keyword', "all");
$template->assign('entries', Entry::getEntries($blog_entries_per_page, $page));
}
$template->assign('name_name', rand(1, 1000));
$template->assign('email_name', rand(1001, 2000));
$template->assign('url_name', rand(2001, 3000));
$template->assign('body_name', rand(3001, 4000));
}
$template->display('index.tpl', $cache_id);
# vim: ts=8 sw=2 sts=2 noet
?>