forked from bionoren/rssFilter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
admin.php
31 lines (25 loc) · 1.01 KB
/
admin.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
<?php
$path = "./";
require_once($path."functions.php");
require_once($path."smarty/Smarty.class.php");
require_once($path."db/SQLiteManager.php");
$fields = ["title", "summary", "category", "contributor", "author", "content", "url"];
$db = SQLiteManager\SQLiteManager::getInstance();
$result = $db->select("feeds");
$feeds = $db->fetchArray($result);
$result = $db->select("aggregateFeeds");
$aggregates = $db->fetchArray($result);
foreach($feeds as &$feed) {
$result = $db->select("filters", null, ["feedID"=>$feed["ID"]]);
$feed["patterns"] = $db->fetchArray($result);
}
//DISPLAY
$smarty = new Smarty();
$smarty->auto_literal = true;
$data = new Smarty_Data();
$data->assign("fields", $fields);
$data->assign("feeds", $feeds);
$data->assign("aggregates", $aggregates);
$data->assign("base_url", "//".$_SERVER[HTTP_HOST].substr($_SERVER[REQUEST_URI],0,strrpos($_SERVER[REQUEST_URI],"/")));
$smarty->display("admin.tpl", $data);
?>