当前位置: 首页>>代码示例>>PHP>>正文


PHP get_self_url_prefix函数代码示例

本文整理汇总了PHP中get_self_url_prefix函数的典型用法代码示例。如果您正苦于以下问题:PHP get_self_url_prefix函数的具体用法?PHP get_self_url_prefix怎么用?PHP get_self_url_prefix使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了get_self_url_prefix函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: shareArticle

 function shareArticle()
 {
     $param = db_escape_string($_REQUEST['param']);
     $result = db_query($this->link, "SELECT uuid, ref_id FROM ttrss_user_entries WHERE int_id = '{$param}'\n\t\t\tAND owner_uid = " . $_SESSION['uid']);
     if (db_num_rows($result) == 0) {
         print "Article not found.";
     } else {
         $uuid = db_fetch_result($result, 0, "uuid");
         $ref_id = db_fetch_result($result, 0, "ref_id");
         if (!$uuid) {
             $uuid = db_escape_string(sha1(uniqid(rand(), true)));
             db_query($this->link, "UPDATE ttrss_user_entries SET uuid = '{$uuid}' WHERE int_id = '{$param}'\n\t\t\t\t\tAND owner_uid = " . $_SESSION['uid']);
         }
         print __("You can share this article by the following unique URL:");
         $url_path = get_self_url_prefix();
         $url_path .= "/public.php?op=share&key={$uuid}";
         print "<div class=\"tagCloudContainer\">";
         print "<a id='pub_opml_url' href='{$url_path}' target='_blank'>{$url_path}</a>";
         print "</div>";
         /* if (!label_find_id($this->link, __('Shared'), $_SESSION["uid"]))
         				label_create($this->link, __('Shared'), $_SESSION["uid"]);
         
         			label_add_article($this->link, $ref_id, __('Shared'), $_SESSION['uid']); */
     }
     print "<div align='center'>";
     print "<button dojoType=\"dijit.form.Button\" onclick=\"return dijit.byId('shareArticleDlg').hide()\">" . __('Close this window') . "</button>";
     print "</div>";
 }
开发者ID:bohoo,项目名称:tiny_tiny_rss-openshift-quickstart-1,代码行数:28,代码来源:init.php

示例2: hook_prefs_tab

 function hook_prefs_tab($args)
 {
     if ($args != "prefPrefs") {
         return;
     }
     print "<div dojoType=\"dijit.layout.AccordionPane\" title=\"" . __("Fever Emulation") . "\">";
     print "<h3>" . __("Fever Emulation") . "</h3>";
     print "<p>" . __("Since the Fever API uses a different authentication mechanism to Tiny Tiny RSS, you must set a separate password to login. This password may be the same as your Tiny Tiny RSS password.") . "</p>";
     print "<p>" . __("Set a password to login with Fever:") . "</p>";
     print "<form dojoType=\"dijit.form.Form\">";
     print "<script type=\"dojo/method\" event=\"onSubmit\" args=\"evt\">\n\t\t\tevt.preventDefault();\n\t\t\tif (this.validate()) {\n\t\t\t\tnew Ajax.Request('backend.php', {\n\t\t\t\t\tparameters: dojo.objectToQuery(this.getValues()),\n\t\t\t\t\tonComplete: function(transport) {\n\t\t\t\t\t\tnotify_info(transport.responseText);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\t//this.reset();\n\t\t\t}\n\t\t\t</script>";
     print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"op\" value=\"pluginhandler\" />";
     print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"method\" value=\"save\" />";
     print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"plugin\" value=\"fever\" />";
     print "<input dojoType=\"dijit.form.ValidationTextBox\" required=\"1\" type=\"password\" name=\"password\" />";
     print "<button dojoType=\"dijit.form.Button\" type=\"submit\">" . __("Set Password") . "</button>";
     print "</form>";
     print "<p>" . __("To login with the Fever API, set your server details in your favourite RSS application to: ") . get_self_url_prefix() . "/plugins/fever/" . "</p>";
     print "<p>" . __("Additional details can be found at ") . "<a href=\"http://www.feedafever.com/api\" target=\"_blank\">http://www.feedafever.com/api</a></p>";
     print "<p>" . __("Note: Due to the limitations of the API and some RSS clients (for example, Reeder on iOS), some features are unavailable: \"Special\" Feeds (Published / Tags / Labels / Fresh / Recent), Nested Categories (hierarchy is flattened)") . "</p>";
     print "</div>";
 }
开发者ID:ranzhe,项目名称:tinytinyrss-fever-plugin,代码行数:22,代码来源:init.php

示例3: subscribe2

 function subscribe2()
 {
     $feed_url = $this->dbh->escape_string(trim($_REQUEST["feed_url"]));
     $cat_id = $this->dbh->escape_string($_REQUEST["cat_id"]);
     $from = $this->dbh->escape_string($_REQUEST["from"]);
     $feed_urls = array();
     /* only read authentication information from POST */
     $auth_login = $this->dbh->escape_string(trim($_POST["auth_login"]));
     $auth_pass = $this->dbh->escape_string(trim($_POST["auth_pass"]));
     $rc = subscribe_to_feed($feed_url, $cat_id, $auth_login, $auth_pass);
     switch ($rc) {
         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 0:
             print_warning(T_sprintf("Already subscribed to <b>%s</b>.", $feed_url));
             break;
         case 4:
             print_notice(__("Multiple feed URLs found."));
             $contents = @fetch_file_contents($url, false, $auth_login, $auth_pass);
             if (is_html($contents)) {
                 $feed_urls = get_feeds_from_html($url, $contents);
             }
             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=\"backend.php\">";
         print "<input type=\"hidden\" name=\"op\" value=\"pref-feeds\">";
         print "<input type=\"hidden\" name=\"quiet\" value=\"1\">";
         print "<input type=\"hidden\" name=\"method\" value=\"add\">";
         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 <= 2) {
         $result = $this->dbh->query("SELECT id FROM ttrss_feeds WHERE\n\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\taction=\"{$tp_uri}\">\n\t\t\t\t<input type=\"hidden\" name=\"tab\" value=\"feedConfig\">\n\t\t\t\t<input type=\"hidden\" name=\"method\" value=\"editFeed\">\n\t\t\t\t<input type=\"hidden\" name=\"methodparam\" value=\"{$feed_id}\">\n\t\t\t\t<input type=\"submit\" value=\"" . __("Edit subscription options") . "\">\n\t\t\t\t</form>";
     }
     print "<form style='display: inline' method=\"GET\" action=\"{$tt_uri}\">\n\t\t\t<input type=\"submit\" value=\"" . __("Return to Tiny Tiny RSS") . "\">\n\t\t\t</form></p>";
     print "</body></html>";
 }
开发者ID:cs-team,项目名称:tiny_tiny_rss-openshift-quickstart,代码行数:63,代码来源:public.php

示例4: update_rss_feed


//.........这里部分代码省略.........
        }
        $filters = load_filters($link, $feed, $owner_uid);
        $labels = get_all_labels($link, $owner_uid);
        if ($debug_enabled) {
            //print_r($filters);
            _debug("update_rss_feed: " . count($filters) . " filters loaded.");
        }
        $items = $rss->get_items();
        if (!is_array($items)) {
            if ($debug_enabled) {
                _debug("update_rss_feed: no articles found.");
            }
            db_query($link, "UPDATE ttrss_feeds\n\t\t\t\t\tSET last_updated = NOW(), last_error = '' WHERE id = '{$feed}'");
            return;
            // no articles
        }
        if ($pubsub_state != 2 && PUBSUBHUBBUB_ENABLED) {
            if ($debug_enabled) {
                _debug("update_rss_feed: checking for PUSH hub...");
            }
            $feed_hub_url = false;
            $links = $rss->get_links('hub');
            if ($links && is_array($links)) {
                foreach ($links as $l) {
                    $feed_hub_url = $l;
                    break;
                }
            }
            if ($debug_enabled) {
                _debug("update_rss_feed: feed hub url: {$feed_hub_url}");
            }
            if ($feed_hub_url && function_exists('curl_init') && !ini_get("open_basedir")) {
                require_once 'lib/pubsubhubbub/subscriber.php';
                $callback_url = get_self_url_prefix() . "/public.php?op=pubsub&id={$feed}";
                $s = new Subscriber($feed_hub_url, $callback_url);
                $rc = $s->subscribe($fetch_url);
                if ($debug_enabled) {
                    _debug("update_rss_feed: feed hub url found, subscribe request sent.");
                }
                db_query($link, "UPDATE ttrss_feeds SET pubsub_state = 1\n\t\t\t\t\t\tWHERE id = '{$feed}'");
            }
        }
        if ($debug_enabled) {
            _debug("update_rss_feed: processing articles...");
        }
        foreach ($items as $item) {
            if ($_REQUEST['xdebug'] == 3) {
                print_r($item);
            }
            $entry_guid = $item->get_id();
            if (!$entry_guid) {
                $entry_guid = $item->get_link();
            }
            if (!$entry_guid) {
                $entry_guid = make_guid_from_title($item->get_title());
            }
            if ($debug_enabled) {
                _debug("update_rss_feed: guid {$entry_guid}");
            }
            if (!$entry_guid) {
                continue;
            }
            $entry_guid = "{$owner_uid},{$entry_guid}";
            $entry_timestamp = "";
            $entry_timestamp = strtotime($item->get_date());
            if ($entry_timestamp == -1 || !$entry_timestamp) {
开发者ID:bohoo,项目名称:tiny_tiny_rss-openshift-quickstart-1,代码行数:67,代码来源:rssfuncs.php

示例5: index

 function index()
 {
     if (!function_exists('curl_init')) {
         print "<div style='padding : 1em'>";
         print_error("This functionality requires CURL functions. Please enable CURL in your PHP configuration (you might also want to disable open_basedir in php.ini) and reload this page.");
         print "</div>";
     }
     print "<div id=\"pref-instance-wrap\" dojoType=\"dijit.layout.BorderContainer\" gutters=\"false\">";
     print "<div id=\"pref-instance-header\" dojoType=\"dijit.layout.ContentPane\" region=\"top\">";
     print "<div id=\"pref-instance-toolbar\" dojoType=\"dijit.Toolbar\">";
     $sort = db_escape_string($_REQUEST["sort"]);
     if (!$sort || $sort == "undefined") {
         $sort = "access_url";
     }
     print "<div dojoType=\"dijit.form.DropDownButton\">" . "<span>" . __('Select') . "</span>";
     print "<div dojoType=\"dijit.Menu\" style=\"display: none;\">";
     print "<div onclick=\"selectTableRows('prefInstanceList', 'all')\"\n\t\t\tdojoType=\"dijit.MenuItem\">" . __('All') . "</div>";
     print "<div onclick=\"selectTableRows('prefInstanceList', 'none')\"\n\t\t\tdojoType=\"dijit.MenuItem\">" . __('None') . "</div>";
     print "</div></div>";
     print "<button dojoType=\"dijit.form.Button\" onclick=\"addInstance()\">" . __('Link instance') . "</button>";
     print "<button dojoType=\"dijit.form.Button\" onclick=\"editSelectedInstance()\">" . __('Edit') . "</button>";
     print "<button dojoType=\"dijit.form.Button\" onclick=\"removeSelectedInstances()\">" . __('Remove') . "</button>";
     print "</div>";
     #toolbar
     $result = db_query($this->link, "SELECT *,\n\t\t\t(SELECT COUNT(*) FROM ttrss_linked_feeds\n\t\t\t\tWHERE instance_id = ttrss_linked_instances.id) AS num_feeds\n\t\t\tFROM ttrss_linked_instances\n\t\t\tORDER BY {$sort}");
     print "<p class=\"insensitive\" style='margin-left : 1em;'>" . __("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 " <a href=\"#\" onclick=\"alert('" . htmlspecialchars(get_self_url_prefix()) . "')\">(display url)</a>";
     print "<p><table width='100%' id='prefInstanceList' class='prefInstanceList' cellspacing='0'>";
     print "<tr class=\"title\">\n\t\t\t<td align='center' width=\"5%\">&nbsp;</td>\n\t\t\t<td width=''><a href=\"#\" onclick=\"updateInstanceList('access_url')\">" . __('Instance URL') . "</a></td>\n\t\t\t<td width='20%'><a href=\"#\" onclick=\"updateInstanceList('access_key')\">" . __('Access key') . "</a></td>\n\t\t\t<td width='10%'><a href=\"#\" onclick=\"updateUsersList('last_connected')\">" . __('Last connected') . "</a></td>\n\t\t\t<td width='10%'><a href=\"#\" onclick=\"updateUsersList('last_status_out')\">" . __('Status') . "</a></td>\n\t\t\t<td width='10%'><a href=\"#\" onclick=\"updateUsersList('num_feeds')\">" . __('Stored feeds') . "</a></td>\n\t\t\t</tr>";
     $lnum = 0;
     while ($line = db_fetch_assoc($result)) {
         $class = $lnum % 2 ? "even" : "odd";
         $id = $line['id'];
         $this_row_id = "id=\"LIRR-{$id}\"";
         $line["last_connected"] = make_local_datetime($this->link, $line["last_connected"], false);
         print "<tr class=\"{$class}\" {$this_row_id}>";
         print "<td align='center'><input onclick='toggleSelectRow(this);'\n\t\t\t\ttype=\"checkbox\" id=\"LICHK-{$id}\"></td>";
         $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 "<td {$onclick}>" . htmlspecialchars($line['access_url']) . "</td>";
         print "<td {$onclick}>" . htmlspecialchars($access_key) . "</td>";
         print "<td {$onclick}>" . htmlspecialchars($line['last_connected']) . "</td>";
         print "<td {$onclick}>" . $this->status_codes[$line['last_status_out']] . "</td>";
         print "<td {$onclick}>" . htmlspecialchars($line['num_feeds']) . "</td>";
         print "</tr>";
         ++$lnum;
     }
     print "</table>";
     print "</div>";
     #pane
     print "</div>";
     #container
 }
开发者ID:rolfkleef,项目名称:Tiny-Tiny-RSS,代码行数:53,代码来源:instances.php

示例6: format_headline_subtoolbar

 private function format_headline_subtoolbar($feed_site_url, $feed_title, $feed_id, $is_cat, $search, $match_on, $search_mode, $view_mode, $error)
 {
     $page_prev_link = "viewFeedGoPage(-1)";
     $page_next_link = "viewFeedGoPage(1)";
     $page_first_link = "viewFeedGoPage(0)";
     $catchup_page_link = "catchupPage()";
     $catchup_feed_link = "catchupCurrentFeed()";
     $catchup_sel_link = "catchupSelection()";
     $archive_sel_link = "archiveSelection()";
     $delete_sel_link = "deleteSelection()";
     $sel_all_link = "selectArticles('all')";
     $sel_unread_link = "selectArticles('unread')";
     $sel_none_link = "selectArticles('none')";
     $sel_inv_link = "selectArticles('invert')";
     $tog_unread_link = "selectionToggleUnread()";
     $tog_marked_link = "selectionToggleMarked()";
     $tog_published_link = "selectionTogglePublished()";
     if ($is_cat) {
         $cat_q = "&is_cat={$is_cat}";
     }
     if ($search) {
         $search_q = "&q={$search}&m={$match_on}&smode={$search_mode}";
     } else {
         $search_q = "";
     }
     $rss_link = htmlspecialchars(get_self_url_prefix() . "/public.php?op=rss&id={$feed_id}{$cat_q}{$search_q}");
     // right part
     $reply .= "<span class='r'>";
     if ($feed_site_url) {
         $target = "target=\"_blank\"";
         $reply .= "<a title=\"" . __("Visit the website") . "\" {$target} href=\"{$feed_site_url}\">" . truncate_string($feed_title, 30) . "</a>";
         if ($error) {
             $reply .= " (<span class=\"error\" title=\"{$error}\">Error</span>)";
         }
     } else {
         $reply .= $feed_title;
     }
     $reply .= "\r\n\t\t\t<a href=\"#\"\r\n\t\t\t\ttitle=\"" . __("View as RSS feed") . "\"\r\n\t\t\t\tonclick=\"displayDlg('generatedFeed', '{$feed_id}:{$is_cat}:{$rss_link}')\">\r\n\t\t\t\t<img class=\"noborder\" style=\"vertical-align : middle\" src=\"images/feed-icon-12x12.png\"></a>";
     $reply .= "</span>";
     // left part
     $reply .= __('Select:') . "\r\n\t\t\t<a href=\"#\" onclick=\"{$sel_all_link}\">" . __('All') . "</a>,\r\n\t\t\t<a href=\"#\" onclick=\"{$sel_unread_link}\">" . __('Unread') . "</a>,\r\n\t\t\t<a href=\"#\" onclick=\"{$sel_inv_link}\">" . __('Invert') . "</a>,\r\n\t\t\t<a href=\"#\" onclick=\"{$sel_none_link}\">" . __('None') . "</a></li>";
     $reply .= " ";
     $reply .= "<select dojoType=\"dijit.form.Select\"\r\n\t\t\tonchange=\"headlineActionsChange(this)\">";
     $reply .= "<option value=\"false\">" . __('Actions...') . "</option>";
     $reply .= "<option value=\"0\" disabled=\"1\">" . __('Selection toggle:') . "</option>";
     $reply .= "<option value=\"{$tog_unread_link}\">" . __('Unread') . "</option>\r\n\t\t\t<option value=\"{$tog_marked_link}\">" . __('Starred') . "</option>\r\n\t\t\t<option value=\"{$tog_published_link}\">" . __('Published') . "</option>";
     $reply .= "<option value=\"0\" disabled=\"1\">" . __('Selection:') . "</option>";
     $reply .= "<option value=\"{$catchup_sel_link}\">" . __('Mark as read') . "</option>";
     if ($feed_id != "0") {
         $reply .= "<option value=\"{$archive_sel_link}\">" . __('Archive') . "</option>";
     } else {
         $reply .= "<option value=\"{$archive_sel_link}\">" . __('Move back') . "</option>";
         $reply .= "<option value=\"{$delete_sel_link}\">" . __('Delete') . "</option>";
     }
     $reply .= "<option value=\"emailArticle(false)\">" . __('Forward by email') . "</option>";
     $reply .= "<option value=\"0\" disabled=\"1\">" . __('Feed:') . "</option>";
     $reply .= "<option value=\"catchupPage()\">" . __('Mark as read') . "</option>";
     $reply .= "<option value=\"displayDlg('generatedFeed', '{$feed_id}:{$is_cat}:{$rss_link}')\">" . __('View as RSS') . "</option>";
     $reply .= "</select>";
     //$reply .= "</div>";
     //$reply .= "</h2";
     return $reply;
 }
开发者ID:nvdnkpr,项目名称:Tiny-Tiny-RSS,代码行数:63,代码来源:feeds.php

示例7: twitter_dialog

function twitter_dialog($link, $text)
{
    if (mb_strlen($text, 'utf-8') > 140) {
        $key = create_snippet($link, $text);
        $shorturl = new ShortUrl();
        $snippet_url = $shorturl->create(get_self_url_prefix() . '/snippet.php?key=' . $key, 'isgd');
        $tweet = truncate_string($text, 90) . " {$snippet_url}";
    } else {
        $tweet = $text;
    }
    $counter = 140 - mb_strlen($tweet, 'utf-8');
    ?>
		<div id="infoBoxTitle"><?php 
    echo __("Send Tweet");
    ?>
</div>
		<div class="infoBoxContents">
			<div id="mini-notice" style='display : none'>&nbsp;</div>
	
			<form id="new_tweet_form" onsubmit="return false;">
	
			<input type="hidden" name="op" value="send-tweet"/>

			<div class="dlgSec"><?php 
    echo __("Your tweet:");
    ?>
</div>

			<textarea onkeyup="tweet_update_counter(this)" name="text" class="tweet-text"><?php 
    echo $tweet;
    ?>
</textarea><p>

			<?php 
    if ($snippet_url) {
        ?>

			<div class="dlgSec"><?php 
        echo __("Full IRC snippet:");
        ?>
</div>
			<textarea disabled="1" class="tweet-snippet"><?php 
        echo $text;
        ?>
</textarea><p>

			<?php 
    }
    ?>

			<div class="dlgButtons">
				<div style='float : left'>
					<input id="tweet-dlg-counter" disabled="1" name="counter" value="<?php 
    echo $counter;
    ?>
">
				</div>
				<button type="submit" onclick="tweet_selection_do()"><?php 
    echo __('Tweet this!');
    ?>
</button>
				<button type="submit" onclick="close_infobox()"><?php 
    echo __('Cancel');
    ?>
</button></div>
			</div>
	
			</form>
	
		</div>
	
		<?php 
}
开发者ID:RulerOf,项目名称:Tiny-Tiny-IRC,代码行数:73,代码来源:functions.php

示例8: index


//.........这里部分代码省略.........
     print "<div onclick=\"resetFeedOrder()\"\n\t\t\tdojoType=\"dijit.MenuItem\">" . __('Reset sort order') . "</div>";
     print "<div onclick=\"batchSubscribe()\"\n\t\t\tdojoType=\"dijit.MenuItem\">" . __('Batch subscribe') . "</div>";
     print "</div></div>";
     if (get_pref($this->link, 'ENABLE_FEED_CATS')) {
         print "<div dojoType=\"dijit.form.DropDownButton\">" . "<span>" . __('Categories') . "</span>";
         print "<div dojoType=\"dijit.Menu\" style=\"display: none;\">";
         print "<div onclick=\"editFeedCats()\"\n\t\t\t\tdojoType=\"dijit.MenuItem\">" . __('Edit categories') . "</div>";
         print "<div onclick=\"toggleHiddenFeedCats()\"\n\t\t\t\tdojoType=\"dijit.MenuItem\">" . __('(Un)hide empty categories') . "</div>";
         print "<div onclick=\"resetCatOrder()\"\n\t\t\t\tdojoType=\"dijit.MenuItem\">" . __('Reset sort order') . "</div>";
         print "</div></div>";
     }
     print $error_button;
     print $inactive_button;
     print "<button dojoType=\"dijit.form.Button\" onclick=\"removeSelectedFeeds()\">" . __('Unsubscribe') . "</button dojoType=\"dijit.form.Button\"> ";
     if (defined('_ENABLE_FEED_DEBUGGING')) {
         print "<select id=\"feedActionChooser\" onchange=\"feedActionChange()\">\n\t\t\t\t<option value=\"facDefault\" selected>" . __('More actions...') . "</option>";
         if (FORCE_ARTICLE_PURGE == 0) {
             print "<option value=\"facPurge\">" . __('Manual purge') . "</option>";
         }
         print "\n\t\t\t\t<option value=\"facClear\">" . __('Clear feed data') . "</option>\n\t\t\t\t<option value=\"facRescore\">" . __('Rescore articles') . "</option>";
         print "</select>";
     }
     print "</div>";
     # toolbar
     //print '</div>';
     print '<div dojoType="dijit.layout.ContentPane" region="center">';
     print "<div id=\"feedlistLoading\">\n\t\t<img src='images/indicator_tiny.gif'>" . __("Loading, please wait...") . "</div>";
     print "<div dojoType=\"fox.PrefFeedStore\" jsId=\"feedStore\"\n\t\t\turl=\"backend.php?op=pref-feeds&method=getfeedtree\">\n\t\t</div>\n\t\t<div dojoType=\"lib.CheckBoxStoreModel\" jsId=\"feedModel\" store=\"feedStore\"\n\t\tquery=\"{id:'root'}\" rootId=\"root\" rootLabel=\"Feeds\"\n\t\t\tchildrenAttrs=\"items\" checkboxStrict=\"false\" checkboxAll=\"false\">\n\t\t</div>\n\t\t<div dojoType=\"fox.PrefFeedTree\" id=\"feedTree\"\n\t\t\tdndController=\"dijit.tree.dndSource\"\n\t\t\tbetweenThreshold=\"5\"\n\t\t\tmodel=\"feedModel\" openOnClick=\"false\">\n\t\t<script type=\"dojo/method\" event=\"onClick\" args=\"item\">\n\t\t\tvar id = String(item.id);\n\t\t\tvar bare_id = id.substr(id.indexOf(':')+1);\n\n\t\t\tif (id.match('FEED:')) {\n\t\t\t\teditFeed(bare_id);\n\t\t\t} else if (id.match('CAT:')) {\n\t\t\t\teditCat(bare_id, item);\n\t\t\t}\n\t\t</script>\n\t\t<script type=\"dojo/method\" event=\"onLoad\" args=\"item\">\n\t\t\tElement.hide(\"feedlistLoading\");\n\t\t</script>\n\t\t</div>";
     print "<div dojoType=\"dijit.Tooltip\" connectId=\"feedTree\" position=\"below\">\n\t\t\t" . __('<b>Hint:</b> you can drag feeds and categories around.') . "\n\t\t\t</div>";
     print '</div>';
     print '</div>';
     print "</div>";
     # feeds pane
     print "<div dojoType=\"dijit.layout.AccordionPane\" title=\"" . __('Import and export') . "\">";
     print "<h3>" . __("OPML") . "</h3>";
     print "<p>" . __("Using OPML you can export and import your feeds, filters, labels and Tiny Tiny RSS settings.") . " ";
     print __("Only main settings profile can be migrated using OPML.") . "</p>";
     print "<iframe id=\"upload_iframe\"\n\t\t\tname=\"upload_iframe\" onload=\"opmlImportComplete(this)\"\n\t\t\tstyle=\"width: 400px; height: 100px; display: none;\"></iframe>";
     print "<form  name=\"opml_form\" style='display : block' target=\"upload_iframe\"\n\t\t\tenctype=\"multipart/form-data\" method=\"POST\"\n\t\t\taction=\"backend.php\">\n\t\t\t<input id=\"opml_file\" name=\"opml_file\" type=\"file\">&nbsp;\n\t\t\t<input type=\"hidden\" name=\"op\" value=\"dlg\">\n\t\t\t<input type=\"hidden\" name=\"method\" value=\"importOpml\">\n\t\t\t<button dojoType=\"dijit.form.Button\" onclick=\"return opmlImport();\" type=\"submit\">" . __('Import my OPML') . "</button>";
     print "<hr>";
     print "<p>" . __('Filename:') . " <input type=\"text\" id=\"filename\" value=\"TinyTinyRSS.opml\" />&nbsp;" . __('Include settings') . "<input type=\"checkbox\" id=\"settings\" checked=\"1\"/>";
     print "</p><button dojoType=\"dijit.form.Button\"\n\t\t\tonclick=\"gotoExportOpml(document.opml_form.filename.value, document.opml_form.settings.checked)\" >" . __('Export OPML') . "</button></p></form>";
     print "<hr>";
     print "<p>" . __('Your OPML can be published publicly and can be subscribed by anyone who knows the URL below.') . " ";
     print __("Published OPML does not include your Tiny Tiny RSS settings, feeds that require authentication or feeds hidden from Popular feeds.") . "</p>";
     print "<button dojoType=\"dijit.form.Button\" onclick=\"return displayDlg('pubOPMLUrl')\">" . __('Display published OPML URL') . "</button> ";
     print "<h3>" . __("Article archive") . "</h3>";
     print "<p>" . __("You can export and import your Starred and Archived articles for safekeeping or when migrating between tt-rss instances.") . "</p>";
     print "<button dojoType=\"dijit.form.Button\" onclick=\"return exportData()\">" . __('Export my data') . "</button> ";
     print "<hr>";
     print "<iframe id=\"data_upload_iframe\"\n\t\t\tname=\"data_upload_iframe\" onload=\"dataImportComplete(this)\"\n\t\t\tstyle=\"width: 400px; height: 100px; display: none;\"></iframe>";
     print "<form name=\"import_form\" style='display : block' target=\"data_upload_iframe\"\n\t\t\tenctype=\"multipart/form-data\" method=\"POST\"\n\t\t\taction=\"backend.php\">\n\t\t\t<input id=\"export_file\" name=\"export_file\" type=\"file\">&nbsp;\n\t\t\t<input type=\"hidden\" name=\"op\" value=\"dlg\">\n\t\t\t<input type=\"hidden\" name=\"method\" value=\"dataimport\">\n\t\t\t<button dojoType=\"dijit.form.Button\" onclick=\"return importData();\" type=\"submit\">" . __('Import') . "</button>";
     print "</div>";
     # pane
     if (strpos($_SERVER['HTTP_USER_AGENT'], "Firefox") !== false) {
         print "<div dojoType=\"dijit.layout.AccordionPane\" title=\"" . __('Firefox integration') . "\">";
         print "<p>" . __('This Tiny Tiny RSS site can be used as a Firefox Feed Reader by clicking the link below.') . "</p>";
         print "<p>";
         print "<button onclick='window.navigator.registerContentHandler(" . "\"application/vnd.mozilla.maybe.feed\", " . "\"" . add_feed_url() . "\", " . " \"Tiny Tiny RSS\")'>" . __('Click here to register this site as a feed reader.') . "</button>";
         print "</p>";
         print "</div>";
         # pane
     }
     print "<div dojoType=\"dijit.layout.AccordionPane\" title=\"" . __('Subscribing using bookmarklet') . "\">";
     print "<p>" . __("Drag the link below to your browser toolbar, open the feed you're interested in in your browser and click on the link to subscribe to it.") . "</p>";
     $bm_subscribe_url = str_replace('%s', '', add_feed_url());
     $confirm_str = str_replace("'", "\\'", __('Subscribe to %s in Tiny Tiny RSS?'));
     $bm_url = htmlspecialchars("javascript:{if(confirm('{$confirm_str}'.replace('%s',window.location.href)))window.location.href='{$bm_subscribe_url}'+window.location.href}");
     print "<a href=\"{$bm_url}\" class='bookmarklet'>" . __('Subscribe in Tiny Tiny RSS') . "</a>";
     print "</div>";
     #pane
     print "<div dojoType=\"dijit.layout.AccordionPane\" title=\"" . __('Published & shared articles / Generated feeds') . "\">";
     print "<h3>" . __("Published articles and generated feeds") . "</h3>";
     print "<p>" . __('Published articles are exported as a public RSS feed and can be subscribed by anyone who knows the URL specified below.') . "</p>";
     $rss_url = '-2::' . htmlspecialchars(get_self_url_prefix() . "/public.php?op=rss&id=-2&view-mode=all_articles");
     print "<button dojoType=\"dijit.form.Button\" onclick=\"return displayDlg('generatedFeed', '{$rss_url}')\">" . __('Display URL') . "</button> ";
     print "<button dojoType=\"dijit.form.Button\" onclick=\"return clearFeedAccessKeys()\">" . __('Clear all generated URLs') . "</button> ";
     print "<h3>" . __("Articles shared by URL") . "</h3>";
     print "<p>" . __("You can disable all articles shared by unique URLs here.") . "</p>";
     print "<button dojoType=\"dijit.form.Button\" onclick=\"return clearArticleAccessKeys()\">" . __('Unshare all articles') . "</button> ";
     print "</div>";
     #pane
     if (defined('CONSUMER_KEY') && CONSUMER_KEY != '') {
         print "<div id=\"pref-feeds-twitter\" dojoType=\"dijit.layout.AccordionPane\" title=\"" . __('Twitter') . "\">";
         $result = db_query($this->link, "SELECT COUNT(*) AS cid FROM ttrss_users\n\t\t\t\tWHERE twitter_oauth IS NOT NULL AND twitter_oauth != '' AND\n\t\t\t\tid = " . $_SESSION['uid']);
         $is_registered = db_fetch_result($result, 0, "cid") != 0;
         if (!$is_registered) {
             print_notice(__('Before you can update your Twitter feeds, you must register this instance of Tiny Tiny RSS with Twitter.com.'));
         } else {
             print_notice(__('You have been successfully registered with Twitter.com and should be able to access your Twitter feeds.'));
         }
         print "<button dojoType=\"dijit.form.Button\" onclick=\"window.location.href = 'twitter.php?op=register'\">" . __("Register with Twitter.com") . "</button>";
         print " ";
         print "<button dojoType=\"dijit.form.Button\"\n\t\t\t\tonclick=\"return clearTwitterCredentials()\">" . __("Clear stored credentials") . "</button>";
         print "</div>";
         # pane
     }
     print "</div>";
     #container
 }
开发者ID:4iji,项目名称:Tiny-Tiny-RSS,代码行数:101,代码来源:pref_feeds.php

示例9: add_feed_url

/**
 * Compute the Mozilla Firefox feed adding URL from server HOST and REQUEST_URI.
 *
 * @return string The Mozilla Firefox feed adding URL.
 */
function add_feed_url()
{
    //$url_path = ($_SERVER['HTTPS'] != "on" ? 'http://' :  'https://') . $_SERVER["HTTP_HOST"] . parse_url($_SERVER["REQUEST_URI"], PHP_URL_PATH);
    $url_path = get_self_url_prefix() . "/public.php?op=subscribe&feed_url=%s";
    return $url_path;
}
开发者ID:rclsilver,项目名称:openshift-tt-rss,代码行数:11,代码来源:functions.php

示例10: publishArticlesById

 private function publishArticlesById($ids, $cmode)
 {
     $tmp_ids = array();
     foreach ($ids as $id) {
         array_push($tmp_ids, "ref_id = '{$id}'");
     }
     $ids_qpart = join(" OR ", $tmp_ids);
     if ($cmode == 0) {
         $newValuepublished = "false";
     } elseif ($cmode == 1) {
         $newValuepublished = "true";
     } else {
         $newValuepublished = "published";
     }
     $this->dbh->query("UPDATE ttrss_user_entries SET\n            published = " . $newValue . ",last_published = NOW()\n            WHERE ({$ids_qpart}) AND owner_uid = " . $_SESSION["uid"]);
     if (PUBSUBHUBBUB_HUB) {
         $rss_link = get_self_url_prefix() . "/public.php?op=rss&id=-2&key=" . get_feed_access_key(-2, false);
         $p = new Publisher(PUBSUBHUBBUB_HUB);
         /* $pubsub_result = */
         $p->publish_update($rss_link);
     }
 }
开发者ID:adrianpietka,项目名称:bfrss,代码行数:22,代码来源:rpc.php

示例11: module_popup_dialog


//.........这里部分代码省略.........
        print "<div class='tagCloudContainer'>";
        print T_sprintf("New version of Tiny Tiny RSS is available (%s).", "<b>{$version}</b>");
        print "</div>";
        $details = "http://tt-rss.org/redmine/versions/show/{$id}";
        $download = "http://tt-rss.org/#Download";
        print "<div style='text-align : center'>";
        print "<button dojoType=\"dijit.form.Button\"\n\t\t\t\tonclick=\"return window.open('{$details}')\">" . __("Details") . "</button>";
        print "<button dojoType=\"dijit.form.Button\"\n\t\t\t\tonclick=\"return window.open('{$download}')\">" . __("Download") . "</button>";
        print "<button dojoType=\"dijit.form.Button\"\n\t\t\t\tonclick=\"return dijit.byId('newVersionDlg').hide()\">" . __('Close this window') . "</button>";
        print "</div>";
    }
    if ($id == "customizeCSS") {
        $value = get_pref($link, "USER_STYLESHEET");
        $value = str_replace("<br/>", "\n", $value);
        print T_sprintf("You can override colors, fonts and layout of your currently selected theme with custom CSS declarations here. <a target=\"_blank\" class=\"visibleLink\" href=\"%s\">This file</a> can be used as a baseline.", "tt-rss.css");
        print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"op\" value=\"rpc\">";
        print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"subop\" value=\"setpref\">";
        print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"key\" value=\"USER_STYLESHEET\">";
        print "<table width='100%'><tr><td>";
        print "<textarea dojoType=\"dijit.form.SimpleTextarea\"\n\t\t\t\tstyle='font-size : 12px; width : 100%; height: 200px;'\n\t\t\t\tplaceHolder='body#ttrssMain { font-size : 14px; };'\n\t\t\t\tname='value'>{$value}</textarea>";
        print "</td></tr></table>";
        print "<div class='dlgButtons'>";
        print "<button dojoType=\"dijit.form.Button\"\n\t\t\t\tonclick=\"dijit.byId('cssEditDlg').execute()\">" . __('Save') . "</button> ";
        print "<button dojoType=\"dijit.form.Button\"\n\t\t\t\tonclick=\"dijit.byId('cssEditDlg').hide()\">" . __('Cancel') . "</button>";
        print "</div>";
    }
    if ($id == "editArticleNote") {
        $result = db_query($link, "SELECT note FROM ttrss_user_entries WHERE\n\t\t\t\tref_id = '{$param}' AND owner_uid = " . $_SESSION['uid']);
        $note = db_fetch_result($result, 0, "note");
        print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"id\" value=\"{$param}\">";
        print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"op\" value=\"rpc\">";
        print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"subop\" value=\"setNote\">";
        print "<table width='100%'><tr><td>";
        print "<textarea dojoType=\"dijit.form.SimpleTextarea\"\n\t\t\t\tstyle='font-size : 12px; width : 100%; height: 100px;'\n\t\t\t\tplaceHolder='body#ttrssMain { font-size : 14px; };'\n\t\t\t\tname='note'>{$note}</textarea>";
        print "</td></tr></table>";
        print "<div class='dlgButtons'>";
        print "<button dojoType=\"dijit.form.Button\"\n\t\t\t\tonclick=\"dijit.byId('editNoteDlg').execute()\">" . __('Save') . "</button> ";
        print "<button dojoType=\"dijit.form.Button\"\n\t\t\t\tonclick=\"dijit.byId('editNoteDlg').hide()\">" . __('Cancel') . "</button>";
        print "</div>";
    }
    if ($id == "about") {
        print "<table width='100%'><tr><td align='center'>";
        print "<img src=\"images/logo_big.png\">";
        print "</td>";
        print "<td width='70%'>";
        print "<h1>Tiny Riny RSS</h1>\n\t\t\t\t<strong>Version " . VERSION . "</strong>\n\t\t\t\t<p>Copyright &copy; 2005-" . date('Y') . "\n\t\t\t\t<a target=\"_blank\" class=\"visibleLink\"\n\t\t\t\thref=\"http://fakecake.org/\">Andrew Dolgov</a>\n\t\t\t\tand other contributors.</p>\n\t\t\t\t<p class=\"insensitive\">Licensed under GNU GPL version 2.</p>";
        print "<p class=\"insensitive\">\n\t\t\t\t<a class=\"visibleLink\" target=\"_blank\"\n\t\t\t\t\thref=\"http://tt-rss.org/\">Official site</a> &mdash;\n\t\t\t\t<a href=\"http://tt-rss.org/redmine/wiki/tt-rss/Donate\"\n\t\t\t\ttarget=\"_blank\" class=\"visibleLink\">\n\t\t\t\tSupport the project.</a></p>";
        print "</td></tr>";
        print "</table>";
        print "<div align='center'>";
        print "<button dojoType=\"dijit.form.Button\"\n\t\t\t\ttype=\"submit\">" . __('Close this window') . "</button>";
        print "</div>";
    }
    if ($id == "addInstance") {
        print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\"  name=\"op\" value=\"pref-instances\">";
        print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\"  name=\"subop\" value=\"add\">";
        print "<div class=\"dlgSec\">" . __("Instance") . "</div>";
        print "<div class=\"dlgSecCont\">";
        /* URL */
        print __("URL:") . " ";
        print "<input dojoType=\"dijit.form.ValidationTextBox\" required=\"1\"\n\t\t\t\tplaceHolder=\"" . __("Instance URL") . "\"\n\t\t\t\tregExp='^(http|https)://.*'\n\t\t\t\tstyle=\"font-size : 16px; width: 20em\" name=\"access_url\">";
        print "<hr/>";
        $access_key = sha1(uniqid(rand(), true));
        /* Access key */
        print __("Access key:") . " ";
        print "<input dojoType=\"dijit.form.ValidationTextBox\" required=\"1\"\n\t\t\t\tplaceHolder=\"" . __("Access key") . "\" regExp='\\w{40}'\n\t\t\t\tstyle=\"width: 20em\" name=\"access_key\" id=\"instance_add_key\"\n\t\t\t\tvalue=\"{$access_key}\">";
        print "<p class='insensitive'>" . __("Use one access key for both linked instances.");
        print "</div>";
        print "<div class=\"dlgButtons\">\n\t\t\t\t<div style='float : left'>\n\t\t\t\t\t<button dojoType=\"dijit.form.Button\"\n\t\t\t\t\t\tonclick=\"return dijit.byId('instanceAddDlg').regenKey()\">" . __('Generate new key') . "</button>\n\t\t\t\t</div>\n\t\t\t\t<button dojoType=\"dijit.form.Button\"\n\t\t\t\t\tonclick=\"return dijit.byId('instanceAddDlg').execute()\">" . __('Create link') . "</button>\n\t\t\t\t<button dojoType=\"dijit.form.Button\"\n\t\t\t\t\tonclick=\"return dijit.byId('instanceAddDlg').hide()\"\">" . __('Cancel') . "</button></div>";
        return;
    }
    if ($id == "shareArticle") {
        $result = db_query($link, "SELECT uuid, ref_id FROM ttrss_user_entries WHERE int_id = '{$param}'\n\t\t\t\tAND owner_uid = " . $_SESSION['uid']);
        if (db_num_rows($result) == 0) {
            print "Article not found.";
        } else {
            $uuid = db_fetch_result($result, 0, "uuid");
            $ref_id = db_fetch_result($result, 0, "ref_id");
            if (!$uuid) {
                $uuid = db_escape_string(sha1(uniqid(rand(), true)));
                db_query($link, "UPDATE ttrss_user_entries SET uuid = '{$uuid}' WHERE int_id = '{$param}'\n\t\t\t\t\t\tAND owner_uid = " . $_SESSION['uid']);
            }
            print __("You can share this article by the following unique URL:");
            $url_path = get_self_url_prefix();
            $url_path .= "/public.php?op=share&key={$uuid}";
            print "<div class=\"tagCloudContainer\">";
            print "<a id='pub_opml_url' href='{$url_path}' target='_blank'>{$url_path}</a>";
            print "</div>";
            /* if (!label_find_id($link, __('Shared'), $_SESSION["uid"]))
            					label_create($link, __('Shared'), $_SESSION["uid"]);
            
            				label_add_article($link, $ref_id, __('Shared'), $_SESSION['uid']); */
        }
        print "<div align='center'>";
        print "<button dojoType=\"dijit.form.Button\" onclick=\"return dijit.byId('shareArticleDlg').hide()\">" . __('Close this window') . "</button>";
        print "</div>";
        return;
    }
    print "</dlg>";
}
开发者ID:nougad,项目名称:Tiny-Tiny-RSS,代码行数:101,代码来源:popup-dialog.php

示例12: update_rss_feed


//.........这里部分代码省略.........
        }
        _debug("loading filters & labels...", $debug_enabled);
        $filters = load_filters($feed, $owner_uid);
        _debug("" . count($filters) . " filters loaded.", $debug_enabled);
        $items = $rss->get_items();
        if (!is_array($items)) {
            _debug("no articles found.", $debug_enabled);
            db_query("UPDATE ttrss_feeds\n\t\t\t\t\tSET last_updated = NOW(), last_error = '' WHERE id = '{$feed}'");
            return;
            // no articles
        }
        if ($pubsub_state != 2 && PUBSUBHUBBUB_ENABLED) {
            _debug("checking for PUSH hub...", $debug_enabled);
            $feed_hub_url = false;
            $links = $rss->get_links('hub');
            if ($links && is_array($links)) {
                foreach ($links as $l) {
                    $feed_hub_url = $l;
                    break;
                }
            }
            _debug("feed hub url: {$feed_hub_url}", $debug_enabled);
            $feed_self_url = $fetch_url;
            $links = $rss->get_links('self');
            if ($links && is_array($links)) {
                foreach ($links as $l) {
                    $feed_self_url = $l;
                    break;
                }
            }
            _debug("feed self url = {$feed_self_url}");
            if ($feed_hub_url && $feed_self_url && function_exists('curl_init') && !ini_get("open_basedir")) {
                require_once 'lib/pubsubhubbub/subscriber.php';
                $callback_url = get_self_url_prefix() . "/public.php?op=pubsub&id={$feed}";
                $s = new Subscriber($feed_hub_url, $callback_url);
                $rc = $s->subscribe($feed_self_url);
                _debug("feed hub url found, subscribe request sent. [rc={$rc}]", $debug_enabled);
                db_query("UPDATE ttrss_feeds SET pubsub_state = 1\n\t\t\t\t\t\tWHERE id = '{$feed}'");
            }
        }
        _debug("processing articles...", $debug_enabled);
        $tstart = time();
        foreach ($items as $item) {
            if ($_REQUEST['xdebug'] == 3) {
                print_r($item);
            }
            if (ini_get("max_execution_time") > 0 && time() - $tstart >= ini_get("max_execution_time") * 0.7) {
                _debug("looks like there's too many articles to process at once, breaking out", $debug_enabled);
                break;
            }
            $entry_guid = $item->get_id();
            if (!$entry_guid) {
                $entry_guid = $item->get_link();
            }
            if (!$entry_guid) {
                $entry_guid = make_guid_from_title($item->get_title());
            }
            if (!$entry_guid) {
                continue;
            }
            $entry_guid = "{$owner_uid},{$entry_guid}";
            $entry_guid_hashed = db_escape_string('SHA1:' . sha1($entry_guid));
            _debug("guid {$entry_guid} / {$entry_guid_hashed}", $debug_enabled);
            $entry_timestamp = "";
            $entry_timestamp = $item->get_date();
            _debug("orig date: " . $item->get_date(), $debug_enabled);
开发者ID:rnavarro,项目名称:tt-rss,代码行数:67,代码来源:rssfuncs.php

示例13: forgotpass

 function forgotpass()
 {
     startup_gettext();
     @($hash = $_REQUEST["hash"]);
     header('Content-Type: text/html; charset=utf-8');
     print "<html><head><title>Tiny Tiny RSS</title>\n\t\t<link rel=\"shortcut icon\" type=\"image/png\" href=\"images/favicon.png\">\n\t\t<link rel=\"icon\" type=\"image/png\" sizes=\"72x72\" href=\"images/favicon-72px.png\">";
     echo stylesheet_tag("css/utility.css");
     echo javascript_tag("lib/prototype.js");
     print "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\"/>\n\t\t\t</head><body id='forgotpass'>";
     print '<div class="floatingLogo"><img src="images/logo_small.png"></div>';
     print "<h1>" . __("Password recovery") . "</h1>";
     print "<div class='content'>";
     @($method = $_POST['method']);
     if ($hash) {
         $login = $_REQUEST["login"];
         if ($login) {
             $result = $this->dbh->query("SELECT id, resetpass_token FROM ttrss_users\n\t\t\t\t\tWHERE login = '{$login}'");
             if ($this->dbh->num_rows($result) != 0) {
                 $id = $this->dbh->fetch_result($result, 0, "id");
                 $resetpass_token_full = $this->dbh->fetch_result($result, 0, "resetpass_token");
                 list($timestamp, $resetpass_token) = explode(":", $resetpass_token_full);
                 if ($timestamp && $resetpass_token && $timestamp >= time() - 15 * 60 * 60 && $resetpass_token == $hash) {
                     $result = $this->dbh->query("UPDATE ttrss_users SET resetpass_token = NULL\n\t\t\t\t\t\t\t\tWHERE id = {$id}");
                     Pref_Users::resetUserPassword($id, true);
                     print "<p>" . "Completed." . "</p>";
                 } else {
                     print_error("Some of the information provided is missing or incorrect.");
                 }
             } else {
                 print_error("Some of the information provided is missing or incorrect.");
             }
         } else {
             print_error("Some of the information provided is missing or incorrect.");
         }
         print "<form method=\"GET\" action=\"index.php\">\n\t\t\t\t<input type=\"submit\" value=\"" . __("Return to Tiny Tiny RSS") . "\">\n\t\t\t\t</form>";
     } else {
         if (!$method) {
             print_notice(__("You will need to provide valid account name and email. A password reset link will be sent to your email address."));
             print "<form method='POST' action='public.php'>";
             print "<input type='hidden' name='method' value='do'>";
             print "<input type='hidden' name='op' value='forgotpass'>";
             print "<fieldset>";
             print "<label>" . __("Login:") . "</label>";
             print "<input type='text' name='login' value='' required>";
             print "</fieldset>";
             print "<fieldset>";
             print "<label>" . __("Email:") . "</label>";
             print "<input type='email' name='email' value='' required>";
             print "</fieldset>";
             print "<fieldset>";
             print "<label>" . __("How much is two plus two:") . "</label>";
             print "<input type='text' name='test' value='' required>";
             print "</fieldset>";
             print "<p/>";
             print "<button type='submit'>" . __("Reset password") . "</button>";
             print "</form>";
         } else {
             if ($method == 'do') {
                 $login = $this->dbh->escape_string($_POST["login"]);
                 $email = $this->dbh->escape_string($_POST["email"]);
                 $test = $this->dbh->escape_string($_POST["test"]);
                 if ($test != 4 && $test != 'four' || !$email || !$login) {
                     print_error(__('Some of the required form parameters are missing or incorrect.'));
                     print "<form method=\"GET\" action=\"public.php\">\n\t\t\t\t\t<input type=\"hidden\" name=\"op\" value=\"forgotpass\">\n\t\t\t\t\t<input type=\"submit\" value=\"" . __("Go back") . "\">\n\t\t\t\t\t</form>";
                 } else {
                     print_notice("Password reset instructions are being sent to your email address.");
                     $result = $this->dbh->query("SELECT id FROM ttrss_users\n\t\t\t\t\tWHERE login = '{$login}' AND email = '{$email}'");
                     if ($this->dbh->num_rows($result) != 0) {
                         $id = $this->dbh->fetch_result($result, 0, "id");
                         if ($id) {
                             $resetpass_token = sha1(get_random_bytes(128));
                             $resetpass_link = get_self_url_prefix() . "/public.php?op=forgotpass&hash=" . $resetpass_token . "&login=" . urlencode($login);
                             require_once 'classes/ttrssmailer.php';
                             require_once "lib/MiniTemplator.class.php";
                             $tpl = new MiniTemplator();
                             $tpl->readTemplateFromFile("templates/resetpass_link_template.txt");
                             $tpl->setVariable('LOGIN', $login);
                             $tpl->setVariable('RESETPASS_LINK', $resetpass_link);
                             $tpl->addBlock('message');
                             $message = "";
                             $tpl->generateOutputToString($message);
                             $mail = new ttrssMailer();
                             $rc = $mail->quickMail($email, $login, __("[tt-rss] Password reset request"), $message, false);
                             if (!$rc) {
                                 print_error($mail->ErrorInfo);
                             }
                             $resetpass_token_full = $this->dbh->escape_string(time() . ":" . $resetpass_token);
                             $result = $this->dbh->query("UPDATE ttrss_users\n\t\t\t\t\t\t\tSET resetpass_token = '{$resetpass_token_full}'\n\t\t\t\t\t\t\tWHERE login = '{$login}' AND email = '{$email}'");
                             //Pref_Users::resetUserPassword($id, false);
                             print "<p>";
                             print "<p>" . "Completed." . "</p>";
                         } else {
                             print_error("User ID not found.");
                         }
                         print "<form method=\"GET\" action=\"index.php\">\n\t\t\t\t\t\t<input type=\"submit\" value=\"" . __("Return to Tiny Tiny RSS") . "\">\n\t\t\t\t\t\t</form>";
                     } else {
                         print_error(__("Sorry, login and email combination not found."));
                         print "<form method=\"GET\" action=\"public.php\">\n\t\t\t\t\t\t<input type=\"hidden\" name=\"op\" value=\"forgotpass\">\n\t\t\t\t\t\t<input type=\"submit\" value=\"" . __("Go back") . "\">\n\t\t\t\t\t\t</form>";
                     }
                 }
//.........这里部分代码省略.........
开发者ID:zamentur,项目名称:ttrss_ynh,代码行数:101,代码来源:public.php

示例14: make_article_tag_uri

 private function make_article_tag_uri($id, $timestamp)
 {
     $timestamp = date("Y-m-d", strtotime($timestamp));
     return "tag:" . parse_url(get_self_url_prefix(), PHP_URL_HOST) . ",{$timestamp}:/{$id}";
 }
开发者ID:kucrut,项目名称:tt-rss,代码行数:5,代码来源:public.php

示例15: module_pref_instances

function module_pref_instances($link)
{
    if (!SINGLE_USER_MODE && $_SESSION["access_level"] < 10) {
        print __("Your access level is insufficient to open this tab.");
        return;
    }
    $subop = $_REQUEST['subop'];
    if ($subop == "remove") {
        $ids = db_escape_string($_REQUEST['ids']);
        db_query($link, "DELETE FROM ttrss_linked_instances WHERE\n\t\t\t\tid IN ({$ids})");
        return;
    }
    if ($subop == "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($link, "BEGIN");
        $result = db_query($link, "SELECT id FROM ttrss_linked_instances\n\t\t\t\tWHERE access_url = '{$access_url}'");
        if (db_num_rows($result) == 0) {
            db_query($link, "INSERT INTO ttrss_linked_instances\n\t\t\t\t\t(access_url, access_key, last_connected, last_status_in, last_status_out)\n\t\t\t\t\tVALUES\n\t\t\t\t\t('{$access_url}', '{$access_key}', '1970-01-01', -1, -1)");
        }
        db_query($link, "COMMIT");
        return;
    }
    if ($subop == "edit") {
        $id = db_escape_string($_REQUEST["id"]);
        $result = db_query($link, "SELECT * FROM ttrss_linked_instances WHERE\n\t\t\t\tid = '{$id}'");
        print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\"  name=\"id\" value=\"{$id}\">";
        print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\"  name=\"op\" value=\"pref-instances\">";
        print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\"  name=\"subop\" value=\"editSave\">";
        print "<div class=\"dlgSec\">" . __("Instance") . "</div>";
        print "<div class=\"dlgSecCont\">";
        /* URL */
        $access_url = htmlspecialchars(db_fetch_result($result, 0, "access_url"));
        print __("URL:") . " ";
        print "<input dojoType=\"dijit.form.ValidationTextBox\" required=\"1\"\n\t\t\t\tplaceHolder=\"" . __("Instance URL") . "\"\n\t\t\t\tregExp='^(http|https)://.*'\n\t\t\t\tstyle=\"font-size : 16px; width: 20em\" name=\"access_url\"\n\t\t\t\tvalue=\"{$access_url}\">";
        print "<hr/>";
        $access_key = htmlspecialchars(db_fetch_result($result, 0, "access_key"));
        /* Access key */
        print __("Access key:") . " ";
        print "<input dojoType=\"dijit.form.ValidationTextBox\" required=\"1\"\n\t\t\t\tplaceHolder=\"" . __("Access key") . "\" regExp='\\w{40}'\n\t\t\t\tstyle=\"width: 20em\" name=\"access_key\" id=\"instance_edit_key\"\n\t\t\t\tvalue=\"{$access_key}\">";
        print "<p class='insensitive'>" . __("Use one access key for both linked instances.");
        print "</div>";
        print "<div class=\"dlgButtons\">\n\t\t\t\t<div style='float : left'>\n\t\t\t\t\t<button dojoType=\"dijit.form.Button\"\n\t\t\t\t\t\tonclick=\"return dijit.byId('instanceEditDlg').regenKey()\">" . __('Generate new key') . "</button>\n\t\t\t\t</div>\n\t\t\t\t<button dojoType=\"dijit.form.Button\"\n\t\t\t\t\tonclick=\"return dijit.byId('instanceEditDlg').execute()\">" . __('Save') . "</button>\n\t\t\t\t<button dojoType=\"dijit.form.Button\"\n\t\t\t\t\tonclick=\"return dijit.byId('instanceEditDlg').hide()\"\">" . __('Cancel') . "</button></div>";
        return;
    }
    if ($subop == "editSave") {
        $id = db_escape_string($_REQUEST["id"]);
        $access_url = db_escape_string($_REQUEST["access_url"]);
        $access_key = db_escape_string($_REQUEST["access_key"]);
        db_query($link, "UPDATE ttrss_linked_instances SET\n\t\t\t\taccess_key = '{$access_key}', access_url = '{$access_url}',\n\t\t\t\tlast_connected = '1970-01-01'\n\t\t\t\tWHERE id = '{$id}'");
        return;
    }
    if (!function_exists('curl_init')) {
        print "<div style='padding : 1em'>";
        print_error("This functionality requires CURL functions. Please enable CURL in your PHP configuration (you might also want to disable open_basedir in php.ini) and reload this page.");
        print "</div>";
    }
    print "<div id=\"pref-instance-wrap\" dojoType=\"dijit.layout.BorderContainer\" gutters=\"false\">";
    print "<div id=\"pref-instance-header\" dojoType=\"dijit.layout.ContentPane\" region=\"top\">";
    print "<div id=\"pref-instance-toolbar\" dojoType=\"dijit.Toolbar\">";
    $sort = db_escape_string($_REQUEST["sort"]);
    if (!$sort || $sort == "undefined") {
        $sort = "access_url";
    }
    print "<div dojoType=\"dijit.form.DropDownButton\">" . "<span>" . __('Select') . "</span>";
    print "<div dojoType=\"dijit.Menu\" style=\"display: none;\">";
    print "<div onclick=\"selectTableRows('prefInstanceList', 'all')\"\n\t\t\tdojoType=\"dijit.MenuItem\">" . __('All') . "</div>";
    print "<div onclick=\"selectTableRows('prefInstanceList', 'none')\"\n\t\t\tdojoType=\"dijit.MenuItem\">" . __('None') . "</div>";
    print "</div></div>";
    print "<button dojoType=\"dijit.form.Button\" onclick=\"addInstance()\">" . __('Link instance') . "</button>";
    print "<button dojoType=\"dijit.form.Button\" onclick=\"editSelectedInstance()\">" . __('Edit') . "</button>";
    print "<button dojoType=\"dijit.form.Button\" onclick=\"removeSelectedInstances()\">" . __('Remove') . "</button>";
    print "</div>";
    #toolbar
    $result = db_query($link, "SELECT *,\n\t\t\t(SELECT COUNT(*) FROM ttrss_linked_feeds\n\t\t\t\tWHERE instance_id = ttrss_linked_instances.id) AS num_feeds\n\t\t\tFROM ttrss_linked_instances\n\t\t\tORDER BY {$sort}");
    print "<p class=\"insensitive\" style='margin-left : 1em;'>" . __("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 " <a href=\"#\" onclick=\"alert('" . htmlspecialchars(get_self_url_prefix()) . "')\">(display url)</a>";
    print "<p><table width='100%' id='prefInstanceList' class='prefInstanceList' cellspacing='0'>";
    print "<tr class=\"title\">\n\t\t\t<td align='center' width=\"5%\">&nbsp;</td>\n\t\t\t<td width=''><a href=\"#\" onclick=\"updateInstanceList('access_url')\">" . __('Instance URL') . "</a></td>\n\t\t\t<td width='20%'><a href=\"#\" onclick=\"updateInstanceList('access_key')\">" . __('Access key') . "</a></td>\n\t\t\t<td width='10%'><a href=\"#\" onclick=\"updateUsersList('last_connected')\">" . __('Last connected') . "</a></td>\n\t\t\t<td width='10%'><a href=\"#\" onclick=\"updateUsersList('num_feeds')\">" . __('Stored feeds') . "</a></td>\n\t\t\t</tr>";
    $lnum = 0;
    while ($line = db_fetch_assoc($result)) {
        $class = $lnum % 2 ? "even" : "odd";
        $id = $line['id'];
        $this_row_id = "id=\"LIRR-{$id}\"";
        $line["last_connected"] = make_local_datetime($link, $line["last_connected"], false);
        print "<tr class=\"{$class}\" {$this_row_id}>";
        print "<td align='center'><input onclick='toggleSelectRow(this);'\n\t\t\t\ttype=\"checkbox\" id=\"LICHK-{$id}\"></td>";
        $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 "<td {$onclick}>" . htmlspecialchars($line['access_url']) . "</td>";
        print "<td {$onclick}>" . htmlspecialchars($access_key) . "</td>";
        print "<td {$onclick}>" . htmlspecialchars($line['last_connected']) . "</td>";
        print "<td {$onclick}>" . htmlspecialchars($line['num_feeds']) . "</td>";
        print "</tr>";
        ++$lnum;
    }
    print "</table>";
    print "</div>";
    #pane
//.........这里部分代码省略.........
开发者ID:nougad,项目名称:Tiny-Tiny-RSS,代码行数:101,代码来源:pref-instances.php


注:本文中的get_self_url_prefix函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。