-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathrecent.php
More file actions
executable file
·71 lines (55 loc) · 2.01 KB
/
recent.php
File metadata and controls
executable file
·71 lines (55 loc) · 2.01 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
71
<?php
/**
* Linkmonger Recent - the most recent links feed to linkmonger
*
* @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
* @author Timothy B Martin <tim@design1st.org>
*/
require_once("configs/config.php");
require_once("include/linkmonger.lib.php");
require_once("include/Links.class.php");
$smarty = createSmarty();
// Page vars
$smarty->assign("pageTitle", "Today’s Linkmonger");
$smarty->assign("pageRefresh", $_SERVER['REQUEST_URI']);
$smarty->assign("navSelected", "recent");
// User auth
$smarty->assign("signin", true);
$smarty->assign("who", setWho($_COOKIE));
if (!empty($db->captured_errors)) {
$errors['db'][] = errorMsg("db_fail");
} else {
if (isset($_GET['comments'])) { print('comments!'); }
// Get list of users for submitter filter
$smarty->assign("submitters", dbUsernames($db));
// Link functions
$smarty->assign("tool_clumpadd", true);
// create the almighty links object!
$links =& new Links($db);
// add submitter to query and assign to template for preselected popup
if (isset($_GET['submitter']) && $_GET['submitter'] != "_all") {
$smarty->assign("submitter", $_GET['submitter']);
$links->addWhere("submitter", $_GET['submitter']);
}
// add the default parts for this query
$links->addWhere("archived", 1);
if (isset($_GET['dead'])) {
$links->addWhere("dead", 1);
}
$links->setOrder("submit_time");
// set the page
$page = setPage($_GET);
// get one page of links and assign page urls
if ($pageOfLinks = $links->get($page)) {
$smarty->assign("linkArray", $pageOfLinks);
$smarty->assign("nextPageURL", pageQueryString($_GET, $links->getCount(), $page, 1));
$smarty->assign("prevPageURL", pageQueryString($_GET, $links->getCount(), $page, -1));
} else {
$errors['link'][] = errorMsg("link_none");
}
$smarty->assign("linkCount", dbLinkCount($db));
$smarty->assign("currentTime", date("F j, Y, g:i a"));
}
if (isset($errors)) $smarty->assign("errors", $errors);
$smarty->display("list.tpl");
?>