]>
Commit | Line | Data |
---|---|---|
9d9ed2b3 AD |
1 | <?php |
2 | error_reporting(E_ERROR | E_WARNING | E_PARSE); | |
3 | ||
4 | header('Content-Type: text/html; charset=utf-8'); | |
5 | ||
6 | $basedir = dirname(dirname(dirname(__FILE__))); | |
7 | ||
8 | set_include_path( | |
9 | dirname(__FILE__) . PATH_SEPARATOR . | |
10 | $basedir . PATH_SEPARATOR . | |
11 | "$basedir/include" . PATH_SEPARATOR . | |
12 | get_include_path()); | |
13 | ||
14 | define('MOBILE_VERSION', true); | |
15 | ||
16 | require_once "config.php"; | |
17 | require_once "mobile-functions.php"; | |
18 | ||
19 | require_once "functions.php"; | |
20 | require_once "sessions.php"; | |
21 | require_once "version.php"; | |
22 | require_once "db-prefs.php"; | |
23 | ||
24 | $link = db_connect(DB_HOST, DB_USER, DB_PASS, DB_NAME); | |
25 | ||
ba68b681 | 26 | init_plugins($link); |
9d9ed2b3 AD |
27 | |
28 | if (!$_SESSION["uid"]) return; | |
29 | ||
30 | $op = $_REQUEST["op"]; | |
31 | ||
32 | switch ($op) { | |
33 | case "toggleMarked": | |
6322ac79 AD |
34 | $cmode = db_escape_string( $_REQUEST["mark"]); |
35 | $id = db_escape_string( $_REQUEST["id"]); | |
9d9ed2b3 | 36 | |
6322ac79 | 37 | markArticlesById( array($id), $cmode); |
9d9ed2b3 AD |
38 | break; |
39 | case "togglePublished": | |
6322ac79 AD |
40 | $cmode = db_escape_string( $_REQUEST["pub"]); |
41 | $id = db_escape_string( $_REQUEST["id"]); | |
9d9ed2b3 | 42 | |
6322ac79 | 43 | publishArticlesById( array($id), $cmode); |
9d9ed2b3 AD |
44 | break; |
45 | case "toggleUnread": | |
6322ac79 AD |
46 | $cmode = db_escape_string( $_REQUEST["unread"]); |
47 | $id = db_escape_string( $_REQUEST["id"]); | |
9d9ed2b3 | 48 | |
6322ac79 | 49 | catchupArticlesById( array($id), $cmode); |
9d9ed2b3 AD |
50 | break; |
51 | ||
52 | case "setPref": | |
6322ac79 AD |
53 | $id = db_escape_string( $_REQUEST["id"]); |
54 | $value = db_escape_string( $_REQUEST["to"]); | |
55 | mobile_set_pref( $id, $value); | |
9d9ed2b3 AD |
56 | print_r($_SESSION); |
57 | break; | |
58 | default: | |
59 | print json_encode(array("error", "UNKNOWN_METHOD")); | |
60 | break; | |
61 | } | |
62 | ?> | |
63 |