"Connection failed", 1 => "Success", 2 => "Invalid object received", 16 => "Access denied" ); function __construct($host) { $this->link = $host->get_link(); $this->host = $host; $host->add_hook($host::HOOK_PREFS_TABS, $this); $host->add_handler("pref-instances", "*", $this); } function get_prefs_js() { return file_get_contents(dirname(__FILE__) . "/instances.js"); } function hook_prefs_tabs($args) { if ($_SESSION["access_level"] >= 10 || SINGLE_USER_MODE) { ?>
link, "DELETE FROM ttrss_linked_instances WHERE id IN ($ids)"); } function add() { $id = db_escape_string($_REQUEST["id"]); $access_url = db_escape_string($_REQUEST["access_url"]); $access_key = db_escape_string($_REQUEST["access_key"]); db_query($this->link, "BEGIN"); $result = db_query($this->link, "SELECT id FROM ttrss_linked_instances WHERE access_url = '$access_url'"); if (db_num_rows($result) == 0) { db_query($this->link, "INSERT INTO ttrss_linked_instances (access_url, access_key, last_connected, last_status_in, last_status_out) VALUES ('$access_url', '$access_key', '1970-01-01', -1, -1)"); } db_query($this->link, "COMMIT"); } function edit() { $id = db_escape_string($_REQUEST["id"]); $result = db_query($this->link, "SELECT * FROM ttrss_linked_instances WHERE id = '$id'"); print ""; print ""; print ""; print "" . __("Use one access key for both linked instances."); print "
" . __("You can connect other instances of Tiny Tiny RSS to this one to share Popular feeds. Link to this instance of Tiny Tiny RSS by using this URL:"); print " (display url)"; print "
".__('Instance URL')." | ".__('Access key')." | ".__('Last connected')." | ".__('Status')." | ".__('Stored feeds')." | |
"; $onclick = "onclick='editInstance($id, event)' title='".__('Click to edit')."'"; $access_key = mb_substr($line['access_key'], 0, 4) . '...' . mb_substr($line['access_key'], -4); print " | " . htmlspecialchars($line['access_url']) . " | "; print "" . htmlspecialchars($access_key) . " | "; print "" . htmlspecialchars($line['last_connected']) . " | "; print "" . $this->status_codes[$line['last_status_out']] . " | "; print "" . htmlspecialchars($line['num_feeds']) . " | "; print "