2 error_reporting(E_ERROR | E_WARNING | E_PARSE
);
4 header('Content-Type: text/html; charset=utf-8');
6 $basedir = dirname(dirname(dirname(__FILE__
)));
9 dirname(__FILE__
) . PATH_SEPARATOR
.
10 $basedir . PATH_SEPARATOR
.
11 "$basedir/include" . PATH_SEPARATOR
.
14 define('MOBILE_VERSION', true);
16 require_once "config.php";
17 require_once "mobile-functions.php";
19 require_once "functions.php";
20 require_once "sessions.php";
21 require_once "version.php";
22 require_once "db-prefs.php";
24 if (!$_SESSION["uid"]) return;
26 $op = $_REQUEST["op"];
30 $cmode = db_escape_string($_REQUEST["mark"]);
31 $id = db_escape_string($_REQUEST["id"]);
33 markArticlesById(array($id), $cmode);
35 case "togglePublished":
36 $cmode = db_escape_string($_REQUEST["pub"]);
37 $id = db_escape_string($_REQUEST["id"]);
39 publishArticlesById(array($id), $cmode);
42 $cmode = db_escape_string($_REQUEST["unread"]);
43 $id = db_escape_string($_REQUEST["id"]);
45 catchupArticlesById(array($id), $cmode);
49 $id = db_escape_string($_REQUEST["id"]);
50 $value = db_escape_string($_REQUEST["to"]);
51 mobile_set_pref($id, $value);
55 print json_encode(array("error", "UNKNOWN_METHOD"));