function index() { header("Content-type: text/html; charset=utf-8"); login_sequence($this->link); global $link; $link = $this->link; require_once dirname(__FILE__) . "/digest_body.php"; }
<?php error_reporting(E_ERROR | E_WARNING | E_PARSE); define('MOBILE_VERSION', true); require_once "../../config.php"; require_once "functions.php"; require_once "../../functions.php"; require_once "../../sessions.php"; require_once "../../version.php"; require_once "../../db-prefs.php"; $link = db_connect(DB_HOST, DB_USER, DB_PASS, DB_NAME); init_connection($link); login_sequence($link, 2); /* perform various redirect-needing subops */ $subop = db_escape_string($_GET["subop"]); $go = $_GET["go"]; if ($subop == "tc" && !$go) { $cat_id = db_escape_string($_GET["id"]); toggle_collapse_cat($link, $cat_id); header("Location: index.php"); return; } $ts_id = db_escape_string($_GET["ts"]); if ($go == "vf" && $ts_id) { toggleMarked($link, $ts_id); $query_string = preg_replace("/&ts=[0-9]*/", "", $_SERVER["QUERY_STRING"]); header("Location: index.php?{$query_string}"); return; } $tp_id = db_escape_string($_GET["tp"]); if ($go == "vf" && $tp_id) {
<?php error_reporting(E_ERROR | E_WARNING | E_PARSE); header('Content-Type: text/html; charset=utf-8'); define('MOBILE_VERSION', true); require_once "../config.php"; require_once "functions.php"; require_once "../functions.php"; require_once "../sessions.php"; require_once "../version.php"; require_once "../db-prefs.php"; $link = db_connect(DB_HOST, DB_USER, DB_PASS, DB_NAME); init_connection($link); login_sequence($link, true); $feed_id = db_escape_string($_REQUEST["id"]); $cat_id = db_escape_string($_REQUEST["cat"]); $offset = (int) db_escape_string($_REQUEST["skip"]); $search = db_escape_string($_REQUEST["search"]); $is_cat = (bool) db_escape_string($_REQUEST["is_cat"]); render_headlines_list($link, $feed_id, $cat_id, $offset, $search, $is_cat); ?>
<?php require_once "sessions.php"; require_once "config.php"; require_once "functions.php"; require_once "db.php"; define('MAX_SOURCE_SCHEMA_VERSION', 5); define('TARGET_SCHEMA_VERSION', 5); $link = db_connect(DB_HOST, DB_USER, DB_PASS, DB_NAME); login_sequence($link); if (!$link) { if (DB_TYPE == "mysql") { print mysql_error(); } // PG seems to display its own errors just fine by default. return; } if (DB_TYPE == "pgsql") { pg_query("set client_encoding = 'utf-8'"); } $result = db_query($link, "SELECT schema_version FROM ttrss_version"); $schema_version = db_fetch_result($result, 0, "schema_version"); if ($schema_version != TARGET_SCHEMA_VERSION) { print "Error: database schema is invalid\n\t\t\t(got version {$schema_version}; expected " . TARGET_SCHEMA_VERSION . ")"; return; } function import_article($link, $data) { print "<p>Article: <b>" . $data["title"] . "</b> (" . $data["feed_title"] . ")<br>"; $owner_uid = $_SESSION["uid"]; db_query($link, "BEGIN");
set_include_path(dirname(__FILE__) . "/include" . PATH_SEPARATOR . get_include_path()); if (!file_exists("config.php")) { print "<b>Fatal Error</b>: You forgot to copy\n\t\t<b>config.php-dist</b> to <b>config.php</b> and edit it.\n"; exit; } require_once "autoload.php"; require_once "sessions.php"; require_once "functions.php"; require_once "sanity_check.php"; require_once "version.php"; require_once "config.php"; require_once "db-prefs.php"; if (!init_plugins()) { return; } login_sequence(); header('Content-Type: text/html; charset=utf-8'); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <title>Tiny Tiny RSS : <?php echo __("Preferences"); ?> </title> <script type="text/javascript"> var __ttrss_version = "<?php echo VERSION; ?>
<?php error_reporting(E_ERROR | E_WARNING | E_PARSE); header('Content-Type: text/html; charset=utf-8'); define('MOBILE_VERSION', true); $basedir = dirname(dirname(dirname(__FILE__))); set_include_path(dirname(__FILE__) . PATH_SEPARATOR . $basedir . PATH_SEPARATOR . "{$basedir}/include" . PATH_SEPARATOR . get_include_path()); require_once "config.php"; require_once "mobile-functions.php"; login_sequence(true); $use_cats = mobile_get_pref('ENABLE_CATS'); $offset = (int) db_escape_string($_REQUEST["skip"]); if ($use_cats) { render_categories_list($link); } else { render_flat_feed_list($offset); }
function subscribe() { if (SINGLE_USER_MODE) { login_sequence(); } if ($_SESSION["uid"]) { $feed_url = $this->dbh->escape_string(trim($_REQUEST["feed_url"])); header('Content-Type: text/html; charset=utf-8'); print "<html>\n\t\t\t\t<head>\n\t\t\t\t\t<title>Tiny Tiny RSS</title>\n\t\t\t\t\t<link rel=\"stylesheet\" type=\"text/css\" href=\"css/utility.css\">\n\t\t\t\t\t<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\"/>\n\t\t\t\t</head>\n\t\t\t\t<body>\n\t\t\t\t<img class=\"floatingLogo\" src=\"images/logo_small.png\"\n\t\t\t \t\talt=\"Tiny Tiny RSS\"/>\n\t\t\t\t\t<h1>" . __("Subscribe to feed...") . "</h1><div class='content'>"; $rc = subscribe_to_feed($feed_url); switch ($rc['code']) { case 0: print_warning(T_sprintf("Already subscribed to <b>%s</b>.", $feed_url)); break; case 1: print_notice(T_sprintf("Subscribed to <b>%s</b>.", $feed_url)); break; case 2: print_error(T_sprintf("Could not subscribe to <b>%s</b>.", $feed_url)); break; case 3: print_error(T_sprintf("No feeds found in <b>%s</b>.", $feed_url)); break; case 4: print_notice(__("Multiple feed URLs found.")); $feed_urls = $rc["feeds"]; break; case 5: print_error(T_sprintf("Could not subscribe to <b>%s</b>.<br>Can't download the Feed URL.", $feed_url)); break; } if ($feed_urls) { print "<form action=\"public.php\">"; print "<input type=\"hidden\" name=\"op\" value=\"subscribe\">"; print "<select name=\"feed_url\">"; foreach ($feed_urls as $url => $name) { $url = htmlspecialchars($url); $name = htmlspecialchars($name); print "<option value=\"{$url}\">{$name}</option>"; } print "<input type=\"submit\" value=\"" . __("Subscribe to selected feed") . "\">"; print "</form>"; } $tp_uri = get_self_url_prefix() . "/prefs.php"; $tt_uri = get_self_url_prefix(); if ($rc['code'] <= 2) { $result = $this->dbh->query("SELECT id FROM ttrss_feeds WHERE\n\t\t\t\t\tfeed_url = '{$feed_url}' AND owner_uid = " . $_SESSION["uid"]); $feed_id = $this->dbh->fetch_result($result, 0, "id"); } else { $feed_id = 0; } print "<p>"; if ($feed_id) { print "<form method=\"GET\" style='display: inline'\n\t\t\t\t\taction=\"{$tp_uri}\">\n\t\t\t\t\t<input type=\"hidden\" name=\"tab\" value=\"feedConfig\">\n\t\t\t\t\t<input type=\"hidden\" name=\"method\" value=\"editFeed\">\n\t\t\t\t\t<input type=\"hidden\" name=\"methodparam\" value=\"{$feed_id}\">\n\t\t\t\t\t<input type=\"submit\" value=\"" . __("Edit subscription options") . "\">\n\t\t\t\t\t</form>"; } print "<form style='display: inline' method=\"GET\" action=\"{$tt_uri}\">\n\t\t\t\t<input type=\"submit\" value=\"" . __("Return to Tiny Tiny RSS") . "\">\n\t\t\t\t</form></p>"; print "</div></body></html>"; } else { render_login_form(); } }
function index() { header("Content-type: text/html; charset=utf-8"); login_sequence(); require_once dirname(__FILE__) . "/digest_body.php"; }