Compare commits
No commits in common. "master" and "orig_fof" have entirely different histories.
|
@ -1,6 +0,0 @@
|
|||
Options -Indexes
|
||||
<FilesMatch "fof\.log.*">
|
||||
Order deny,allow
|
||||
Allow from none
|
||||
Deny from all
|
||||
</FilesMatch>
|
74
README.md
|
@ -1,74 +0,0 @@
|
|||
What is FeedOnFeeds?
|
||||
--------------------
|
||||
|
||||
FeedOnFeeds is a lightweight server-based RSS aggregator and reader,
|
||||
allowing you to keep up with syndicated content (blogs, comics, and so
|
||||
forth) without having to keep track of what you've read. Being
|
||||
server-based means all of your feeds and history are kept in one
|
||||
place, and being lightweight means you can install it pretty much
|
||||
anywhere without needing a fancy dedicated server or the like.
|
||||
|
||||
FeedOnFeeds 0.5 is originally written by Steve Minutillo.
|
||||
This is a fork of FeedOnFeeds 0.5 by Vitaliy Filippov.
|
||||
|
||||
FeedOnFeeds is distributed under the terms of GNU GPL v2 license, see LICENSE.
|
||||
|
||||
New features in this version compared to the original 0.5
|
||||
---------------------------------------------------------
|
||||
|
||||
* Performance of all queries is greatly improved, basically almost everything
|
||||
is fast even if you have lots of unread and/or tagged items (100000+)
|
||||
* HTTP proxy support through standard environment variables http_proxy, no_proxy
|
||||
* Password-protected feed support (HTTP basic/digest)
|
||||
* Personal feed rename support (each user can rename feeds to his will)
|
||||
* Possible to set tags for a feed when adding it
|
||||
* The view is paged by default (you have to specify a big limit by hand to view all items)
|
||||
* Mass feed tagging/untagging from the preferences page
|
||||
* Per-feed and per-item collapse settings: you can set some feeds to show all items
|
||||
collapsed by default or you can configure a regular expression which will specify
|
||||
items that should be collapsed by default in each feed
|
||||
* Most popular feed suggestions on the subscribe page
|
||||
* Top reader statistics on the login page
|
||||
* Very simple CSS-based mobile view
|
||||
* Tables are using InnoDB, UTF-8 encoding, and foreign keys
|
||||
* Code is cleaned of PHP warnings/notices and compatible with PHP 5.4+
|
||||
* PHP mysqli extension is used instead of deprecated mysql
|
||||
|
||||
TODO
|
||||
----
|
||||
|
||||
* Implement safer authentication (sessions?) than current password-hash-in-cookie
|
||||
* Replace SimplePie (not "simple" in any way) with something simpler and faster... (MagPie?)
|
||||
* Dynamic feed update times, similar to https://github.com/RomanSixty/Feed-on-Feeds
|
||||
* Use multi-cURL to download feeds in parallel
|
||||
|
||||
Requirements
|
||||
------------
|
||||
|
||||
* A web server running PHP 5 or later (nginx + php5-fpm or Apache).
|
||||
* PHP extensions: mysqli/mysqlnd, XML, PCRE, cURL, Zlib, mbstring, iconv.
|
||||
* MariaDB/MySQL 5 or later. MariaDB 5.5 or later with Barracuda storage format
|
||||
(innodb_file_format = barracuda) is recommended.
|
||||
|
||||
Installation
|
||||
------------
|
||||
|
||||
* Download a snapshot or checkout code from git repository into installation directory.
|
||||
* Create 'cache' directory inside installation directory and make it writable by the web server.
|
||||
* Create a MySQL database and a user with full access to it. If MySQL server is on the
|
||||
same host it looks like:
|
||||
|
||||
CREATE DATABASE feedonfeeds;
|
||||
GRANT ALL PRIVILEGES ON feedonfeeds.* TO feedonfeeds@localhost IDENTIFIED BY '<password>';
|
||||
FLUSH PRIVILEGES;
|
||||
|
||||
* Copy fof-config-sample.php to fof-config.php and edit FOF_DB_HOST, FOF_DB_USER, FOF_DB_PASS
|
||||
and FOF_DB_DBNAME as appropriate for your newly created database.
|
||||
* Point your browser to `<FoF_URL>/install.php`.
|
||||
|
||||
Upgrade
|
||||
-------
|
||||
|
||||
It is possible to upgrade an existing FeedOnFeeds 0.5 MySQL installation to this version.
|
||||
Database will be converted automatically. Just overwrite all files in FoF installation
|
||||
directory with this version and point your browser to `<FoF_URL>/install.php`.
|
|
@ -14,27 +14,8 @@
|
|||
|
||||
include_once("fof-main.php");
|
||||
|
||||
$url = isset($_REQUEST['url']) ? $_REQUEST['url'] : '';
|
||||
$tags = isset($_REQUEST['tags']) ? $_REQUEST['tags'] : '';
|
||||
$unread = isset($_REQUEST['unread']) ? $_REQUEST['unread'] : '';
|
||||
$url = $_REQUEST['url'];
|
||||
$unread = $_REQUEST['unread'];
|
||||
|
||||
list($error, $feed) = fof_subscribe(fof_current_user(), $url, $unread);
|
||||
$error .= '<br />';
|
||||
foreach (preg_split("/[\s,]*,[\s,]*/", $tags) as $tag)
|
||||
{
|
||||
if ($tag !== '')
|
||||
{
|
||||
fof_tag_feed(fof_current_user(), $feed['feed_id'], $tag);
|
||||
$error .= 'Tagged \''.htmlspecialchars($feed['feed_title']).'\' as '.htmlspecialchars($tag).'<br />';
|
||||
}
|
||||
}
|
||||
|
||||
if (preg_match('/HTTP 401/', $error))
|
||||
{
|
||||
print "<script>
|
||||
document.addform.basic_login.style.backgroundColor='#FFC0C0';
|
||||
document.addform.basic_password.style.backgroundColor='#FFC0C0';
|
||||
document.addform.basic_password.focus();
|
||||
</script>";
|
||||
}
|
||||
print $error;
|
||||
print(fof_subscribe(fof_current_user(), $url, $unread));
|
||||
?>
|
||||
|
|
|
@ -18,7 +18,7 @@ $tags = $_GET['tag'];
|
|||
$item = $_GET['item'];
|
||||
$remove = $_GET['remove'];
|
||||
|
||||
foreach(preg_split("/[\s,]*,[\s,]*/", $tags) as $tag)
|
||||
foreach(explode(" ", $tags) as $tag)
|
||||
{
|
||||
if($remove == 'true')
|
||||
{
|
||||
|
@ -29,3 +29,4 @@ foreach(preg_split("/[\s,]*,[\s,]*/", $tags) as $tag)
|
|||
fof_tag_item(fof_current_user(), $item, $tag);
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
|
123
add.php
|
@ -7,8 +7,6 @@
|
|||
*
|
||||
* Copyright (C) 2004-2007 Stephen Minutillo
|
||||
* steve@minutillo.com - http://minutillo.com/steve/
|
||||
* Modified by Vitaliy Filippov (c) 2009
|
||||
* vitalif@mail.ru - http://lib.custis.ru/
|
||||
*
|
||||
* Distributed under the GPL - see LICENSE
|
||||
*
|
||||
|
@ -16,51 +14,37 @@
|
|||
|
||||
include("header.php");
|
||||
|
||||
$url = @$_REQUEST['rss_url'];
|
||||
$new_tags = @$_REQUEST['new_tags'];
|
||||
$login = @$_REQUEST['basic_login'];
|
||||
$password = @$_REQUEST['basic_password'];
|
||||
$opml = @$_REQUEST['opml_url'];
|
||||
$file = @$_POST['opml_file'];
|
||||
$unread = @$_REQUEST['unread'];
|
||||
|
||||
if ($url && !preg_match('!^[a-z0-9_]+://!is', $url))
|
||||
$url = "http://$url";
|
||||
|
||||
if ($login == '%user%')
|
||||
$login = fof_username();
|
||||
$url = $_POST['rss_url'];
|
||||
if(!$url) $url = $_GET['rss_url'];
|
||||
$opml = $_POST['opml_url'];
|
||||
$file = $_POST['opml_file'];
|
||||
$unread = $_POST['unread'];
|
||||
|
||||
$feeds = array();
|
||||
|
||||
if (!empty($_REQUEST['do']))
|
||||
if($url) $feeds[] = $url;
|
||||
|
||||
if($opml)
|
||||
{
|
||||
if ($opml)
|
||||
{
|
||||
$sfile = new SimplePie_File($opml);
|
||||
if(!$sfile->success)
|
||||
{
|
||||
echo "Cannot open ".htmlspecialchars($opml)."<br>";
|
||||
return false;
|
||||
}
|
||||
$content = $sfile->body;
|
||||
$feeds = fof_opml_to_array($content);
|
||||
}
|
||||
if ($url)
|
||||
{
|
||||
if ($login && strlen($password))
|
||||
$url = preg_replace('!^([a-z0-9_]+)://([^/]*:[^/]*@)?!is', '\1://' . str_replace("\\", "\\\\", urlencode($login) . ':' . urlencode($password)) . '@', $url);
|
||||
$feeds[] = $url;
|
||||
}
|
||||
$sfile = new SimplePie_File($opml);
|
||||
|
||||
if(!$sfile->success)
|
||||
{
|
||||
echo "Cannot open " . htmlentities($opml) . "<br>";
|
||||
return false;
|
||||
}
|
||||
|
||||
$content = $sfile->body;
|
||||
|
||||
$feeds = fof_opml_to_array($content);
|
||||
}
|
||||
|
||||
$url = preg_replace('!^([a-z0-9_]+)://([^/]*:[^/]*@)?!is', '\1://', $url);
|
||||
|
||||
if (!empty($_FILES['opml_file']['tmp_name']))
|
||||
if($_FILES['opml_file']['tmp_name'])
|
||||
{
|
||||
if(!$content_array = file($_FILES['opml_file']['tmp_name']))
|
||||
{
|
||||
echo "Cannot open uploaded file<br>";
|
||||
}
|
||||
if(!$content_array = file($_FILES['opml_file']['tmp_name']))
|
||||
{
|
||||
echo "Cannot open uploaded file<br>";
|
||||
}
|
||||
else
|
||||
{
|
||||
$content = implode("", $content_array);
|
||||
|
@ -69,68 +53,51 @@ if (!empty($_FILES['opml_file']['tmp_name']))
|
|||
}
|
||||
|
||||
$add_feed_url = "http";
|
||||
if (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on')
|
||||
$add_feed_url = "https";
|
||||
if($_SERVER["HTTPS"] == "on")
|
||||
{
|
||||
$add_feed_url = "https";
|
||||
}
|
||||
$add_feed_url .= "://" . $_SERVER["HTTP_HOST"] . $_SERVER["SCRIPT_NAME"];
|
||||
?>
|
||||
|
||||
<div class="fof-add-feeds">
|
||||
<div style="background: #eee; border: 1px solid black; padding: 1.5em; margin: 1.5em;">If your browser is cool, you can <a href='javascript:window.navigator.registerContentHandler("application/vnd.mozilla.maybe.feed", "<?php echo $add_feed_url ?>?rss_url=%s", "Feed on Feeds")'>register Feed on Feeds as a Feed Reader</a>. If it is not cool, you can still use the <a href="javascript:void(location.href='<?php echo $add_feed_url ?>?rss_url='+escape(location))">FoF subscribe</a> bookmarklet to subscribe to any page with a feed. Just add it as a bookmark and then click on it when you are at a page you'd like to subscribe to!</div>
|
||||
|
||||
<h1>Use FeedOnFeeds for reading feeds always</h1>
|
||||
<form method="post" action="opml.php">
|
||||
|
||||
<div style="background: #eee; border: 1px solid black; padding: 1.5em; margin: 1em;">
|
||||
If your browser is cool, you can <a href='javascript:window.navigator.registerContentHandler("application/vnd.mozilla.maybe.feed", "<?php echo $add_feed_url ?>?basic_login=%25user%25&do=1&rss_url=%s", "Feed on Feeds")'>register Feed on Feeds as a Feed Reader</a>.
|
||||
If it is not cool, you can still use the <a href="javascript:void(location.href='<?php echo $add_feed_url ?>?basic_login=%25user%25&do=1&rss_url='+escape(location))">FoF subscribe</a> bookmarklet to subscribe to any page with a feed.
|
||||
Just add it as a bookmark and then click on it when you are at a page you'd like to subscribe to!
|
||||
</div>
|
||||
<input type="submit" value="Export subscriptions as OPML">
|
||||
|
||||
</form>
|
||||
<br>
|
||||
|
||||
<form method="post" name="addform" action="add.php" enctype="multipart/form-data">
|
||||
|
||||
When adding feeds, mark <select name="unread"><option value=today <?= $unread == "today" ? "selected" : "" ?> >today's</option><option value=all <?= $unread == "all" ? "selected" : "" ?> >all</option><option value=no <?= $unread == "no" ? "selected" : "" ?> >no</option></select> items as unread<br />
|
||||
When adding feeds, mark <select name="unread"><option value=today <?php if($unread == "today") echo "selected" ?> >today's</option><option value=all <?php if($unread == "all") echo "selected" ?> >all</option><option value=no <?php if($unread == "no") echo "selected" ?> >no</option></select> items as unread<br><br>
|
||||
|
||||
<h1>Enter URL manually</h1>
|
||||
RSS or weblog URL: <input type="text" name="rss_url" size="40" value="<?php echo htmlentities($url) ?>"><input type="Submit" value="Add a feed"><br><br>
|
||||
|
||||
<p>
|
||||
RSS or weblog URL: <input type="text" name="rss_url" size="40" value="<?= htmlspecialchars($url) ?>" /> <input name="do" type="Submit" value="Add a feed" /><br />
|
||||
Login: <input type="text" name="basic_login" value="<?= htmlspecialchars($login) ?>" /> Password: <input type="password" name="basic_password" value="<?= htmlspecialchars($password) ?>" /> (optional) for password-protected feeds<br />
|
||||
Tags for new feed(s): <input type="text" name="new_tags" size="40" value="<?= htmlspecialchars($new_tags) ?>" /> (separate by comma)
|
||||
</p>
|
||||
OPML URL: <input type="hidden" name="MAX_FILE_SIZE" value="100000">
|
||||
|
||||
<h1>OPML import</h1>
|
||||
<input type="text" name="opml_url" size="40" value="<?php echo htmlentities($opml) ?>"><input type="Submit" value="Add feeds from OPML file on the Internet"><br><br>
|
||||
|
||||
<p>
|
||||
OPML URL: <input type="text" name="opml_url" size="40" value="<?= htmlspecialchars($opml) ?>" /> <input name="do" type="Submit" value="Add feeds from OPML file on the Internet" /><br>
|
||||
OPML filename: <input type="hidden" name="MAX_FILE_SIZE" value="100000" /><input type="file" name="opml_file" size="40" value="<?= htmlspecialchars($file) ?>" /> <input name="do" type="Submit" value="Upload an OPML file" />
|
||||
</p>
|
||||
<input type="hidden" name="MAX_FILE_SIZE" value="100000">
|
||||
OPML filename: <input type="file" name="opml_file" size="40" value="<?php echo htmlentities($file) ?>"><input type="Submit" value="Upload an OPML file">
|
||||
|
||||
</form>
|
||||
|
||||
<h1>OPML export</h1>
|
||||
<form style="margin: 1em" method="post" action="opml.php"><input type="submit" value="Export subscriptions as OPML"></form>
|
||||
|
||||
<?php if (!count($feeds) && $fof_prefs_obj && ($suggest = intval($fof_prefs_obj->admin_prefs['suggestadd'])) &&
|
||||
count($suggest = fof_db_get_most_popular_feeds($suggest))) { ?>
|
||||
<h1>Most popular feeds</h1>
|
||||
<p>
|
||||
<?php foreach ($suggest as $feed) { ?>
|
||||
<a href="<?=htmlspecialchars('?do=1&rss_url='.urlencode($feed['feed_url']))?>"><?=htmlspecialchars($feed['feed_title'])?></a> <a href="<?=htmlspecialchars($feed['feed_link'])?>"><img src="image/external.png" alt=" " width="10" height="10" /></a> – <?=$feed['readers']?> readers<br />
|
||||
<?php } ?>
|
||||
</p>
|
||||
<?php } ?>
|
||||
|
||||
</div>
|
||||
|
||||
<?php
|
||||
if(count($feeds))
|
||||
{
|
||||
print("<script>\nwindow.onload = ajaxadd;\nfeedslist = [");
|
||||
|
||||
|
||||
foreach($feeds as $feed)
|
||||
{
|
||||
$feedjson[] = "{'url': '" . addslashes($feed) . "'}";
|
||||
}
|
||||
|
||||
print(join($feedjson, ", "));
|
||||
print("];\n</script>");
|
||||
}
|
||||
print("<br />");
|
||||
print("<br>");
|
||||
|
||||
include("footer.php");
|
||||
?>
|
||||
|
|
|
@ -14,27 +14,26 @@
|
|||
|
||||
class FoF_Prefs
|
||||
{
|
||||
var $user_id;
|
||||
var $user_id;
|
||||
var $prefs;
|
||||
var $admin_prefs;
|
||||
|
||||
function __construct($user_id)
|
||||
{
|
||||
|
||||
function FoF_Prefs($user_id)
|
||||
{
|
||||
global $FOF_USER_TABLE;
|
||||
|
||||
$this->user_id = $user_id;
|
||||
|
||||
$this->user_id = $user_id;
|
||||
|
||||
$result = fof_safe_query("select user_prefs from $FOF_USER_TABLE where user_id = %d", $user_id);
|
||||
$row = fof_db_get_row($result);
|
||||
$row = mysql_fetch_array($result);
|
||||
$prefs = unserialize($row['user_prefs']);
|
||||
if(!is_array($prefs))
|
||||
$prefs = array();
|
||||
if(!is_array($prefs)) $prefs = array();
|
||||
$this->prefs = $prefs;
|
||||
|
||||
|
||||
if($user_id != 1)
|
||||
{
|
||||
$result = fof_safe_query("select user_prefs from $FOF_USER_TABLE where user_id = 1");
|
||||
$row = fof_db_get_row($result);
|
||||
$row = mysql_fetch_array($result);
|
||||
$admin_prefs = unserialize($row['user_prefs']);
|
||||
if(!is_array($admin_prefs)) $admin_prefs = array();
|
||||
$this->admin_prefs = $admin_prefs;
|
||||
|
@ -43,26 +42,23 @@ class FoF_Prefs
|
|||
{
|
||||
$this->admin_prefs = $prefs;
|
||||
}
|
||||
|
||||
|
||||
$this->populate_defaults();
|
||||
|
||||
|
||||
if($user_id == 1)
|
||||
{
|
||||
$this->prefs = array_merge($this->prefs, $this->admin_prefs);
|
||||
}
|
||||
}
|
||||
|
||||
static function instance()
|
||||
|
||||
function &instance()
|
||||
{
|
||||
static $instance;
|
||||
if(!isset($instance))
|
||||
{
|
||||
$instance = new FoF_Prefs(fof_current_user());
|
||||
}
|
||||
|
||||
if(!isset($instance)) $instance = new FoF_Prefs(fof_current_user());
|
||||
|
||||
return $instance;
|
||||
}
|
||||
|
||||
|
||||
function populate_defaults()
|
||||
{
|
||||
$defaults = array(
|
||||
|
@ -74,37 +70,40 @@ class FoF_Prefs
|
|||
"feed_order" => "feed_title",
|
||||
"feed_direction" => "asc",
|
||||
);
|
||||
|
||||
|
||||
$admin_defaults = array(
|
||||
"purge" => '',
|
||||
"purge" => 30,
|
||||
"autotimeout" => 30,
|
||||
"manualtimeout" => 15,
|
||||
"logging" => true,
|
||||
);
|
||||
|
||||
"logging" => false,
|
||||
);
|
||||
|
||||
$this->stuff_array($this->prefs, $defaults);
|
||||
$this->stuff_array($this->admin_prefs, $admin_defaults);
|
||||
}
|
||||
|
||||
|
||||
function stuff_array(&$array, $defaults)
|
||||
{
|
||||
foreach($defaults as $k => $v)
|
||||
if(!isset($array[$k]))
|
||||
$array[$k] = $v;
|
||||
{
|
||||
if(!isset($array[$k])) $array[$k] = $v;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function get($k)
|
||||
{
|
||||
return isset($this->prefs[$k]) ? $this->prefs[$k] : NULL;
|
||||
return $this->prefs[$k];
|
||||
}
|
||||
|
||||
|
||||
function set($k, $v)
|
||||
{
|
||||
$this->prefs[$k] = $v;
|
||||
}
|
||||
|
||||
|
||||
function save()
|
||||
{
|
||||
fof_db_save_prefs($this->user_id, $this->prefs);
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
|
@ -1,64 +0,0 @@
|
|||
<?php
|
||||
|
||||
# Функция для установки прокси из переменных окружения для cURL'а < 7.3 (да и > тоже),
|
||||
# который, тупая тварь, не умеет это делать самостоятельно. Используется у нас в FeedOnFeeds и MediaWiki.
|
||||
# vfilippov@custis.ru, 2010-03-03
|
||||
|
||||
class CurlEnvProxy
|
||||
{
|
||||
|
||||
static function set($curl, $url)
|
||||
{
|
||||
if ($proxy = getenv("http_proxy"))
|
||||
{
|
||||
$useproxy = true;
|
||||
if ($url && ($noproxy = preg_split("#\s*,\s*#is", getenv("no_proxy"))))
|
||||
{
|
||||
foreach ($noproxy as $n)
|
||||
{
|
||||
if (preg_match('#(\d+)\.(\d+)\.(\d+)\.(\d+)/(\d+)#s', $n, $m) &&
|
||||
preg_match('#^[a-z0-9_]+://(?:[^/]*:[^/]*@)?([^/@]+)(?:/|$|\?)#is', $url, $ip))
|
||||
{
|
||||
$mask = array(
|
||||
max(0x100 - (1 << max( 8-$m[5], 0)), 0),
|
||||
max(0x100 - (1 << max(16-$m[5], 0)), 0),
|
||||
max(0x100 - (1 << max(24-$m[5], 0)), 0),
|
||||
max(0x100 - (1 << max(32-$m[5], 0)), 0),
|
||||
);
|
||||
$ip = @gethostbyname($ip[1]);
|
||||
if (preg_match('#(\d+)\.(\d+)\.(\d+)\.(\d+)#s', $ip, $ipm) &&
|
||||
(intval($ipm[1]) & $mask[0]) == intval($m[1]) &&
|
||||
(intval($ipm[2]) & $mask[1]) == intval($m[2]) &&
|
||||
(intval($ipm[3]) & $mask[2]) == intval($m[3]) &&
|
||||
(intval($ipm[4]) & $mask[3]) == intval($m[4]))
|
||||
{
|
||||
$useproxy = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$n = preg_replace('/#.*$/is', '', $n);
|
||||
$n = preg_quote($n);
|
||||
$n = str_replace('\\*', '.*', $n);
|
||||
if (preg_match('#'.$n.'#is', $url))
|
||||
{
|
||||
$useproxy = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($useproxy)
|
||||
{
|
||||
$proxy = preg_replace('#^http://#is', '', $proxy);
|
||||
$proxy = preg_replace('#/*$#is', '', $proxy);
|
||||
}
|
||||
else
|
||||
$proxy = '';
|
||||
curl_setopt($curl, CURLOPT_PROXY, $proxy);
|
||||
}
|
||||
return $proxy;
|
||||
}
|
||||
|
||||
}
|
BIN
favicon.ico
Before Width: | Height: | Size: 1.1 KiB |
10
favicon.php
|
@ -4,15 +4,16 @@
|
|||
*
|
||||
* favicon.php - displays an image cached by SimplePie
|
||||
*
|
||||
* Copyright (C) 2004-2007 Stephen Minutillo steve@minutillo.com http://minutillo.com/steve/
|
||||
* (C) 2009-2014 Vitaliy Filippov vitalif@mail.ru http://yourcmc.ru/wiki/
|
||||
*
|
||||
* Copyright (C) 2004-2007 Stephen Minutillo
|
||||
* steve@minutillo.com - http://minutillo.com/steve/
|
||||
*
|
||||
* Distributed under the GPL - see LICENSE
|
||||
*
|
||||
*/
|
||||
require_once('simplepie/simplepie.php');
|
||||
require_once('simplepie/simplepie.inc');
|
||||
|
||||
if(file_exists("./cache/" . $_GET['i'] . ".spi"))
|
||||
if(file_exists("./cache/" . md5($_GET[i]) . ".spi"))
|
||||
{
|
||||
SimplePie_Misc::display_cached_file($_GET['i'], './cache', 'spi');
|
||||
}
|
||||
|
@ -20,3 +21,4 @@ else
|
|||
{
|
||||
header("Location: image/feed-icon.png");
|
||||
}
|
||||
?>
|
||||
|
|
|
@ -4,14 +4,15 @@
|
|||
*
|
||||
* config.php - modify this file with your database settings
|
||||
*
|
||||
*
|
||||
* Copyright (C) 2004-2007 Stephen Minutillo
|
||||
* (C) 2010+ Vitaliy Filippov
|
||||
* steve@minutillo.com - http://minutillo.com/steve/
|
||||
*
|
||||
* Distributed under the GPL - see LICENSE
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
// Database connection information. Host, username, password, database name.
|
||||
|
||||
define('FOF_DB_HOST', "host.example.com");
|
||||
|
@ -19,9 +20,6 @@ define('FOF_DB_USER', "username");
|
|||
define('FOF_DB_PASS', "password");
|
||||
define('FOF_DB_DBNAME', "database");
|
||||
|
||||
/* You may write an auth plugin by defining function fof_require_user_hook() {}
|
||||
* which should try to detect current user and then call fof_set_current_user($user);
|
||||
*/
|
||||
|
||||
// The rest you should not need to change
|
||||
|
||||
|
@ -36,12 +34,15 @@ define('FOF_SUBSCRIPTION_TABLE', FOF_DB_PREFIX . "subscription");
|
|||
define('FOF_TAG_TABLE', FOF_DB_PREFIX . "tag");
|
||||
define('FOF_USER_TABLE', FOF_DB_PREFIX . "user");
|
||||
|
||||
|
||||
// Find ourselves and the cache dir
|
||||
|
||||
if (!defined('DIR_SEP')) {
|
||||
define('DIR_SEP', DIRECTORY_SEPARATOR);
|
||||
define('DIR_SEP', DIRECTORY_SEPARATOR);
|
||||
}
|
||||
|
||||
if (!defined('FOF_DIR')) {
|
||||
define('FOF_DIR', dirname(__FILE__) . DIR_SEP);
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
1034
fof-db.php
1044
fof-main.php
|
@ -1,15 +0,0 @@
|
|||
#addupd, #nav, #tags { display: inline; font-size: 100%; }
|
||||
#taglist, #welcome, #item-display-controls, #nav li, #taglist tr, #sidebar { display: block; }
|
||||
#item-display-controls-spacer, #taglist tr.heading, #feeds { display: none; }
|
||||
#welcome { text-align: left; }
|
||||
#addupd { float: left; margin: 4px 8px 4px 4px; }
|
||||
#nav li { float: left; margin: 4px 8px 4px 0; }
|
||||
#taglist { clear: both; }
|
||||
#taglist tr { background-color: #e0e0e0; margin: 4px 4px 0 0; padding: 2px 0; float: left; }
|
||||
#taglist td { margin: 0 4px; display: inline; background-color: transparent; }
|
||||
#sidebar { float: none; width: auto !important; height: auto !important; overflow: visible; position: static; }
|
||||
#handle { display: none; }
|
||||
#item-display-controls { position: static; clear: both; }
|
||||
.odd-row { background: transparent; }
|
||||
.items-title { margin-top: 0; }
|
||||
.flagall { background-color: #e0e0e0; content: "A"; }
|
|
@ -20,7 +20,6 @@ function do_highlight($full_body, $q, $class){
|
|||
preg_match_all($pat,$full_body,$tag_matches);
|
||||
|
||||
/* loop through and highlight $q value in data and recombine with tags */
|
||||
$full_body_hl = '';
|
||||
for ($i=0; $i< count($tag_matches[0]); $i++) {
|
||||
/* ignore all text within these tags */
|
||||
if (
|
||||
|
@ -44,6 +43,7 @@ function do_highlight($full_body, $q, $class){
|
|||
return $full_body_hl;
|
||||
}
|
||||
|
||||
|
||||
function fof_render_item($item)
|
||||
{
|
||||
$items = true;
|
||||
|
@ -56,13 +56,11 @@ function fof_render_item($item)
|
|||
$item_link = $item['item_link'];
|
||||
$item_id = $item['item_id'];
|
||||
$item_title = $item['item_title'];
|
||||
$item_author = $item['item_author'];
|
||||
$item_content = $item['item_content'];
|
||||
$item_read = $item['item_read'];
|
||||
|
||||
$prefs = fof_prefs();
|
||||
$offset = $prefs['tzoffset'];
|
||||
if (!empty($prefs['dst']))
|
||||
$offset += date('I');
|
||||
|
||||
$item_published = gmdate("Y-n-d g:ia", $item['item_published'] + $offset*60*60);
|
||||
$item_cached = gmdate("Y-n-d g:ia", $item['item_cached'] + $offset*60*60);
|
||||
|
@ -70,7 +68,7 @@ function fof_render_item($item)
|
|||
|
||||
if(!$item_title) $item_title = "[no title]";
|
||||
|
||||
if(!empty($_GET['search']))
|
||||
if($_GET['search'])
|
||||
{
|
||||
$item_content = do_highlight("<span>$item_content</span>", $_GET['search'], "highlight");
|
||||
$item_title = do_highlight("<span>$item_title</span>", $_GET['search'], "highlight");
|
||||
|
@ -95,10 +93,9 @@ function fof_render_item($item)
|
|||
id="c<?php echo $item_id ?>"
|
||||
value="checked"
|
||||
ondblclick='flag_upto("c<?php echo $item_id?>");'
|
||||
onclick='return checkbox(event);'
|
||||
onclick='return checkbox(event);'
|
||||
title='shift-click or double-click to flag all items up to this one'
|
||||
/>
|
||||
<img src="image/flagall.gif" class="flagall" onclick='flag_upto("c<?= $item_id ?>")' title='flag all items up to this one' />
|
||||
</span>
|
||||
|
||||
<h1 <?php if($unread) echo "class='unread-item'" ?> >
|
||||
|
@ -107,8 +104,6 @@ function fof_render_item($item)
|
|||
width="16"
|
||||
src="<?php echo $star_image ?>"
|
||||
id="fav<?php echo $item_id ?>"
|
||||
alt=" "
|
||||
class="star<?= $star ? "-on" : "" ?>"
|
||||
onclick="return toggle_favorite('<?php echo $item_id ?>')"
|
||||
/>
|
||||
<script>
|
||||
|
@ -162,25 +157,27 @@ function fof_render_item($item)
|
|||
</div>
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
<span class='dash'> - </span>
|
||||
|
||||
|
||||
<h2>
|
||||
|
||||
<?php $prefs = fof_prefs(); if($feed_image && $prefs['favicons']) { ?>
|
||||
<a href="<?=htmlspecialchars($feed_link)?>" title="<?=htmlspecialchars($feed_description)?>"><img src="<?=$feed_image?>" height="16" width="16" border="0" /></a>
|
||||
<a href="<?php echo $feed_link ?>" title='<?php echo $feed_description ?>'><img src="<?php echo $feed_image ?>" height="16" width="16" border="0" /></a>
|
||||
<?php } ?>
|
||||
<a href="<?=htmlspecialchars($feed_link)?>" title="<?=htmlspecialchars($feed_description)?>"><?=htmlspecialchars($feed_title)?></a>
|
||||
<a href="<?php echo $feed_link ?>" title='<?php echo $feed_description ?>'><?php echo $feed_title ?></a>
|
||||
</h2>
|
||||
|
||||
<span class="meta">on <?php echo $item_published ?><?= $item_author?" by $item_author":"" ?></span>
|
||||
<span class="meta">on <?php echo $item_published ?></span>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="body"><?php echo $item_content ?></div>
|
||||
|
||||
<?php
|
||||
$widgets = fof_get_widgets($item);
|
||||
|
||||
if($widgets) {
|
||||
?>
|
||||
|
||||
|
@ -190,7 +187,9 @@ function fof_render_item($item)
|
|||
|
||||
<?php
|
||||
foreach($widgets as $widget)
|
||||
{
|
||||
echo "<span class='widget'>$widget</span> ";
|
||||
}
|
||||
?>
|
||||
|
||||
</div>
|
||||
|
|
26
fof-sudo.php
|
@ -1,26 +0,0 @@
|
|||
<?php
|
||||
|
||||
$fof_no_login = 1;
|
||||
include_once("fof-main.php");
|
||||
|
||||
$sudo_id = $_GET['id'];
|
||||
if ($sudo_id)
|
||||
{
|
||||
$user_id = fof_cache_get("sudo-$sudo_id");
|
||||
fof_cache_unset("sudo-$sudo_id");
|
||||
}
|
||||
|
||||
if ($user_id)
|
||||
$user = fof_db_get_user(NULL, $user_id);
|
||||
|
||||
if ($user)
|
||||
{
|
||||
$prefs = unserialize($user['user_prefs']);
|
||||
$globalauth = $prefs['globalauth'];
|
||||
if (!$globalauth)
|
||||
$globalauth = array('user_name' => $user['user_name']);
|
||||
}
|
||||
else
|
||||
$globalauth = array('error' => "FOF_SUDO authorization error: session id $sudo_id is unknown");
|
||||
|
||||
print json_encode($globalauth);
|
64
fof.css
|
@ -1,5 +1,3 @@
|
|||
img { border-width: 0; }
|
||||
|
||||
p
|
||||
{
|
||||
margin: 0;
|
||||
|
@ -13,6 +11,7 @@ p
|
|||
|
||||
#view-page
|
||||
{
|
||||
font-family: georgia;
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
|
@ -102,28 +101,28 @@ p
|
|||
padding: 2px;
|
||||
}
|
||||
|
||||
|
||||
.odd-row
|
||||
{
|
||||
background: #dddddd;
|
||||
}
|
||||
|
||||
.feedprefs { margin-bottom: 8px; }
|
||||
.feedprefs input.editbox { border-color: lightgray; border-width: 0 0 1px 0; border-style: solid; }
|
||||
.odd-row input.editbox { border-width: 0; }
|
||||
|
||||
.unread
|
||||
{
|
||||
font-weight: bold;
|
||||
color: red;
|
||||
}
|
||||
|
||||
|
||||
.unread-item
|
||||
{
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
|
||||
#items
|
||||
{
|
||||
font-family: georgia;
|
||||
}
|
||||
|
||||
.highlight-on .highlight
|
||||
|
@ -272,27 +271,39 @@ body
|
|||
display: inline;
|
||||
}
|
||||
|
||||
.hidden h2 { font-size: 80%; }
|
||||
.hidden .tags { display: none; }
|
||||
.hidden .meta { display: none; }
|
||||
.hidden .dash { display: inline; }
|
||||
.shown .dash { display: none; }
|
||||
.hidden h2
|
||||
{
|
||||
font-size: 80%;
|
||||
}
|
||||
|
||||
.hidden .tags
|
||||
{
|
||||
display: none;
|
||||
}
|
||||
|
||||
.hidden .meta
|
||||
{
|
||||
display: none;
|
||||
}
|
||||
|
||||
.hidden .dash
|
||||
{
|
||||
display: inline;
|
||||
}
|
||||
|
||||
.shown .dash
|
||||
{
|
||||
display: none;
|
||||
}
|
||||
|
||||
#welcome
|
||||
{
|
||||
text-align: center;
|
||||
font: normal 10px Verdana;
|
||||
background: #ddd;
|
||||
border-bottom: 1px solid #666;
|
||||
padding: 5px 7px;
|
||||
}
|
||||
|
||||
#addupd { text-align: center; margin-top: 8px; }
|
||||
|
||||
#throbber { width: 16px; height: 16px; position: fixed; left: 0; top: 0; }
|
||||
img.star { background-color: #c0c0c0; }
|
||||
img.star-on { background-color: red; }
|
||||
|
||||
#item-display-controls
|
||||
{
|
||||
font: normal 10px Verdana;
|
||||
|
@ -307,10 +318,15 @@ border-bottom: 1px solid #666;
|
|||
z-index: 1;
|
||||
}
|
||||
|
||||
.items-title { clear: both; margin-top: 40px; }
|
||||
#item-display-controls li
|
||||
{
|
||||
padding: 5px 4px;
|
||||
}
|
||||
|
||||
#item-display-controls li { padding: 5px 4px; }
|
||||
#item-display-controls li a { padding: 0; }
|
||||
#item-display-controls li a
|
||||
{
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
#item-display-controls-spacer
|
||||
{
|
||||
|
@ -359,9 +375,3 @@ display: block;
|
|||
padding: 2px 5px;
|
||||
}
|
||||
|
||||
.fof-add-feeds { margin: 0.5em; }
|
||||
.fof-add-feeds form { margin: 0; }
|
||||
.fof-add-feeds h1 { border-width: 0 0 2px; border-color: #ddd; border-style: solid; margin: 1em 0 0 0; padding: 0 0.5em; }
|
||||
.fof-add-feeds p { line-height: 2; margin: 0.5em; }
|
||||
|
||||
.flagall { width: 16px; height: 16px; cursor: pointer; }
|
||||
|
|
284
fof.js
|
@ -49,19 +49,19 @@ var getScrollY = function() {
|
|||
var getY = function(e)
|
||||
{
|
||||
var y = NaN;
|
||||
|
||||
|
||||
if (e.offsetParent) {
|
||||
y = e.offsetTop
|
||||
while (e = e.offsetParent) {
|
||||
y += e.offsetTop
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return y;
|
||||
}
|
||||
|
||||
function getWindowHeight()
|
||||
{
|
||||
{
|
||||
if( typeof( window.innerHeight ) == 'number' ) {
|
||||
//Non-IE
|
||||
return window.innerHeight;
|
||||
|
@ -72,7 +72,7 @@ function getWindowHeight()
|
|||
//IE 4 compatible
|
||||
return document.body.clientHeight;
|
||||
}
|
||||
|
||||
|
||||
return NaN;
|
||||
}
|
||||
|
||||
|
@ -103,13 +103,13 @@ function embed_wmedia(width, height, link) {
|
|||
|
||||
function itemClicked(event)
|
||||
{
|
||||
if(!event) event = window.event;
|
||||
if(!event) event = window.event;
|
||||
target = window.event ? window.event.srcElement : event.target;
|
||||
|
||||
|
||||
if(event.altKey)
|
||||
{
|
||||
Event.stop(event);
|
||||
|
||||
|
||||
unselect(itemElement);
|
||||
while(target.parentNode)
|
||||
{
|
||||
|
@ -119,13 +119,13 @@ function itemClicked(event)
|
|||
}
|
||||
target = target.parentNode;
|
||||
}
|
||||
|
||||
|
||||
if(itemElement == target)
|
||||
{
|
||||
itemElement = null;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Element.addClassName(target, 'selected');
|
||||
itemElement = target;
|
||||
|
||||
|
@ -144,43 +144,43 @@ function itemClicked(event)
|
|||
document.title = "Feed on Feeds - " + i + " of " + n;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
function checkbox(event)
|
||||
{
|
||||
if(!event) event = window.event;
|
||||
if(!event) event = window.event;
|
||||
target = window.event ? window.event.srcElement : event.target;
|
||||
|
||||
|
||||
if(!event.shiftKey)
|
||||
return true;
|
||||
|
||||
|
||||
flag_upto(target.id);
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
function select(item)
|
||||
{
|
||||
Element.addClassName(item, 'selected');
|
||||
|
||||
|
||||
y = getY(item);
|
||||
bar = $('item-display-controls').getHeight();
|
||||
window.scrollTo(0, y - (bar + 10));
|
||||
|
||||
|
||||
i = itemElements.indexOf(item);
|
||||
|
||||
|
||||
if(i == -1)
|
||||
{
|
||||
// in case page was partially loaded when itemElements was initialized
|
||||
itemElements = $$('.item');
|
||||
i = itemElements.indexOf(item);
|
||||
}
|
||||
|
||||
|
||||
n = itemElements.length;
|
||||
i++;
|
||||
|
||||
|
||||
document.title = "Feed on Feeds - " + i + " of " + n;
|
||||
}
|
||||
|
||||
|
@ -193,20 +193,20 @@ function unselect(item)
|
|||
|
||||
function show_enclosure(e)
|
||||
{
|
||||
if (!e) e = window.event;
|
||||
if (!e) e = window.event;
|
||||
target = window.event ? window.event.srcElement : e.target;
|
||||
Element.extend(target);
|
||||
div = target.nextSiblings().first();
|
||||
Element.show(div);
|
||||
Element.hide(target);
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
function keyboard(e)
|
||||
{
|
||||
if (!e) e = window.event;
|
||||
|
||||
|
||||
target = window.event ? window.event.srcElement : e.target;
|
||||
|
||||
if(target != null && target.type != null && (target.type == "textarea" || target.type=="text" || target.type=="password"))
|
||||
|
@ -216,13 +216,13 @@ function keyboard(e)
|
|||
|
||||
if (e.keyCode) keycode=e.keyCode;
|
||||
else keycode=e.which;
|
||||
|
||||
|
||||
if(e.ctrlKey || e.altKey || e.metaKey) return true;
|
||||
|
||||
key = String.fromCharCode(keycode);
|
||||
|
||||
|
||||
key = String.fromCharCode(keycode);
|
||||
|
||||
if(!itemElements) itemElements = $$('.item');
|
||||
|
||||
|
||||
windowHeight = getWindowHeight();
|
||||
|
||||
if(key == "H")
|
||||
|
@ -233,15 +233,15 @@ function keyboard(e)
|
|||
Element.toggleClassName(i, "hidden");
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
if(itemElement)
|
||||
select(itemElement);
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
if(key == "h")
|
||||
{
|
||||
{
|
||||
if(itemElement)
|
||||
{
|
||||
Element.toggleClassName(itemElement, "shown");
|
||||
|
@ -250,7 +250,7 @@ function keyboard(e)
|
|||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if(key == "s")
|
||||
{
|
||||
if(itemElement)
|
||||
|
@ -260,7 +260,7 @@ function keyboard(e)
|
|||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if(key == "f")
|
||||
{
|
||||
if(itemElement)
|
||||
|
@ -270,7 +270,7 @@ function keyboard(e)
|
|||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if(key == "F")
|
||||
{
|
||||
itemElements.each(
|
||||
|
@ -284,7 +284,7 @@ function keyboard(e)
|
|||
checkbox.checked = true;
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -296,7 +296,7 @@ function keyboard(e)
|
|||
checkbox.checked = false;
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -304,14 +304,14 @@ function keyboard(e)
|
|||
{
|
||||
if(itemElement)
|
||||
{
|
||||
// is the next element visible yet? scroll if not.
|
||||
|
||||
// is the next element visible yet? scroll if not.
|
||||
|
||||
if(itemElement.nextSibling.id && itemElement.nextSibling.id != "end-of-items")
|
||||
{
|
||||
nextElement = itemElement.nextSibling;
|
||||
scrollHeight = getScrollY();
|
||||
y = getY(nextElement);
|
||||
|
||||
|
||||
if(y > scrollHeight + windowHeight)
|
||||
{
|
||||
window.scrollTo(0, scrollHeight + (.8 * windowHeight));
|
||||
|
@ -324,7 +324,7 @@ function keyboard(e)
|
|||
checkbox.checked = true;
|
||||
|
||||
next = itemElement.nextSibling;
|
||||
|
||||
|
||||
if(next.id && next.id != "end-of-items")
|
||||
{
|
||||
itemElement = next;
|
||||
|
@ -334,14 +334,14 @@ function keyboard(e)
|
|||
scrollHeight = getScrollY();
|
||||
|
||||
e = $('end-of-items');
|
||||
|
||||
|
||||
if (e.offsetParent) {
|
||||
y = e.offsetTop
|
||||
while (e = e.offsetParent) {
|
||||
y += e.offsetTop
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if(y - 10 > scrollHeight + windowHeight)
|
||||
{
|
||||
window.scrollTo(0, scrollHeight + (.8 * windowHeight));
|
||||
|
@ -357,17 +357,17 @@ function keyboard(e)
|
|||
{
|
||||
item = firstItem;
|
||||
itemElement = $(item);
|
||||
select(itemElement);
|
||||
select(itemElement);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
item = itemElement.id;
|
||||
itemElement = $(item);
|
||||
|
||||
|
||||
select(itemElement);
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
else
|
||||
|
@ -375,13 +375,13 @@ function keyboard(e)
|
|||
item = firstItem;
|
||||
itemElement = $(item);
|
||||
itemElements = $$('.item');
|
||||
|
||||
|
||||
select(itemElement);
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if(key == "J")
|
||||
{
|
||||
if(itemElement)
|
||||
|
@ -391,7 +391,7 @@ function keyboard(e)
|
|||
checkbox.checked = true;
|
||||
|
||||
next = itemElement.nextSibling;
|
||||
|
||||
|
||||
if(next.id)
|
||||
{
|
||||
itemElement = next;
|
||||
|
@ -408,12 +408,12 @@ function keyboard(e)
|
|||
itemElement = $(item);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
item = itemElement.id;
|
||||
itemElement = $(item);
|
||||
|
||||
|
||||
select(itemElement);
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
else
|
||||
|
@ -421,9 +421,9 @@ function keyboard(e)
|
|||
item = firstItem;
|
||||
itemElement = $(item);
|
||||
itemElements = $$('.item');
|
||||
|
||||
|
||||
select(itemElement);
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -433,9 +433,9 @@ function keyboard(e)
|
|||
if(itemElement)
|
||||
{
|
||||
unselect(itemElement);
|
||||
|
||||
|
||||
next = itemElement.nextSibling;
|
||||
|
||||
|
||||
if(next.id)
|
||||
{
|
||||
itemElement = next;
|
||||
|
@ -445,12 +445,12 @@ function keyboard(e)
|
|||
item = firstItem;
|
||||
itemElement = $(item);
|
||||
}
|
||||
|
||||
|
||||
item = itemElement.id;
|
||||
itemElement = $(item);
|
||||
|
||||
|
||||
select(itemElement);
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
else
|
||||
|
@ -458,25 +458,25 @@ function keyboard(e)
|
|||
item = firstItem;
|
||||
itemElement = $(item);
|
||||
itemElements = $$('.item');
|
||||
|
||||
|
||||
select(itemElement);
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if(key == "N")
|
||||
{
|
||||
if(itemElement) unselect(itemElement);
|
||||
|
||||
|
||||
item = itemElements.last().id;
|
||||
itemElement = $(item);
|
||||
|
||||
|
||||
select(itemElement);
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
if(key == "P")
|
||||
{
|
||||
if(itemElement) unselect(itemElement);
|
||||
|
@ -484,20 +484,20 @@ function keyboard(e)
|
|||
item = firstItem;
|
||||
itemElement = $(item);
|
||||
itemElements = $$('.item');
|
||||
|
||||
|
||||
select(itemElement);
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
if(key == "p")
|
||||
{
|
||||
if(itemElement)
|
||||
{
|
||||
unselect(itemElement);
|
||||
|
||||
|
||||
next = itemElement.previousSibling;
|
||||
|
||||
|
||||
if(next.id)
|
||||
{
|
||||
itemElement = next;
|
||||
|
@ -507,12 +507,12 @@ function keyboard(e)
|
|||
item = itemElements.last().id;
|
||||
itemElement = $(item);
|
||||
}
|
||||
|
||||
|
||||
item = itemElement.id;
|
||||
itemElement = $(item);
|
||||
|
||||
|
||||
select(itemElement);
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
else
|
||||
|
@ -520,13 +520,13 @@ function keyboard(e)
|
|||
itemElements = $$('.item');
|
||||
item = itemElements.last().id;
|
||||
itemElement = $(item);
|
||||
|
||||
|
||||
select(itemElement);
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -535,9 +535,9 @@ function keyboard(e)
|
|||
function startResize(e)
|
||||
{
|
||||
if (!e) e = window.event;
|
||||
|
||||
|
||||
Event.stop(e);
|
||||
|
||||
|
||||
drag = true;
|
||||
curPos=e.clientX;
|
||||
curWidth=$('sidebar').offsetWidth;
|
||||
|
@ -548,16 +548,16 @@ function startResize(e)
|
|||
function dragResize(e)
|
||||
{
|
||||
if (!e) e = window.event;
|
||||
|
||||
|
||||
if(drag)
|
||||
{
|
||||
Event.stop(e);
|
||||
|
||||
|
||||
newPos=e.clientX;
|
||||
var x=newPos-curPos;
|
||||
var w=curWidth+x;
|
||||
newWidth=(w<5?5:w);
|
||||
|
||||
|
||||
$('handle').style.left=newWidth+'px';
|
||||
|
||||
return false;
|
||||
|
@ -571,14 +571,14 @@ function completeDrag(e)
|
|||
if(drag)
|
||||
{
|
||||
Event.stop(e);
|
||||
|
||||
|
||||
drag = false;
|
||||
|
||||
|
||||
newPos=e.clientX;
|
||||
var x=newPos-curPos;
|
||||
var w=curWidth+x;
|
||||
newWidth=(w<5?5:w);
|
||||
|
||||
|
||||
$('sidebar').style.width=newWidth+'px';
|
||||
$('handle').style.left=newWidth+'px';
|
||||
$('items').style.marginLeft=(newWidth+20)+'px';
|
||||
|
@ -590,29 +590,27 @@ function completeDrag(e)
|
|||
for(i=0;i<tables.length;i++){
|
||||
tables[i].style.width=(newWidth-20)+'px';
|
||||
}
|
||||
}
|
||||
}
|
||||
var today = new Date();
|
||||
var expire = new Date();
|
||||
expire.setTime(today.getTime() + 3600000*24*100);
|
||||
document.cookie = "fof_sidebar_width="+newWidth+ "; expires="+expire.toGMTString()+";";
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
function hide_all()
|
||||
{
|
||||
items = document.getElementsByClassName("item", "items");
|
||||
for (var i = 0; i < items.length; i++)
|
||||
items[i].className = "item hidden";
|
||||
items.each( function(e) { e.className = "item hidden"; });
|
||||
}
|
||||
|
||||
function show_all()
|
||||
{
|
||||
items = document.getElementsByClassName("item", "items");
|
||||
for (var i = 0; i < items.length; i++)
|
||||
items[i].className = "item shown";
|
||||
items.each( function(e) { e.className = "item shown"; });
|
||||
}
|
||||
|
||||
function hide_body(id)
|
||||
|
@ -628,11 +626,11 @@ function show_body(id)
|
|||
function flag_upto(id)
|
||||
{
|
||||
elements = $A(Form.getInputs('itemform', 'checkbox'));
|
||||
|
||||
|
||||
for(i=0; i<elements.length; i++)
|
||||
{
|
||||
elements[i].checked = true;
|
||||
|
||||
|
||||
if(elements[i].name == id)
|
||||
{
|
||||
break;
|
||||
|
@ -654,10 +652,11 @@ function toggle_highlight()
|
|||
|
||||
function flag_all()
|
||||
{
|
||||
elements = $A(Form.getInputs('itemform', 'checkbox'));
|
||||
elements = $A(Form.getInputs('itemform', 'checkbox'));
|
||||
elements.each( function(e) { e.checked = true; });
|
||||
}
|
||||
|
||||
|
||||
function toggle_all()
|
||||
{
|
||||
elements = $A(Form.getInputs('itemform', 'checkbox'));
|
||||
|
@ -670,6 +669,7 @@ function unflag_all()
|
|||
elements.each( function(e) { e.checked = false; });
|
||||
}
|
||||
|
||||
|
||||
function mark_read()
|
||||
{
|
||||
document.items['action'].value = 'read';
|
||||
|
@ -684,84 +684,73 @@ function mark_unread()
|
|||
document.items.submit();
|
||||
}
|
||||
|
||||
function delete_flagged(is_adm)
|
||||
{
|
||||
if (confirm('Are you sure to remove selected items from FeedOnFeeds database?'+
|
||||
(is_adm ? '' : ' Only items from your private feeds can be removed!')))
|
||||
{
|
||||
document.items['action'].value = 'delete';
|
||||
document.items['return'].value = escape(location);
|
||||
document.items.submit();
|
||||
}
|
||||
}
|
||||
|
||||
function mark_feed_read(id)
|
||||
{
|
||||
throb();
|
||||
|
||||
|
||||
var url = "view-action.php";
|
||||
var params = "feed=" + id;
|
||||
var complete = function () { refreshlist(); };
|
||||
var options = { method: 'post', parameters: params, onComplete: complete };
|
||||
|
||||
|
||||
new Ajax.Request(url, options);
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
function add_tag(id, tag)
|
||||
{
|
||||
throb();
|
||||
|
||||
|
||||
var url = "add-tag.php";
|
||||
var params = "tag=" + tag + "&item=" + id;
|
||||
var complete = function () { refreshlist(); refreshitem(id); };
|
||||
var options = { method: 'get', parameters: params, onComplete: complete };
|
||||
|
||||
|
||||
new Ajax.Request(url, options);
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
function remove_tag(id, tag)
|
||||
{
|
||||
throb();
|
||||
|
||||
|
||||
var url = "add-tag.php";
|
||||
var params = "remove=true&tag=" + tag + "&item=" + id;
|
||||
var complete = function () { refreshlist(); refreshitem(id); };
|
||||
var options = { method: 'get', parameters: params, onComplete: complete };
|
||||
|
||||
|
||||
new Ajax.Request(url, options);
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
function delete_tag(tag)
|
||||
{
|
||||
throb();
|
||||
|
||||
|
||||
var url = "view-action.php";
|
||||
var params = "deltag=" + tag;
|
||||
var complete = function () { refreshlist(); };
|
||||
var options = { method: 'get', parameters: params, onComplete: complete };
|
||||
|
||||
|
||||
new Ajax.Request(url, options);
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
function change_feed_order(order, direction)
|
||||
{
|
||||
throb();
|
||||
|
||||
|
||||
var url = "set-prefs.php";
|
||||
var params = "feed_order=" + order + "&feed_direction=" + direction;
|
||||
var complete = function () { refreshlist(); };
|
||||
var options = { method: 'post', parameters: params, onComplete: complete };
|
||||
|
||||
|
||||
new Ajax.Request(url, options);
|
||||
|
||||
|
||||
return false;
|
||||
|
||||
}
|
||||
|
@ -769,20 +758,19 @@ function change_feed_order(order, direction)
|
|||
function toggle_favorite(id)
|
||||
{
|
||||
throb();
|
||||
|
||||
var image = $('fav' + id);
|
||||
|
||||
|
||||
var image = $('fav' + id);
|
||||
|
||||
var url = "add-tag.php?tag=star";
|
||||
var params = "&item=" + id;
|
||||
image.src = 'image/star-pending.gif';
|
||||
|
||||
|
||||
if(image.star)
|
||||
{
|
||||
params += "&remove=true";
|
||||
var complete = function()
|
||||
{
|
||||
image.src='image/star-off.gif';
|
||||
image.className = 'star';
|
||||
image.star = false;
|
||||
starred--;
|
||||
if(starred)
|
||||
|
@ -800,8 +788,7 @@ function toggle_favorite(id)
|
|||
{
|
||||
var complete = function()
|
||||
{
|
||||
image.src = 'image/star-on.gif';
|
||||
image.className = 'star-on';
|
||||
image.src='image/star-on.gif';
|
||||
image.star = true;
|
||||
starred++;
|
||||
if(starred)
|
||||
|
@ -815,17 +802,17 @@ function toggle_favorite(id)
|
|||
unthrob();
|
||||
};
|
||||
}
|
||||
|
||||
var options = { method: 'get', parameters: params, onComplete: complete };
|
||||
|
||||
var options = { method: 'get', parameters: params, onComplete: complete };
|
||||
new Ajax.Request(url, options);
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
function refreshitem(id)
|
||||
{
|
||||
throb();
|
||||
|
||||
|
||||
var url = 'item.php';
|
||||
var params = 'id=' + id;
|
||||
new Ajax.Updater($("i"+id), url, {method: 'get', parameters: params });
|
||||
|
@ -835,10 +822,10 @@ function refreshitem(id)
|
|||
function refreshlist()
|
||||
{
|
||||
throb();
|
||||
|
||||
|
||||
var url = 'sidebar.php';
|
||||
var params = "what=" + what + "&when=" + when;
|
||||
|
||||
|
||||
new Ajax.Updater($('sidebar'), url, {method: 'get', parameters: params, evalScripts: true });
|
||||
}
|
||||
|
||||
|
@ -882,30 +869,25 @@ function continueupdate()
|
|||
}
|
||||
|
||||
function continueadd()
|
||||
{
|
||||
var feed, f, m, dispUrl;
|
||||
if (feed = feedi())
|
||||
{
|
||||
if(feed = feedi())
|
||||
{
|
||||
f = feed();
|
||||
dispUrl = f['url'].replace(/^([a-z]+:\/\/[^\/]+:)([^\/]+)(@.*)$/, '$1******$3');
|
||||
new Insertion.Bottom($('items'), 'Adding ' + dispUrl + "... ");
|
||||
new Insertion.Bottom($('items'), 'Adding ' + f['url'] + "... ");
|
||||
$('items').childElements().last().scrollTo();
|
||||
|
||||
var parameters = 'url=' + encodeURIComponent(f['url']);
|
||||
parameters += "&unread=" + document.addform.unread.value;
|
||||
parameters += "&tags=" + document.addform.new_tags.value;
|
||||
parameters = 'url=' + encodeURIComponent(f['url']) + "&unread=" + document.addform.unread.value;
|
||||
|
||||
new Ajax.Updater('items', 'add-single.php', {
|
||||
method: 'get',
|
||||
parameters: parameters,
|
||||
insertion: Insertion.Bottom,
|
||||
onComplete: continueadd,
|
||||
evalScripts: true,
|
||||
onComplete: continueadd
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
new Insertion.Bottom($('items'), '<br />Done!');
|
||||
new Insertion.Bottom($('items'), '<br>Done!');
|
||||
refreshlist();
|
||||
}
|
||||
}
|
||||
|
@ -924,13 +906,3 @@ function ajaxadd()
|
|||
continueadd();
|
||||
}
|
||||
|
||||
function show_filter(id)
|
||||
{
|
||||
var sp1 = document.getElementById('fspan'+id);
|
||||
if (sp1)
|
||||
sp1.style.display = '';
|
||||
var sp2 = document.getElementById('ftspan'+id);
|
||||
if (sp2)
|
||||
sp2.style.display = 'none';
|
||||
var a = document.getElementById('fa'+id);
|
||||
}
|
||||
|
|
95
header.php
|
@ -17,56 +17,77 @@ include_once("fof-main.php");
|
|||
fof_set_content_type();
|
||||
|
||||
if(isset($_COOKIE['fof_sidebar_width']))
|
||||
$width = $_COOKIE['fof_sidebar_width'];
|
||||
{
|
||||
$width = $_COOKIE['fof_sidebar_width'];
|
||||
}
|
||||
else
|
||||
$width = 250;
|
||||
{
|
||||
$width = 250;
|
||||
}
|
||||
|
||||
$unread_count = fof_get_unread_count(fof_current_user());
|
||||
|
||||
?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<title>Feed on Feeds<?php if($unread_count) echo " ($unread_count)";?></title>
|
||||
<head>
|
||||
<title>Feed on Feeds<?php if($unread_count) echo " ($unread_count)";?></title>
|
||||
|
||||
<link rel="stylesheet" href="fof.css" media="screen" />
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="fof.css" media="screen" />
|
||||
<link rel="stylesheet" type="text/css" href="fof-mobile.css" media="handheld" />
|
||||
<link rel="stylesheet" type="text/css" href="fof-mobile.css" media="only screen and (max-device-width: 600px)" />
|
||||
<link rel="microsummary" href="microsummary.php" />
|
||||
|
||||
<script src="prototype/prototype.js" type="text/javascript"></script>
|
||||
|
||||
<script src="fof.js" type="text/javascript"></script>
|
||||
|
||||
<script>
|
||||
document.onmousemove = dragResize;
|
||||
document.onmouseup = completeDrag;
|
||||
<?php if($fof_prefs_obj->get('keyboard')) { ?>
|
||||
document.onkeypress = keyboard;
|
||||
<?php } ?>
|
||||
isIE = false;
|
||||
</script>
|
||||
|
||||
<style>
|
||||
#sidebar
|
||||
{
|
||||
width: <?php echo $width ?>px;
|
||||
}
|
||||
|
||||
<script src="prototype/prototype.js" type="text/javascript"></script>
|
||||
<script src="fof.js" type="text/javascript"></script>
|
||||
#handle
|
||||
{
|
||||
left:<?php echo $width ?>px;
|
||||
}
|
||||
|
||||
#items
|
||||
{
|
||||
margin-left: <?php echo $width+20 ?>px;
|
||||
}
|
||||
|
||||
#item-display-controls { left: <?php echo $width+10 ?>px; }
|
||||
</style>
|
||||
|
||||
<!--[if IE]>
|
||||
<script>window.isIE = true;</script>
|
||||
<style>
|
||||
@media screen { #sidebar table { width: <?=($width-20)?>px; } }
|
||||
</style>
|
||||
<![endif]-->
|
||||
<!--[if IE]>
|
||||
<style>
|
||||
#sidebar table
|
||||
{
|
||||
width: <?php echo $width - 20?>px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<style>
|
||||
@media only screen and (min-device-width: 600px) {
|
||||
#sidebar { width: <?=$width?>px; }
|
||||
#handle { left: <?=$width?>px; }
|
||||
#items { margin-left: <?=($width+20)?>px; }
|
||||
#item-display-controls { left: <?=($width+10)?>px; }
|
||||
}
|
||||
</style>
|
||||
<script>isIE = true;</script>
|
||||
<![endif]-->
|
||||
|
||||
|
||||
<script>
|
||||
document.onmousemove = dragResize;
|
||||
document.onmouseup = completeDrag;
|
||||
<?php if($fof_prefs_obj->get('keyboard')) { ?>
|
||||
document.onkeypress = keyboard;
|
||||
<?php } ?>
|
||||
</script>
|
||||
|
||||
</head>
|
||||
|
||||
<body class="highlight-on">
|
||||
</head>
|
||||
|
||||
<body class="highlight-on"> <!--onkeypress="keyboard(event)"-->
|
||||
|
||||
<div id="sidebar">
|
||||
<?php include("sidebar.php") ?>
|
||||
<?php include("sidebar.php") ?>
|
||||
</div>
|
||||
|
||||
<div id="handle" onmousedown="startResize(event)"></div>
|
||||
|
|
Before Width: | Height: | Size: 165 B |
Before Width: | Height: | Size: 75 B |
Before Width: | Height: | Size: 585 B After Width: | Height: | Size: 585 B |
Before Width: | Height: | Size: 1008 B After Width: | Height: | Size: 1008 B |
|
@ -17,3 +17,4 @@ include("header.php");
|
|||
include("items.php");
|
||||
|
||||
include("footer.php");
|
||||
?>
|
||||
|
|
353
install.php
|
@ -4,8 +4,9 @@
|
|||
*
|
||||
* install.php - creates tables and cache directory, if they don't exist
|
||||
*
|
||||
* Copyright (C) 2004-2007 Stephen Minutillo steve@minutillo.com http://minutillo.com/steve/
|
||||
* (C) 2009-2014 Vitaliy Filippov vitalif@mail.ru http://yourcmc.ru/wiki/
|
||||
*
|
||||
* Copyright (C) 2004-2007 Stephen Minutillo
|
||||
* steve@minutillo.com - http://minutillo.com/steve/
|
||||
*
|
||||
* Distributed under the GPL - see LICENSE
|
||||
*
|
||||
|
@ -22,19 +23,25 @@ fof_set_content_type();
|
|||
|
||||
function get_curl_version()
|
||||
{
|
||||
if (is_array($curl = curl_version()))
|
||||
$curl = $curl['version'];
|
||||
else if (preg_match('/curl\/(\S+)(\s|$)/', $curl, $match))
|
||||
$curl = $match[1];
|
||||
else
|
||||
$curl = 0;
|
||||
return $curl;
|
||||
if (is_array($curl = curl_version()))
|
||||
{
|
||||
$curl = $curl['version'];
|
||||
}
|
||||
else if (preg_match('/curl\/(\S+)(\s|$)/', $curl, $match))
|
||||
{
|
||||
$curl = $match[1];
|
||||
}
|
||||
else
|
||||
{
|
||||
$curl = 0;
|
||||
}
|
||||
return $curl;
|
||||
}
|
||||
|
||||
$php_ok = (function_exists('version_compare') && version_compare(phpversion(), '4.3.2', '>='));
|
||||
$xml_ok = extension_loaded('xml');
|
||||
$pcre_ok = extension_loaded('pcre');
|
||||
$mysql_ok = extension_loaded('mysqli');
|
||||
$mysql_ok = extension_loaded('mysql');
|
||||
|
||||
$curl_ok = (extension_loaded('curl') && version_compare(get_curl_version(), '7.10.5', '>='));
|
||||
$zlib_ok = extension_loaded('zlib');
|
||||
|
@ -42,59 +49,64 @@ $mbstring_ok = extension_loaded('mbstring');
|
|||
$iconv_ok = extension_loaded('iconv');
|
||||
|
||||
?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<title>feed on feeds - installation</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<link rel="stylesheet" href="fof.css" media="screen" />
|
||||
<script src="fof.js" type="text/javascript"></script>
|
||||
<meta name="ROBOTS" content="NOINDEX, NOFOLLOW" />
|
||||
<style>
|
||||
body
|
||||
{
|
||||
font-family: georgia;
|
||||
font-size: 16px;
|
||||
}
|
||||
div
|
||||
{
|
||||
background: #eee;
|
||||
border: 1px solid black;
|
||||
width: 75%;
|
||||
margin: 5em auto;
|
||||
padding: 1.5em;
|
||||
}
|
||||
hr
|
||||
{
|
||||
height:0;
|
||||
border:0;
|
||||
border-top:1px solid #999;
|
||||
}
|
||||
.fail { color: red; }
|
||||
.pass { color: green; }
|
||||
.warn { color: #a60; }
|
||||
</style>
|
||||
</head>
|
||||
<head><title>feed on feeds - installation</title>
|
||||
<link rel="stylesheet" href="fof.css" media="screen" />
|
||||
<script src="fof.js" type="text/javascript"></script>
|
||||
<meta name="ROBOTS" content="NOINDEX, NOFOLLOW" />
|
||||
<style>
|
||||
body
|
||||
{
|
||||
font-family: georgia;
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
div
|
||||
{
|
||||
background: #eee;
|
||||
border: 1px solid black;
|
||||
width: 75%;
|
||||
margin: 5em auto;
|
||||
padding: 1.5em;
|
||||
}
|
||||
|
||||
hr
|
||||
{
|
||||
height:0;
|
||||
border:0;
|
||||
border-top:1px solid #999;
|
||||
}
|
||||
|
||||
.fail { color: red; }
|
||||
|
||||
.pass { color: green; }
|
||||
|
||||
.warn { color: #a60; }
|
||||
|
||||
</style>
|
||||
|
||||
</head>
|
||||
|
||||
<body><div> <center style="font-size: 20px;"><a href="http://feedonfeeds.com/">Feed on Feeds</a> - Installation</center><br>
|
||||
|
||||
<body><div><center style="font-size: 20px;"><a href="http://feedonfeeds.com/">Feed on Feeds</a> - Installation</center><br>
|
||||
|
||||
<?php
|
||||
if (!empty($_GET['password']))
|
||||
if($_GET['password'] && $_GET['password'] == $_GET['password2'] )
|
||||
{
|
||||
if ($_GET['password'] == $_GET['password2'])
|
||||
{
|
||||
$password_hash = md5($_GET['password'] . 'admin');
|
||||
fof_safe_query("insert into $FOF_USER_TABLE (user_id, user_name, user_password_hash, user_level) values (1, 'admin', '%s', 'admin')", $password_hash);
|
||||
echo '<center><b>OK! Setup complete! <a href=".">Login as admin</a>, and start subscribing!</center></b></div></body></html>';
|
||||
}
|
||||
else
|
||||
{
|
||||
echo '<center><font color="red">Passwords do not match!</font></center><br><br>';
|
||||
}
|
||||
$password_hash = md5($_GET['password'] . 'admin');
|
||||
fof_safe_query("insert into $FOF_USER_TABLE (user_id, user_name, user_password_hash, user_level) values (1, 'admin', '%s', 'admin')", $password_hash);
|
||||
|
||||
echo '<center><b>OK! Setup complete! <a href=".">Login as admin</a>, and start subscribing!</center></b></div></body></html>';
|
||||
}
|
||||
else
|
||||
{
|
||||
if($_GET['password'] != $_GET['password2'] )
|
||||
{
|
||||
echo '<center><font color="red">Passwords do not match!</font></center><br><br>';
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
Checking compatibility...
|
||||
|
@ -126,7 +138,7 @@ else
|
|||
if($mysql_ok) echo "<span class='pass'>MySQL ok...</span> ";
|
||||
else
|
||||
{
|
||||
echo "<br><span class='fail'>Your PHP installation is missing the MySQLi extension!</span> This is required by Feed on Feeds. Sorry!";
|
||||
echo "<br><span class='fail'>Your PHP installation is missing the MySQL extension!</span> This is required by Feed on Feeds. Sorry!";
|
||||
echo "</div></body></html>";
|
||||
exit;
|
||||
}
|
||||
|
@ -174,28 +186,8 @@ CREATE TABLE IF NOT EXISTS `$FOF_FEED_TABLE` (
|
|||
`feed_cache_date` int(11) default '0',
|
||||
`feed_cache_attempt_date` int(11) default '0',
|
||||
`feed_cache` text,
|
||||
PRIMARY KEY (`feed_id`)
|
||||
) ENGINE=InnoDB COLLATE=utf8_unicode_ci;
|
||||
EOQ;
|
||||
|
||||
$tables[] = <<<EOQ
|
||||
CREATE TABLE IF NOT EXISTS `$FOF_TAG_TABLE` (
|
||||
`tag_id` int(11) NOT NULL auto_increment,
|
||||
`tag_name` char(100) NOT NULL default '',
|
||||
PRIMARY KEY (`tag_id`),
|
||||
UNIQUE KEY (`tag_name`)
|
||||
) ENGINE=InnoDB COLLATE=utf8_unicode_ci;
|
||||
EOQ;
|
||||
|
||||
$tables[] = <<<EOQ
|
||||
CREATE TABLE IF NOT EXISTS `$FOF_USER_TABLE` (
|
||||
`user_id` int(11) NOT NULL auto_increment,
|
||||
`user_name` varchar(100) NOT NULL default '',
|
||||
`user_password_hash` varchar(32) NOT NULL default '',
|
||||
`user_level` enum('user','admin') NOT NULL default 'user',
|
||||
`user_prefs` text,
|
||||
PRIMARY KEY (`user_id`)
|
||||
) ENGINE=InnoDB COLLATE=utf8_unicode_ci;
|
||||
PRIMARY KEY (`feed_id`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
|
||||
EOQ;
|
||||
|
||||
$tables[] = <<<EOQ
|
||||
|
@ -208,14 +200,12 @@ CREATE TABLE IF NOT EXISTS `$FOF_ITEM_TABLE` (
|
|||
`item_published` int(11) NOT NULL default '0',
|
||||
`item_updated` int(11) NOT NULL default '0',
|
||||
`item_title` text NOT NULL,
|
||||
`item_author` text NOT NULL,
|
||||
`item_content` text NOT NULL,
|
||||
PRIMARY KEY (`item_id`),
|
||||
KEY `feed_id` (`feed_id`),
|
||||
KEY `item_guid` (`item_guid`(255)),
|
||||
KEY `feed_id_item_cached` (`feed_id`,`item_cached`),
|
||||
KEY `item_published` (`item_published`),
|
||||
FOREIGN KEY (`feed_id`) REFERENCES `$FOF_FEED_TABLE` (`feed_id`) ON UPDATE CASCADE
|
||||
) ENGINE=InnoDB COLLATE=utf8_unicode_ci;
|
||||
KEY `feed_id_item_cached` (`feed_id`,`item_cached`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
|
||||
EOQ;
|
||||
|
||||
$tables[] = <<<EOQ
|
||||
|
@ -223,17 +213,8 @@ CREATE TABLE IF NOT EXISTS `$FOF_ITEM_TAG_TABLE` (
|
|||
`user_id` int(11) NOT NULL default '0',
|
||||
`item_id` int(11) NOT NULL default '0',
|
||||
`tag_id` int(11) NOT NULL default '0',
|
||||
`item_published` int(11) NOT NULL default '0',
|
||||
`feed_id` int(11) NOT NULL default '0',
|
||||
PRIMARY KEY (`tag_id`,`user_id`,`item_id`),
|
||||
KEY `tag_id_user_id_item_published_item_id` (tag_id, user_id, item_published, item_id),
|
||||
KEY `tag_id_user_id_feed_id` (tag_id, user_id, feed_id),
|
||||
KEY `item_id_user_id_tag_id` (item_id, user_id, tag_id),
|
||||
FOREIGN KEY (`tag_id`) REFERENCES `$FOF_TAG_TABLE` (`tag_id`) ON DELETE CASCADE ON UPDATE CASCADE,
|
||||
FOREIGN KEY (`user_id`) REFERENCES `$FOF_USER_TABLE` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE,
|
||||
FOREIGN KEY (`item_id`) REFERENCES `$FOF_ITEM_TABLE` (`item_id`) ON DELETE CASCADE ON UPDATE CASCADE,
|
||||
FOREIGN KEY (`feed_id`) REFERENCES `$FOF_FEED_TABLE` (`feed_id`) ON DELETE CASCADE ON UPDATE CASCADE
|
||||
) ENGINE=InnoDB COLLATE=utf8_unicode_ci;
|
||||
PRIMARY KEY (`user_id`,`item_id`,`tag_id`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
|
||||
EOQ;
|
||||
|
||||
$tables[] = <<<EOQ
|
||||
|
@ -241,140 +222,126 @@ CREATE TABLE IF NOT EXISTS `$FOF_SUBSCRIPTION_TABLE` (
|
|||
`feed_id` int(11) NOT NULL default '0',
|
||||
`user_id` int(11) NOT NULL default '0',
|
||||
`subscription_prefs` text,
|
||||
PRIMARY KEY (`feed_id`,`user_id`),
|
||||
FOREIGN KEY (`user_id`) REFERENCES `$FOF_USER_TABLE` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE,
|
||||
FOREIGN KEY (`feed_id`) REFERENCES `$FOF_FEED_TABLE` (`feed_id`) ON DELETE CASCADE ON UPDATE CASCADE
|
||||
) ENGINE=InnoDB COLLATE=utf8_unicode_ci;
|
||||
PRIMARY KEY (`feed_id`,`user_id`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
|
||||
EOQ;
|
||||
|
||||
$tables[] = <<<EOQ
|
||||
CREATE TABLE IF NOT EXISTS `$FOF_TAG_TABLE` (
|
||||
`tag_id` int(11) NOT NULL auto_increment,
|
||||
`tag_name` char(100) NOT NULL default '',
|
||||
PRIMARY KEY (`tag_id`),
|
||||
UNIQUE KEY (`tag_name`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
|
||||
EOQ;
|
||||
|
||||
$tables[] = <<<EOQ
|
||||
CREATE TABLE IF NOT EXISTS `$FOF_USER_TABLE` (
|
||||
`user_id` int(11) NOT NULL auto_increment,
|
||||
`user_name` varchar(100) NOT NULL default '',
|
||||
`user_password_hash` varchar(32) NOT NULL default '',
|
||||
`user_level` enum('user','admin') NOT NULL default 'user',
|
||||
`user_prefs` text,
|
||||
PRIMARY KEY (`user_id`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
|
||||
EOQ;
|
||||
|
||||
foreach($tables as $table)
|
||||
fof_db_query($table, 1);
|
||||
{
|
||||
if(!fof_db_query($table, 1))
|
||||
{
|
||||
exit ("Can't create table. MySQL says: <b>" . mysql_error() . "</b><br>" );
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
Tables exist.<hr>
|
||||
|
||||
Upgrading schema...
|
||||
<?php
|
||||
$result = fof_db_query("show columns from $FOF_FEED_TABLE like 'feed_image_cache_date'");
|
||||
|
||||
function add_fk($show_create_table, $table, $column, $ref_table, $action = 'on delete cascade on update cascade')
|
||||
if(mysql_num_rows($result) == 0)
|
||||
{
|
||||
if (!strpos($show_create_table, "FOREIGN KEY (`$column`)"))
|
||||
fof_db_query("alter table $table add foreign key ($column) references $ref_table ($column) $action");
|
||||
|
||||
print "Upgrading schema...";
|
||||
|
||||
fof_db_query("ALTER TABLE $FOF_FEED_TABLE ADD `feed_image_cache_date` INT( 11 ) DEFAULT '0' AFTER `feed_image` ;");
|
||||
|
||||
print "Done.<hr>";
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
<?php
|
||||
$result = fof_db_query("show columns from $FOF_USER_TABLE like 'user_password_hash'");
|
||||
|
||||
if(mysql_num_rows($result) == 0)
|
||||
{
|
||||
|
||||
print "Upgrading schema...";
|
||||
|
||||
fof_db_query("ALTER TABLE $FOF_USER_TABLE CHANGE `user_password` `user_password_hash` VARCHAR( 32 ) NOT NULL");
|
||||
fof_db_query("update $FOF_USER_TABLE set user_password_hash = md5(concat(user_password_hash, user_name))");
|
||||
|
||||
print "Done.<hr>";
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
<?php
|
||||
$result = fof_db_query("show columns from $FOF_FEED_TABLE like 'feed_cache_attempt_date'");
|
||||
|
||||
if(mysql_num_rows($result) == 0)
|
||||
{
|
||||
|
||||
print "Upgrading schema...";
|
||||
|
||||
fof_db_query("ALTER TABLE $FOF_FEED_TABLE ADD `feed_cache_attempt_date` INT( 11 ) DEFAULT '0' AFTER `feed_cache_date` ;");
|
||||
|
||||
print "Done.<hr>";
|
||||
}
|
||||
|
||||
$r = fof_db_query("show table status");
|
||||
while ($row = fof_db_get_row($r))
|
||||
{
|
||||
$table = $row['Name'];
|
||||
$alter = array();
|
||||
if (strtolower($row['Engine']) === 'myisam')
|
||||
$alter[] = 'engine=innodb';
|
||||
if (strpos($row['Collation'], 'utf8') === false)
|
||||
$alter[] = 'convert to character set utf8 collate utf8_unicode_ci';
|
||||
$r2 = fof_db_query("desc $table");
|
||||
while ($row2 = fof_db_get_row($r2))
|
||||
if (strtolower($row2['Type']) == 'mediumtext')
|
||||
$alter[] = 'change '.$row2['Field'].' '.$row2['Field'].' text'.(strtolower($row2['Null']) == 'no' ? ' not null' : '');
|
||||
if ($alter)
|
||||
fof_db_query("alter table $table ".implode(', ', $alter));
|
||||
}
|
||||
|
||||
if (!fof_num_rows(fof_db_query("show columns from $FOF_FEED_TABLE like 'feed_image_cache_date'")))
|
||||
fof_db_query("ALTER TABLE $FOF_FEED_TABLE ADD `feed_image_cache_date` INT( 11 ) DEFAULT '0' AFTER `feed_image`;");
|
||||
|
||||
if (!fof_num_rows(fof_db_query("show columns from $FOF_USER_TABLE like 'user_password_hash'")))
|
||||
{
|
||||
fof_db_query("ALTER TABLE $FOF_USER_TABLE CHANGE `user_password` `user_password_hash` VARCHAR( 32 ) NOT NULL");
|
||||
fof_db_query("update $FOF_USER_TABLE set user_password_hash = md5(concat(user_password_hash, user_name))");
|
||||
}
|
||||
|
||||
if (!fof_num_rows(fof_db_query("show columns from $FOF_FEED_TABLE like 'feed_cache_attempt_date'")))
|
||||
fof_db_query("ALTER TABLE $FOF_FEED_TABLE ADD `feed_cache_attempt_date` INT( 11 ) DEFAULT '0' AFTER `feed_cache_date`;");
|
||||
|
||||
if (!fof_num_rows(fof_db_query("show columns from $FOF_ITEM_TABLE like 'item_author'")))
|
||||
fof_db_query("ALTER TABLE $FOF_ITEM_TABLE ADD `item_author` text NOT NULL AFTER `item_title`;");
|
||||
|
||||
$check = fof_db_get_row(fof_db_query("show create table $FOF_ITEM_TABLE"));
|
||||
if (strpos($check[1], 'KEY `feed_id`') !== false)
|
||||
fof_db_query("alter table $FOF_ITEM_TABLE drop key feed_id, add key item_published (item_published)");
|
||||
|
||||
add_fk($check[1], $FOF_ITEM_TABLE, 'feed_id', $FOF_FEED_TABLE, 'on update cascade');
|
||||
|
||||
$check = fof_db_get_row(fof_db_query("show create table $FOF_ITEM_TAG_TABLE"));
|
||||
|
||||
add_fk($check[1], $FOF_ITEM_TAG_TABLE, 'tag_id', $FOF_TAG_TABLE);
|
||||
add_fk($check[1], $FOF_ITEM_TAG_TABLE, 'user_id', $FOF_USER_TABLE);
|
||||
add_fk($check[1], $FOF_ITEM_TAG_TABLE, 'item_id', $FOF_ITEM_TABLE);
|
||||
|
||||
if (strpos($check[1], 'PRIMARY KEY (`user_id`,`item_id`,`tag_id`)') !== false)
|
||||
{
|
||||
fof_db_query(
|
||||
"alter table $FOF_ITEM_TAG_TABLE add key user_id (user_id),".
|
||||
" add key item_id_user_id_tag_id (item_id, user_id, tag_id), drop primary key,".
|
||||
" add primary key (tag_id, user_id, item_id), drop key tag_id, drop key item_id"
|
||||
);
|
||||
}
|
||||
|
||||
if (!strpos($check[1], '`item_published`'))
|
||||
{
|
||||
fof_db_query(
|
||||
"alter table $FOF_ITEM_TAG_TABLE add item_published int not null default '0',".
|
||||
" add feed_id int not null default 0,".
|
||||
" add key tag_id_user_id_item_published_item_id (tag_id, user_id, item_published, item_id),".
|
||||
" add key tag_id_user_id_feed_id (tag_id, user_id, feed_id),".
|
||||
" add key feed_id (feed_id)"
|
||||
);
|
||||
}
|
||||
|
||||
if (fof_num_rows(fof_db_query("select count(*) from $FOF_ITEM_TAG_TABLE where feed_id=0")))
|
||||
{
|
||||
fof_db_query(
|
||||
"update $FOF_ITEM_TAG_TABLE it, $FOF_ITEM_TABLE i".
|
||||
" set it.item_published=i.item_published, it.feed_id=i.feed_id".
|
||||
" where it.feed_id=0 and it.item_id=i.item_id"
|
||||
);
|
||||
}
|
||||
|
||||
add_fk($check[1], $FOF_ITEM_TAG_TABLE, 'feed_id', $FOF_FEED_TABLE);
|
||||
|
||||
?>
|
||||
Schema up to date.<hr>
|
||||
|
||||
Inserting initial data...
|
||||
|
||||
<?php
|
||||
fof_db_query("insert into $FOF_TAG_TABLE (tag_id, tag_name) values (1, 'unread')", 1);
|
||||
fof_db_query("insert into $FOF_TAG_TABLE (tag_id, tag_name) values (2, 'star')", 1);
|
||||
?>
|
||||
|
||||
Done.<hr>
|
||||
|
||||
Checking cache directory...
|
||||
<?php
|
||||
|
||||
if (!file_exists("cache"))
|
||||
if ( ! file_exists( "cache" ) )
|
||||
{
|
||||
$status = @mkdir("cache", 0755);
|
||||
if (!$status)
|
||||
{
|
||||
echo "<font color='red'>Can't create directory <code>" . getcwd() . "/cache/</code>.<br>You will need to create it yourself, and make it writeable by your PHP process.<br>Then, reload this page.</font>";
|
||||
echo "</div></body></html>";
|
||||
$status = @mkdir( "cache", 0755 );
|
||||
|
||||
if ( ! $status )
|
||||
{
|
||||
echo "<font color='red'>Can't create directory <code>" . getcwd() . "/cache/</code>.<br>You will need to create it yourself, and make it writeable by your PHP process.<br>Then, reload this page.</font>";
|
||||
echo "</div></body></html>";
|
||||
exit;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(!is_writable("cache"))
|
||||
if(!is_writable( "cache" ))
|
||||
{
|
||||
echo "<font color='red'>The directory <code>" . getcwd() . "/cache/</code> exists, but is not writable.<br>You will need to make it writeable by your PHP process.<br>Then, reload this page.</font>";
|
||||
echo "</div></body></html>";
|
||||
exit;
|
||||
echo "<font color='red'>The directory <code>" . getcwd() . "/cache/</code> exists, but is not writable.<br>You will need to make it writeable by your PHP process.<br>Then, reload this page.</font>";
|
||||
echo "</div></body></html>";
|
||||
exit;
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
Cache directory exists and is writable.<hr>
|
||||
|
||||
<?php
|
||||
$result = fof_db_query("select * from $FOF_USER_TABLE where user_name = 'admin'");
|
||||
if (fof_num_rows($result) == 0) {
|
||||
$result = fof_db_query("select * from $FOF_USER_TABLE where user_name = 'admin'");
|
||||
if(mysql_num_rows($result) == 0) {
|
||||
?>
|
||||
|
||||
You now need to choose an initial password for the 'admin' account:<br>
|
||||
|
||||
<form>
|
||||
|
|
7
item.php
|
@ -17,11 +17,8 @@ include_once("fof-render.php");
|
|||
|
||||
fof_set_content_type();
|
||||
|
||||
if (empty($_GET['id']))
|
||||
{
|
||||
die("No post ID");
|
||||
}
|
||||
|
||||
$row = fof_get_item(fof_current_user(), $_GET['id']);
|
||||
|
||||
fof_render_item($row);
|
||||
|
||||
?>
|
88
items.php
|
@ -15,31 +15,68 @@
|
|||
include_once("fof-main.php");
|
||||
include_once("fof-render.php");
|
||||
|
||||
$which = !empty($_GET['which']) ? $_GET['which'] : 0;
|
||||
$order = !empty($_GET['order']) ? $_GET['order'] : $fof_prefs_obj->get('order');
|
||||
$what = !empty($_GET['what']) ? $_GET['what'] : 'unread';
|
||||
if($_GET['how'] == 'paged' && !isset($_GET['which']))
|
||||
{
|
||||
$which = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
$which = $_GET['which'];
|
||||
}
|
||||
|
||||
$how = !empty($_GET['how']) ? $_GET['how'] : NULL;
|
||||
$feed = !empty($_GET['feed']) ? $_GET['feed'] : NULL;
|
||||
$when = !empty($_GET['when']) ? $_GET['when'] : NULL;
|
||||
$howmany = !empty($_GET['howmany']) ? $_GET['howmany'] : $fof_prefs_obj->get('howmany');
|
||||
$search = !empty($_GET['search']) ? $_GET['search'] : NULL;
|
||||
$order = $_GET['order'];
|
||||
|
||||
$title = fof_view_title($feed, $what, $when, $which, $howmany, $search);
|
||||
if(!isset($_GET['what']))
|
||||
{
|
||||
$what = "unread";
|
||||
}
|
||||
else
|
||||
{
|
||||
$what = $_GET['what'];
|
||||
}
|
||||
|
||||
if(!isset($_GET['order']))
|
||||
{
|
||||
$order = $fof_prefs_obj->get("order");
|
||||
}
|
||||
|
||||
$how = $_GET['how'];
|
||||
$feed = $_GET['feed'];
|
||||
$when = $_GET['when'];
|
||||
$howmany = $_GET['howmany'];
|
||||
|
||||
$title = fof_view_title($_GET['feed'], $what, $_GET['when'], $which, $_GET['howmany'], $_GET['search']);
|
||||
$noedit = $_GET['noedit'];
|
||||
|
||||
?>
|
||||
|
||||
<p class="items-title"><?php echo $title ?></p>
|
||||
<ul id="item-display-controls-spacer" class="inline-list">
|
||||
<li class="orderby">[new to old]</li>
|
||||
<li class="orderby">[old to new]</li>
|
||||
<li><a href="javascript:flag_all();mark_read()"><strong>Mark all read</strong></a></li>
|
||||
<li><a href="javascript:flag_all()">Flag all</a></li>
|
||||
<li><a href="javascript:unflag_all()">Unflag all</a></li>
|
||||
<li><a href="javascript:toggle_all()">Toggle all</a></li>
|
||||
<li><a href="javascript:mark_read()">Mark flagged read</a></li>
|
||||
<li><a href="javascript:mark_unread()">Mark flagged unread</a></li>
|
||||
<li><a href="javascript:show_all()">Show all</a></li>
|
||||
<li><a href="javascript:hide_all()">Hide all</a></li>
|
||||
</ul>
|
||||
|
||||
<br style="clear: both"><br>
|
||||
|
||||
<p><?php echo $title?></p>
|
||||
|
||||
|
||||
<ul id="item-display-controls" class="inline-list">
|
||||
<li class="orderby"><?php
|
||||
|
||||
echo ($order == "desc") ? '[new to old]' : "<a href=\".?feed=$feed&what=$what&when=$when&how=$how&howmany=$howmany&order=desc\">[new to old]</a>";
|
||||
echo ($order == "desc") ? '[new to old]' : "<a href=\".?feed=$feed&what=$what&when=$when&how=$how&howmany=$howmany&order=desc\">[new to old]</a>" ;
|
||||
|
||||
?></li>
|
||||
<li class="orderby"><?php
|
||||
|
||||
echo ($order == "asc") ? '[old to new]' : "<a href=\".?feed=$feed&what=$what&when=$when&how=$how&howmany=$howmany&order=asc\">[old to new]</a>";
|
||||
echo ($order == "asc") ? '[old to new]' : "<a href=\".?feed=$feed&what=$what&when=$when&how=$how&howmany=$howmany&order=asc\">[old to new]</a>" ;
|
||||
|
||||
?></li>
|
||||
<li><a href="javascript:flag_all();mark_read()"><strong>Mark all read</strong></a></li>
|
||||
|
@ -50,9 +87,10 @@ $title = fof_view_title($feed, $what, $when, $which, $howmany, $search);
|
|||
<li><a href="javascript:mark_unread()">Mark flagged unread</a></li>
|
||||
<li><a href="javascript:show_all()">Show all</a></li>
|
||||
<li><a href="javascript:hide_all()">Hide all</a></li>
|
||||
<li><a href="javascript:delete_flagged(<?= fof_is_admin() ? 1 : 0 ?>)">Delete flagged</a></li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<!-- close this form to fix first item! -->
|
||||
|
||||
<form id="itemform" name="items" action="view-action.php" method="post" onSubmit="return false;">
|
||||
|
@ -60,13 +98,18 @@ $title = fof_view_title($feed, $what, $when, $which, $howmany, $search);
|
|||
<input type="hidden" name="return" />
|
||||
|
||||
<?php
|
||||
$links = fof_get_nav_links($feed, $what, $when, $which, $howmany);
|
||||
$links = fof_get_nav_links($_GET['feed'], $what, $_GET['when'], $which, $_GET['howmany']);
|
||||
|
||||
if($links) { ?>
|
||||
<center><?php echo $links ?></center><?php
|
||||
}
|
||||
if($links)
|
||||
{
|
||||
?>
|
||||
<center><?php echo $links ?></center>
|
||||
|
||||
$result = fof_get_items(fof_current_user(), $feed, $what, $when, $which, $howmany, $order, $search);
|
||||
<?php
|
||||
}
|
||||
|
||||
|
||||
$result = fof_get_items(fof_current_user(), $_GET['feed'], $what, $_GET['when'], $which, $_GET['howmany'], $order, $_GET['search']);
|
||||
|
||||
$first = true;
|
||||
|
||||
|
@ -75,7 +118,7 @@ foreach($result as $row)
|
|||
$item_id = $row['item_id'];
|
||||
if($first) print "<script>firstItem = 'i$item_id'; </script>";
|
||||
$first = false;
|
||||
print '<div class="item '.(!empty($row['prefs']['hide_content']) ? 'hidden' : 'shown').'" id="i' . $item_id . '" onclick="return itemClicked(event)">';
|
||||
print '<div class="item shown" id="i' . $item_id . '" onclick="return itemClicked(event)">';
|
||||
fof_render_item($row);
|
||||
print '</div>';
|
||||
}
|
||||
|
@ -85,12 +128,9 @@ if(count($result) == 0)
|
|||
echo "<p><i>No items found.</i></p>";
|
||||
}
|
||||
|
||||
if($links) { ?>
|
||||
<center><?php echo $links ?></center><?php
|
||||
}
|
||||
?>
|
||||
</form>
|
||||
|
||||
|
||||
<div id="end-of-items"></div>
|
||||
|
||||
<script>itemElements = $$('.item');</script>
|
||||
<script>itemElements = $$('.item');</script>
|
79
login.php
|
@ -4,21 +4,22 @@
|
|||
*
|
||||
* login.php - username / password entry
|
||||
*
|
||||
*
|
||||
* Copyright (C) 2004-2007 Stephen Minutillo
|
||||
* steve@minutillo.com - http://minutillo.com/steve/
|
||||
*
|
||||
* Distributed under the GPL - see LICENSE
|
||||
*
|
||||
*/
|
||||
|
||||
ob_start();
|
||||
|
||||
$fof_no_login = true;
|
||||
|
||||
require_once("fof-main.php");
|
||||
include_once("fof-main.php");
|
||||
|
||||
fof_set_content_type();
|
||||
|
||||
$failed = false;
|
||||
if(isset($_POST["user_name"]) && isset($_POST["user_password"]))
|
||||
{
|
||||
if(fof_authenticate($_POST['user_name'], md5($_POST['user_password'] . $_POST['user_name'])))
|
||||
|
@ -26,51 +27,47 @@ if(isset($_POST["user_name"]) && isset($_POST["user_password"]))
|
|||
Header("Location: .");
|
||||
exit();
|
||||
}
|
||||
$failed = true;
|
||||
}
|
||||
|
||||
/* Site stats */
|
||||
$users = fof_db_get_value("SELECT COUNT(*) FROM fof_user");
|
||||
$feeds = fof_db_get_value("SELECT COUNT(*) FROM fof_feed");
|
||||
$items = fof_db_get_value("SELECT COUNT(*) FROM fof_item");
|
||||
|
||||
$topreaders = false;
|
||||
if ($fof_prefs_obj && ($days = intval($fof_prefs_obj->admin_prefs['topreaders_days'])) && ($count = intval($fof_prefs_obj->admin_prefs['topreaders_count'])))
|
||||
{
|
||||
$topreaders = fof_db_get_top_readers($days, $count);
|
||||
else
|
||||
{
|
||||
$failed = true;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<title>Feed on Feeds - Log on</title>
|
||||
<style>
|
||||
body { font-family: georgia; font-size: 16px; text-align: center; }
|
||||
div { background: #eee; border: 1px solid black; width: 20em; margin: 5em auto 2em; padding: 1.5em; }
|
||||
form { margin: 0 0 0 -3px; }
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<head>
|
||||
<title>Feed on Feeds - Log on</title>
|
||||
|
||||
<style>
|
||||
body
|
||||
{
|
||||
font-family: georgia;
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
div
|
||||
{
|
||||
background: #eee;
|
||||
border: 1px solid black;
|
||||
width: 20em;
|
||||
margin: 5em auto;
|
||||
padding: 1.5em;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div>
|
||||
<form action="login.php" method="POST">
|
||||
<form action="login.php" method="POST" style="display: inline">
|
||||
<center><a href="http://feedonfeeds.com/" style="font-size: 20px; font-family: georgia;">Feed on Feeds</a></center><br>
|
||||
User name:<br><input class="editbox" type='string' name='user_name' style='font-size: 16px; width: 20em'><br><br>
|
||||
Password:<br><input class="editbox" type='password' name='user_password' style='font-size: 16px; width: 20em'><br><br>
|
||||
<p style="text-align: right; margin: 0"><input type="submit" value="Log on!" style='font-size: 16px'></p>
|
||||
<?php if($failed) echo '<br><center><font color="red"><b>Incorrect user name or password</b></font></center>'; ?>
|
||||
<center style="padding: 20px 0 0 0; font-size: 75%"><?= "As of ".date("Y-m-d").", $users our users subscribed to $feeds unique feeds with $items items." ?></center>
|
||||
User name:<br><input type=string name=user_name style='font-size: 16px'><br><br>
|
||||
Password:<br><input type=password name=user_password style='font-size: 16px'><br><br>
|
||||
<input type=submit value="Log on!" style='font-size: 16px; float: right;'><br>
|
||||
<?php if($failed) echo "<br><center><font color=red><b>Incorrect user name or password</b></font></center>"; ?>
|
||||
</form>
|
||||
</div>
|
||||
<?php if($topreaders) { ?>
|
||||
<p><?=$days > 1 ? "Last $days days" : "Today's"?> top readers:<br />
|
||||
<?php foreach($topreaders as $t) { ?>
|
||||
<b><?=htmlspecialchars($t['user_name'])?></b>: <?=$t['posts']?> posts read<br />
|
||||
<?php } ?>
|
||||
</p>
|
||||
<?php } ?>
|
||||
</body>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
<?php
|
||||
$fof_no_login = 1;
|
||||
require("fof-main.php");
|
||||
|
||||
if(isset($_COOKIE["user_name"]) && isset($_COOKIE["user_password_hash"]))
|
||||
{
|
||||
$user_name = $_COOKIE["user_name"];
|
||||
$user_password_hash = $_COOKIE["user_password_hash"];
|
||||
|
||||
if(fof_authenticate($user_name, $user_password_hash))
|
||||
{
|
||||
$unread = fof_get_unread_count(fof_current_user());
|
||||
}
|
||||
}
|
||||
|
||||
echo "Feed on Feeds";
|
||||
if($unread) echo " ($unread)";
|
||||
?>
|
||||
|
|
@ -0,0 +1,187 @@
|
|||
<?php
|
||||
/*
|
||||
* This file is part of FEED ON FEEDS - http://feedonfeeds.com/
|
||||
*
|
||||
* shared.php - display shared items for a user
|
||||
*
|
||||
*
|
||||
* Copyright (C) 2004-2007 Stephen Minutillo
|
||||
* steve@minutillo.com - http://minutillo.com/steve/
|
||||
*
|
||||
* Distributed under the GPL - see LICENSE
|
||||
*
|
||||
*/
|
||||
|
||||
include_once("fof-main.php");
|
||||
include_once("fof-render.php");
|
||||
|
||||
$result = fof_get_items($fof_user_id, NULL, "unread", NULL, 0, 10);
|
||||
|
||||
header("Content-Type: text/html; charset=utf-8");
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<title>Feed on Feeds</title>
|
||||
<meta name = "viewport" content = "width=700">
|
||||
|
||||
<link rel="stylesheet" href="fof.css" media="screen" />
|
||||
<style>
|
||||
.box
|
||||
{
|
||||
font-family: georgia;
|
||||
background: #eee;
|
||||
border: 1px solid black;
|
||||
width: 30em;
|
||||
margin: 10px auto 20px;
|
||||
padding: 1em;
|
||||
text-align: center;
|
||||
}
|
||||
</style>
|
||||
|
||||
<script src="prototype/prototype.js" type="text/javascript"></script>
|
||||
|
||||
<script src="fof.js" type="text/javascript"></script>
|
||||
|
||||
<script>
|
||||
function toggle_favorite(id)
|
||||
{
|
||||
var image = $('fav' + id);
|
||||
|
||||
var url = "add-tag.php?tag=star";
|
||||
var params = "&item=" + id;
|
||||
image.src = 'image/star-pending.gif';
|
||||
|
||||
if(image.star)
|
||||
{
|
||||
params += "&remove=true";
|
||||
var complete = function()
|
||||
{
|
||||
image.src='image/star-off.gif';
|
||||
image.star = false;
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
var complete = function()
|
||||
{
|
||||
image.src='image/star-on.gif';
|
||||
image.star = true;
|
||||
};
|
||||
}
|
||||
|
||||
var options = { method: 'get', parameters: params, onComplete: complete };
|
||||
new Ajax.Request(url, options);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
function newWindowIfy()
|
||||
{
|
||||
a=document.getElementsByTagName('a');
|
||||
|
||||
for(var i=0,j=a.length;i<j;i++){a[i].setAttribute('target','_blank')};
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body onload="newWindowIfy()">
|
||||
<form id="itemform" name="items" action="view-action.php" method="post" onSubmit="return false;">
|
||||
<input type="hidden" name="action" value="read" />
|
||||
<input type="hidden" name="return" />
|
||||
|
||||
<div id="items">
|
||||
|
||||
<?php
|
||||
|
||||
$first = true;
|
||||
|
||||
foreach($result as $item)
|
||||
{
|
||||
$item_id = $item['item_id'];
|
||||
print '<div class="item shown" id="i' . $item_id . '">';
|
||||
|
||||
$feed_link = $item['feed_link'];
|
||||
$feed_title = $item['feed_title'];
|
||||
$feed_image = $item['feed_image'];
|
||||
$feed_description = $item['feed_description'];
|
||||
|
||||
$item_link = $item['item_link'];
|
||||
$item_id = $item['item_id'];
|
||||
$item_title = $item['item_title'];
|
||||
$item_content = $item['item_content'];
|
||||
$item_read = $item['item_read'];
|
||||
|
||||
$item_published = gmdate("Y-n-d g:ia", $item['item_published'] + $offset*60*60);
|
||||
$item_cached = gmdate("Y-n-d g:ia", $item['item_cached'] + $offset*60*60);
|
||||
$item_updated = gmdate("Y-n-d g:ia", $item['item_updated'] + $offset*60*60);
|
||||
|
||||
if(!$item_title) $item_title = "[no title]";
|
||||
$tags = $item['tags'];
|
||||
$star = in_array("star", $tags) ? true : false;
|
||||
$star_image = $star ? "image/star-on.gif" : "image/star-off.gif";
|
||||
|
||||
?>
|
||||
|
||||
<div class="header">
|
||||
|
||||
<h1>
|
||||
<img
|
||||
height="16"
|
||||
width="16"
|
||||
src="<?php echo $star_image ?>"
|
||||
id="fav<?php echo $item_id ?>"
|
||||
onclick="return toggle_favorite('<?php echo $item_id ?>')"
|
||||
/>
|
||||
<script>
|
||||
document.getElementById('fav<?php echo $item_id ?>').star = <?php if($star) echo 'true'; else echo 'false'; ?>;
|
||||
</script>
|
||||
<a href="<?php echo $item_link ?>">
|
||||
<?php echo $item_title ?>
|
||||
</a>
|
||||
</h1>
|
||||
|
||||
|
||||
<span class='dash'> - </span>
|
||||
|
||||
<h2>
|
||||
|
||||
<a href="<?php echo $feed_link ?>" title='<?php echo $feed_description ?>'><img src="<?php echo $feed_image ?>" height="16" width="16" border="0" /></a>
|
||||
<a href="<?php echo $feed_link ?>" title='<?php echo $feed_description ?>'><?php echo $feed_title ?></a>
|
||||
|
||||
</h2>
|
||||
|
||||
<span class="meta">on <?php echo $item_published ?> GMT</span>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="body"><?php echo $item_content ?></div>
|
||||
|
||||
<div class="clearer"></div>
|
||||
</div>
|
||||
<input
|
||||
type="hidden"
|
||||
name="c<?php echo $item_id ?>"
|
||||
id="c<?php echo $item_id ?>"
|
||||
value="checked"
|
||||
/>
|
||||
|
||||
<?php
|
||||
}
|
||||
|
||||
if(count($result) == 0)
|
||||
{
|
||||
echo "<p><i>No new items.</i></p>";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<center><a href='#' onclick='mark_read(); return false;'><b>Mark All Read</b></a></center>";
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
</div>
|
||||
</form></body></html>
|
||||
|
25
opml.php
|
@ -20,7 +20,7 @@ echo '<?xml version="1.0"?>';
|
|||
|
||||
<opml version="1.1">
|
||||
<head>
|
||||
<title>Feed on Feeds Subscriptions</title>
|
||||
<title>Feed on Feeds Subscriptions</title>
|
||||
</head>
|
||||
<body>
|
||||
<?php
|
||||
|
@ -28,20 +28,21 @@ $result = fof_db_get_subscriptions(fof_current_user());
|
|||
|
||||
while($row = fof_db_get_row($result))
|
||||
{
|
||||
$url = htmlspecialchars($row['feed_url']);
|
||||
$row['prefs'] = unserialize($row['subscription_prefs']);
|
||||
$title = htmlspecialchars(fof_feed_title($row));
|
||||
$link = htmlspecialchars($row['feed_link']);
|
||||
$url = htmlspecialchars($row['feed_url']);
|
||||
$title = htmlspecialchars($row['feed_title']);
|
||||
$link = htmlspecialchars($row['feed_link']);
|
||||
|
||||
echo <<<HEYO
|
||||
<outline type="rss"
|
||||
text="$title"
|
||||
title="$title"
|
||||
htmlUrl="$link"
|
||||
xmlUrl="$url"
|
||||
/>
|
||||
|
||||
echo <<<HEYO
|
||||
<outline type="rss"
|
||||
text="$title"
|
||||
title="$title"
|
||||
htmlUrl="$link"
|
||||
xmlUrl="$url"
|
||||
/>
|
||||
HEYO;
|
||||
}
|
||||
?>
|
||||
</body>
|
||||
</opml>
|
||||
|
||||
|
|
|
@ -41,7 +41,7 @@ function fof_balancetags($text) {
|
|||
// clear the shifter
|
||||
$tagqueue = '';
|
||||
// Pop or Push
|
||||
if ($regex[1] && $regex[1][0] == "/") { // End Tag
|
||||
if ($regex[1][0] == "/") { // End Tag
|
||||
$tag = strtolower(substr($regex[1],1));
|
||||
// if too many closing tags
|
||||
if($stacksize <= 0) {
|
||||
|
|
|
@ -1,10 +1,9 @@
|
|||
<?php
|
||||
<?php
|
||||
|
||||
fof_add_item_prefilter('fof_enclosures');
|
||||
|
||||
function fof_enclosures($item, $link, $title, $content)
|
||||
{
|
||||
$html = '';
|
||||
if ($enclosure = $item->get_enclosure(0))
|
||||
{
|
||||
$html = '<br><br><a href="#" onclick="show_enclosure(event); return false;">show enclosure</a><div style="display: none" align="center" width="auto">';
|
||||
|
@ -14,14 +13,17 @@ function fof_enclosures($item, $link, $title, $content)
|
|||
'mediaplayer' => 'plugins/mediaplayer.swf',
|
||||
'alt' => '<img src="plugins/mini_podcast.png" class="download" border="0" title="Download the Podcast (' . $enclosure->get_extension() . '; ' . $enclosure->get_size() . ' MB)" />',
|
||||
'altclass' => 'download'
|
||||
)) . '</p>';
|
||||
)) . '</p>';
|
||||
$html .= '<i align="center">(' . $enclosure->get_type();
|
||||
if ($enclosure->get_size())
|
||||
{
|
||||
$html .= '; ' . $enclosure->get_size() . ' MB';
|
||||
}
|
||||
$html .= ')</i>';
|
||||
if ($enclosure->get_size())
|
||||
{
|
||||
$html .= '; ' . $enclosure->get_size() . ' MB';
|
||||
|
||||
}
|
||||
$html .= ')</i>';
|
||||
$html .= '</div>';
|
||||
}
|
||||
return array($link, $title, $content . $html);
|
||||
|
||||
return array($link, $title, $content . $html);
|
||||
}
|
||||
?>
|
||||
|
|
354
prefs.php
|
@ -14,152 +14,109 @@
|
|||
|
||||
include_once("fof-main.php");
|
||||
|
||||
$prefs = FoF_Prefs::instance();
|
||||
$prefs =& FoF_Prefs::instance();
|
||||
|
||||
if (fof_is_admin() && isset($_POST['adminprefs']))
|
||||
if(fof_is_admin() && isset($_POST['adminprefs']))
|
||||
{
|
||||
$prefs->set('purge', $_POST['purge']);
|
||||
$prefs->set('manualtimeout', $_POST['manualtimeout']);
|
||||
$prefs->set('autotimeout', $_POST['autotimeout']);
|
||||
$prefs->set('logging', !empty($_POST['logging']));
|
||||
$prefs->set('suggestadd', intval($_POST['suggestadd']));
|
||||
$prefs->set('topreaders_days', intval($_POST['topreaders_days']));
|
||||
$prefs->set('topreaders_count', intval($_POST['topreaders_count']));
|
||||
|
||||
$prefs->save();
|
||||
|
||||
$message[] = 'Saved admin prefs.';
|
||||
$prefs->set('purge', $_POST['purge']);
|
||||
$prefs->set('manualtimeout', $_POST['manualtimeout']);
|
||||
$prefs->set('autotimeout', $_POST['autotimeout']);
|
||||
$prefs->set('logging', $_POST['logging']);
|
||||
|
||||
$prefs->save();
|
||||
|
||||
$message .= ' Saved admin prefs.';
|
||||
|
||||
if($prefs->get('logging') && !@fopen("fof.log", 'a'))
|
||||
{
|
||||
$message[] = 'Warning: could not write to log file!';
|
||||
$message .= ' Warning: could not write to log file!';
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($_REQUEST['tagfeeds']))
|
||||
if(isset($_POST['tagfeed']))
|
||||
{
|
||||
$allow_prop = array('untag' => 1, 'tag' => 1, 'filter' => 1, 'title' => 1, 'hide' => 1, 'orighide' => 1);
|
||||
foreach ($_REQUEST as $k => $v)
|
||||
$tags = $_POST['tag'];
|
||||
$feed_id = $_POST['feed_id'];
|
||||
$title = $_POST['title'];
|
||||
|
||||
foreach(explode(" ", $tags) as $tag)
|
||||
{
|
||||
$prop = explode('_', $k);
|
||||
if (count($prop) < 2)
|
||||
continue;
|
||||
list($prop, $feed_id) = $prop;
|
||||
if (empty($allow_prop[$prop]))
|
||||
continue;
|
||||
if (!($feed = fof_db_get_feed_by_id($feed_id)))
|
||||
continue;
|
||||
// remove tags
|
||||
if ($prop == 'untag')
|
||||
{
|
||||
foreach ($v as $tag)
|
||||
{
|
||||
fof_untag_feed(fof_current_user(), $feed_id, $tag);
|
||||
$message[] = 'Dropped \''.$tag.'\' from \''.htmlspecialchars($_REQUEST["title_$feed_id"]).'\'';
|
||||
}
|
||||
}
|
||||
// add tags
|
||||
elseif ($prop == 'tag')
|
||||
{
|
||||
foreach (preg_split("/[\s,]*,[\s,]*/", $v) as $tag)
|
||||
{
|
||||
if ($tag)
|
||||
{
|
||||
fof_tag_feed(fof_current_user(), $feed_id, $tag);
|
||||
$message[] = 'Tagged \''.htmlspecialchars($_REQUEST["title_$feed_id"]).'\' as '.htmlspecialchars($tag);
|
||||
}
|
||||
}
|
||||
}
|
||||
// change filter
|
||||
elseif ($prop == 'filter')
|
||||
{
|
||||
if (fof_db_set_feedprop(fof_current_user(), $feed_id, 'filter', $v))
|
||||
$message[] = 'Set filter \''.htmlspecialchars($v).'\' for feed \''.htmlspecialchars($_REQUEST["title_$feed_id"]).'\'';
|
||||
}
|
||||
// rename feed
|
||||
else if ($prop == 'title' && $v != $_POST['origtitle_'.$feed_id])
|
||||
{
|
||||
if ($feed['feed_title'] == $v)
|
||||
$v = '';
|
||||
if (fof_db_set_feedprop(fof_current_user(), $feed_id, 'feed_title', $v))
|
||||
{
|
||||
if ($v)
|
||||
$message[] = 'Renamed feed \''.htmlspecialchars($feed['feed_title']).'\' to \''.htmlspecialchars($v).'\'';
|
||||
else
|
||||
$message[] = 'Feed title resetted for \''.htmlspecialchars($feed['feed_title']).'\'';
|
||||
}
|
||||
}
|
||||
// show item content by default
|
||||
else if ($prop == 'hide' && $v && empty($_POST['orighide_'.$feed_id]))
|
||||
{
|
||||
if (fof_db_set_feedprop(fof_current_user(), $feed_id, 'hide_content', true))
|
||||
$message[] = 'Items of feed \''.htmlspecialchars($_REQUEST["title_$feed_id"]).'\' will be shown collapsed by default';
|
||||
}
|
||||
// hide item content by default
|
||||
else if ($prop == 'orighide' && $v && empty($_POST['hide_'.$feed_id]))
|
||||
{
|
||||
if (fof_db_set_feedprop(fof_current_user(), $feed_id, 'hide_content', false))
|
||||
$message[] = 'Items of feed \''.htmlspecialchars($_REQUEST["title_$feed_id"]).'\' will be shown expanded by default';
|
||||
}
|
||||
fof_tag_feed(fof_current_user(), $feed_id, $tag);
|
||||
$message .= " Tagged '$title' as $tag.";
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty($message))
|
||||
$message = join('<br>', $message);
|
||||
if(isset($_GET['untagfeed']))
|
||||
{
|
||||
$feed_id = $_GET['untagfeed'];
|
||||
$tags = $_GET['tag'];
|
||||
$title = $_GET['title'];
|
||||
|
||||
foreach(explode(" ", $tags) as $tag)
|
||||
{
|
||||
fof_untag_feed(fof_current_user(), $feed_id, $tag);
|
||||
$message .= " Dropped $tag from '$title'.";
|
||||
}
|
||||
}
|
||||
|
||||
if(isset($_POST['prefs']))
|
||||
{
|
||||
$prefs->set('favicons', isset($_POST['favicons']));
|
||||
$prefs->set('keyboard', isset($_POST['keyboard']));
|
||||
$prefs->set('tzoffset', intval($_POST['tzoffset']));
|
||||
$prefs->set('dst', isset($_POST['dst']));
|
||||
$prefs->set('howmany', intval($_POST['howmany']));
|
||||
$prefs->set('order', $_POST['order']);
|
||||
$prefs->set('sharing', $_POST['sharing']);
|
||||
$prefs->set('sharedname', $_POST['sharedname']);
|
||||
$prefs->set('sharedurl', $_POST['sharedurl']);
|
||||
|
||||
$prefs->save(fof_current_user());
|
||||
$prefs->set('favicons', isset($_POST['favicons']));
|
||||
$prefs->set('keyboard', isset($_POST['keyboard']));
|
||||
$prefs->set('tzoffset', intval($_POST['tzoffset']));
|
||||
$prefs->set('howmany', intval($_POST['howmany']));
|
||||
$prefs->set('order', $_POST['order']);
|
||||
$prefs->set('sharing', $_POST['sharing']);
|
||||
$prefs->set('sharedname', $_POST['sharedname']);
|
||||
$prefs->set('sharedurl', $_POST['sharedurl']);
|
||||
|
||||
$prefs->save(fof_current_user());
|
||||
|
||||
if($_POST['password'] && ($_POST['password'] == $_POST['password2']))
|
||||
{
|
||||
fof_db_change_password($fof_user_name, $_POST['password']);
|
||||
setcookie ("user_password_hash", md5($_POST['password'] . $fof_user_name), time()+60*60*24*365*10);
|
||||
setcookie ( "user_password_hash", md5($_POST['password'] . $fof_user_name), time()+60*60*24*365*10 );
|
||||
$message = "Updated password.";
|
||||
}
|
||||
else if($_POST['password'] || $_POST['password2'])
|
||||
{
|
||||
$message = "Passwords do not match!";
|
||||
}
|
||||
|
||||
$message .= ' Saved prefs.';
|
||||
|
||||
$message .= ' Saved prefs.';
|
||||
}
|
||||
|
||||
if(isset($_POST['plugins']))
|
||||
{
|
||||
foreach(fof_get_plugin_prefs() as $plugin_pref)
|
||||
{
|
||||
$key = $plugin_pref[1];
|
||||
$key = $plugin_pref[1];
|
||||
$prefs->set($key, $_POST[$key]);
|
||||
}
|
||||
|
||||
|
||||
$plugins = array();
|
||||
$dirlist = opendir(FOF_DIR . "/plugins");
|
||||
while($file=readdir($dirlist))
|
||||
if(substr($file, -4) == '.php')
|
||||
$plugins[] = substr($file, 0, -4);
|
||||
{
|
||||
if(ereg('\.php$',$file))
|
||||
{
|
||||
$plugins[] = substr($file, 0, -4);
|
||||
}
|
||||
}
|
||||
|
||||
closedir();
|
||||
|
||||
|
||||
foreach($plugins as $plugin)
|
||||
{
|
||||
$prefs->set("plugin_" . $plugin, $_POST[$plugin] != "on");
|
||||
}
|
||||
|
||||
$prefs->save(fof_current_user());
|
||||
$prefs->save(fof_current_user());
|
||||
|
||||
$message .= ' Saved plugin prefs.';
|
||||
$message .= ' Saved plugin prefs.';
|
||||
}
|
||||
|
||||
if(isset($_POST['changepassword']))
|
||||
if(isset($_POST['changepassword']))
|
||||
{
|
||||
if($_POST['password'] != $_POST['password2'])
|
||||
{
|
||||
|
@ -170,26 +127,27 @@ if(isset($_POST['changepassword']))
|
|||
$username = $_POST['username'];
|
||||
$password = $_POST['password'];
|
||||
fof_db_change_password($username, $password);
|
||||
|
||||
|
||||
$message = "Changed password for $username.";
|
||||
}
|
||||
}
|
||||
|
||||
if(fof_is_admin() && isset($_POST['adduser']) && $_POST['username'] && $_POST['password'])
|
||||
if(fof_is_admin() && isset($_POST['adduser']) && $_POST['username'] && $_POST['password'])
|
||||
{
|
||||
$username = $_POST['username'];
|
||||
$password = $_POST['password'];
|
||||
|
||||
fof_db_add_user($username, $password);
|
||||
$message = "User '$username' added.";
|
||||
fof_db_add_user($username, $password);
|
||||
$message = "User '$username' added.";
|
||||
}
|
||||
|
||||
|
||||
if(fof_is_admin() && isset($_POST['deleteuser']) && $_POST['username'])
|
||||
{
|
||||
$username = $_POST['username'];
|
||||
|
||||
fof_db_delete_user($username);
|
||||
$message = "User '$username' deleted.";
|
||||
$username = $_POST['username'];
|
||||
|
||||
fof_db_delete_user($username);
|
||||
$message = "User '$username' deleted.";
|
||||
}
|
||||
|
||||
include("header.php");
|
||||
|
@ -206,19 +164,18 @@ include("header.php");
|
|||
<form method="post" action="prefs.php" style="border: 1px solid black; margin: 10px; padding: 10px;">
|
||||
Default display order: <select name="order"><option value=desc>new to old</option><option value=asc <?php if($prefs->get('order') == "asc") echo "selected";?>>old to new</option></select><br><br>
|
||||
Number of items in paged displays: <input type="string" name="howmany" value="<?php echo $prefs->get('howmany') ?>"><br><br>
|
||||
Display custom feed favicons? <input type="checkbox" name="favicons" <?php if($prefs->get('favicons')) echo "checked=true"; ?> ><br><br>
|
||||
Display custom feed favicons? <input type="checkbox" name="favicons" <?php if($prefs->get('favicons')) echo "checked=true";?> ><br><br>
|
||||
Use keyboard shortcuts? <input type="checkbox" name="keyboard" <?php if($prefs->get('keyboard')) echo "checked=true";?> ><br><br>
|
||||
Time offset in hours: <input size=3 type=string name=tzoffset value="<?php echo $prefs->get('tzoffset')?>"> <input type="checkbox" name="dst" <?php if($prefs->get('dst')) echo "checked=true";?> /> use <a href="http://en.wikipedia.org/wiki/Daylight_saving_time">DST</a> (UTC time: <?php echo gmdate("Y-n-d g:ia") ?>, local time: <?php echo gmdate("Y-n-d g:ia", time() + ($prefs->get("tzoffset") + ($prefs->get('dst') ? date('I') : 0))*60*60) ?>)<br><br>
|
||||
Time offset in hours: <input size=3 type=string name=tzoffset value="<?php echo $prefs->get('tzoffset')?>"> (UTC time: <?php echo gmdate("Y-n-d g:ia") ?>, local time: <?php echo gmdate("Y-n-d g:ia", time() + $prefs->get("tzoffset")*60*60) ?>)<br><br>
|
||||
<table border=0 cellspacing=0 cellpadding=2><tr><td>New password:</td><td><input type=password name=password> (leave blank to not change)</td></tr>
|
||||
<tr><td>Repeat new password:</td><td><input type=password name=password2></td></tr></table>
|
||||
<br>
|
||||
|
||||
Share
|
||||
Share
|
||||
<select name="sharing">
|
||||
<option value=no>no</option>
|
||||
<option value=all <?php if($prefs->get('sharing') == "all") echo "selected";?>>all</option>
|
||||
<option value=shared <?php if($prefs->get('sharing') == "shared") echo "selected";?>>tagged as "shared"</option>
|
||||
<option value=star <?php if($prefs->get('sharing') == "star") echo "selected";?>>starred</option>
|
||||
<option value=tagged <?php if($prefs->get('sharing') == "tagged") echo "selected";?>>tagged as "shared"</option>
|
||||
</select>
|
||||
items.
|
||||
<?php if($prefs->get('sharing') != "no") echo " <small><i>(your shared page is <a href='./shared.php?user=$fof_user_id'>here</a>)</i></small>";?><br><br>
|
||||
|
@ -235,22 +192,26 @@ URL to be linked on shared page: <input type=string name=sharedurl value="<?php
|
|||
<?php
|
||||
$plugins = array();
|
||||
$dirlist = opendir(FOF_DIR . "/plugins");
|
||||
while($file = readdir($dirlist))
|
||||
while($file=readdir($dirlist))
|
||||
{
|
||||
fof_log("considering " . $file);
|
||||
if(substr($file, -4) === '.php' && is_readable(FOF_DIR . "/plugins/" . $file))
|
||||
$plugins[] = substr($file, 0, -4);
|
||||
fof_log("considering " . $file);
|
||||
if(ereg('\.php$',$file))
|
||||
{
|
||||
$plugins[] = substr($file, 0, -4);
|
||||
}
|
||||
}
|
||||
|
||||
closedir();
|
||||
|
||||
?>
|
||||
|
||||
<?php foreach($plugins as $plugin) { ?>
|
||||
<input type="checkbox" name="<?php echo $plugin ?>" <?php if(!$prefs->get("plugin_" . $plugin)) echo "checked"; ?>> Enable plugin <tt><?php echo $plugin?></tt>?<br>
|
||||
<input type=checkbox name=<?php echo $plugin ?> <?php if(!$prefs->get("plugin_" . $plugin)) echo "checked"; ?>> Enable plugin <tt><?php echo $plugin?></tt>?<br>
|
||||
<?php } ?>
|
||||
|
||||
<br>
|
||||
<?php foreach(fof_get_plugin_prefs() as $plugin_pref) { $name = $plugin_pref[0]; $key = $plugin_pref[1]; $type = $plugin_pref[2]; ?>
|
||||
<?php echo $name ?>:
|
||||
<?php echo $name ?>:
|
||||
|
||||
<?php if($type == "boolean") { ?>
|
||||
<input name="<?php echo $key ?>" type="checkbox" <?php if($prefs->get($key)) echo "checked" ?>><br>
|
||||
|
@ -258,93 +219,85 @@ URL to be linked on shared page: <input type=string name=sharedurl value="<?php
|
|||
<input name="<?php echo $key ?>" value="<?php echo $prefs->get($key)?>"><br>
|
||||
<?php } } ?>
|
||||
<br>
|
||||
<input type="submit" name="plugins" value="Save Plugin Preferences">
|
||||
<input type=submit name=plugins value="Save Plugin Preferences">
|
||||
</form>
|
||||
|
||||
<br><h1>Feed on Feeds - Feeds, Tags and Filters</h1>
|
||||
<p style="font-size: 90%"><font color=red>*</font> Check 'Hide' if you want to hide contents of items of the corresponding feed by default.<br />
|
||||
Click 'Filter' and enter a regular expression to filter out items matching it directly into "already read" state.<br />
|
||||
Don't forget to Save preferences after making changes :-)</p>
|
||||
|
||||
|
||||
<br><h1>Feed on Feeds - Feeds and Tags</h1>
|
||||
<div style="border: 1px solid black; margin: 10px; padding: 10px; font-size: 12px; font-family: verdana, arial;">
|
||||
<form method="post" action="?tagfeeds=1">
|
||||
<table cellpadding="3" cellspacing="0" class="feedprefs">
|
||||
<tr valign="top">
|
||||
<th colspan="2" align="left">Feed</th>
|
||||
<th>Remove tags</th>
|
||||
<th>Add tags<br><small style='font-weight: normal'>(separate with ,)</small></th>
|
||||
<th>Preferences</th>
|
||||
</tr>
|
||||
<table cellpadding=3 cellspacing=0>
|
||||
<?php
|
||||
foreach($feeds as $row)
|
||||
{
|
||||
$id = $row['feed_id'];
|
||||
$url = $row['feed_url'];
|
||||
$title = fof_feed_title($row);
|
||||
$link = $row['feed_link'];
|
||||
$description = $row['feed_description'];
|
||||
$age = $row['feed_age'];
|
||||
$unread = $row['feed_unread'];
|
||||
$starred = $row['feed_starred'];
|
||||
$items = $row['feed_items'];
|
||||
$agestr = $row['agestr'];
|
||||
$agestrabbr = $row['agestrabbr'];
|
||||
$lateststr = $row['lateststr'];
|
||||
$lateststrabbr = $row['lateststrabbr'];
|
||||
$tags = $row['tags'];
|
||||
$id = $row['feed_id'];
|
||||
$url = $row['feed_url'];
|
||||
$title = $row['feed_title'];
|
||||
$link = $row['feed_link'];
|
||||
$description = $row['feed_description'];
|
||||
$age = $row['feed_age'];
|
||||
$unread = $row['feed_unread'];
|
||||
$starred = $row['feed_starred'];
|
||||
$items = $row['feed_items'];
|
||||
$agestr = $row['agestr'];
|
||||
$agestrabbr = $row['agestrabbr'];
|
||||
$lateststr = $row['lateststr'];
|
||||
$lateststrabbr = $row['lateststrabbr'];
|
||||
$tags = $row['tags'];
|
||||
|
||||
if(++$t % 2)
|
||||
{
|
||||
print "<tr class=\"odd-row\">";
|
||||
}
|
||||
else
|
||||
{
|
||||
print "<tr>";
|
||||
}
|
||||
|
||||
if(++$t % 2)
|
||||
print '<tr class="odd-row">';
|
||||
else
|
||||
print '<tr>';
|
||||
|
||||
if($row['feed_image'] && $prefs->get('favicons')) { ?>
|
||||
<td><a href="<?=$url?>" title="<?=htmlspecialchars($row['feed_title'])?>"><img src='<?=$row['feed_image']?>' width='16' height='16' border='0' /></a></td>
|
||||
<?php } else { ?>
|
||||
<td><a href="<?=$url?>" title="<?=htmlspecialchars($row['feed_title'])?>"><img src='image/feed-icon.png' width='16' height='16' border='0' /></a></td>
|
||||
<?php } ?>
|
||||
|
||||
<td><input type="hidden" name="origtitle_<?=$id?>" value="<?=htmlspecialchars($title)?>" /><input class="editbox" type="text" name="title_<?=$id?>" value="<?=htmlspecialchars($title)?>" size="50" /> <a href="<?=$link?>" title="home page"><img src="image/external.png" alt=" " width="10" height="10" /></a</td>
|
||||
<td align=right>
|
||||
|
||||
<?php
|
||||
if($tags)
|
||||
{
|
||||
$i = 0;
|
||||
foreach($tags as $tag)
|
||||
{
|
||||
$utag = htmlspecialchars($tag);
|
||||
print "<span id='t{$id}_{$i}'>$tag</span> <input onclick='document.getElementById(\"t{$id}_{$i}\").style.textDecoration=this.checked ? \"line-through\" : \"\"' type='checkbox' name='untag_{$id}[]' value='$utag'>";
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
$flt = isset($row['prefs']['filter']) ? htmlspecialchars($row['prefs']['filter']) : '';
|
||||
?>
|
||||
</td>
|
||||
<td><input class="editbox" type="text" name="tag_<?=$id?>" /></td>
|
||||
<td>
|
||||
<input type="hidden" name="orighide_<?=$id?>" value="<?=!empty($row['prefs']['hide_content']) ? 1 : 0?>" />
|
||||
<input type="checkbox" value="1" name="hide_<?=$id?>" title="Hide item content by default" <?= !empty($row['prefs']['hide_content']) ? "checked" : ""?> /><label for="hide_<?=$id?>" title="Hide item content by default">Hide</label> |
|
||||
<span id="fspan<?=$id?>" style="display:none">Filter: <input class="editbox" type="text" name="filter_<?=$id?>" value="<?=$flt?>" /></span>
|
||||
<span id="ftspan<?=$id?>"><a id="fa<?=$id?>" href="javascript:show_filter('<?=$id?>')">Filter</a><?=$flt ? ": $flt" : ""?></span>
|
||||
</td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
if($row['feed_image'] && $prefs->get('favicons'))
|
||||
{
|
||||
print "<td><a href=\"$url\" title=\"feed\"><img src='" . $row['feed_image'] . "' width='16' height='16' border='0' /></a></td>";
|
||||
}
|
||||
else
|
||||
{
|
||||
print "<td><a href=\"$url\" title=\"feed\"><img src='image/feed-icon.png' width='16' height='16' border='0' /></a></td>";
|
||||
}
|
||||
|
||||
print "<td><a href=\"$link\" title=\"home page\">$title</a></td>";
|
||||
|
||||
print "<td align=right>";
|
||||
|
||||
if($tags)
|
||||
{
|
||||
foreach($tags as $tag)
|
||||
{
|
||||
$utag = urlencode($tag);
|
||||
$utitle = urlencode($title);
|
||||
print "$tag <a href='prefs.php?untagfeed=$id&tag=$utag&title=$utitle'>[x]</a> ";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
}
|
||||
|
||||
print "</td>";
|
||||
$title = htmlspecialchars($title);
|
||||
print "<td><form method=post action=prefs.php><input type=hidden name=title value=\"$title\"><input type=hidden name=feed_id value=$id><input type=string name=tag> <input type=submit name=tagfeed value='Tag Feed'> <small><i>(separate tags with spaces)</i></small></form></td></tr>";
|
||||
}
|
||||
?>
|
||||
</table>
|
||||
<input type="submit" value="Save feed preferences" />
|
||||
</form>
|
||||
</div>
|
||||
|
||||
|
||||
<?php if(fof_is_admin()) { ?>
|
||||
|
||||
<br><h1>Feed on Feeds - Admin Options</h1>
|
||||
<form method="post" action="prefs.php" style="border: 1px solid black; margin: 10px; padding: 10px;">
|
||||
Enable logging? <input type=checkbox name=logging <?php if($prefs->get('logging')) echo "checked" ?> /><br><br>
|
||||
Purge read items after <input size=4 type=string name=purge value="<?php echo $prefs->get('purge')?>" /> days (leave blank to never purge)<br><br>
|
||||
Allow automatic feed updates every <input size=4 type=string name=autotimeout value="<?php echo $prefs->get('autotimeout')?>" /> minutes<br><br>
|
||||
Allow manual feed updates every <input size=4 type=string name=manualtimeout value="<?php echo $prefs->get('manualtimeout')?>" /> minutes<br><br>
|
||||
Show <b>Top <input size=3 type=string name=topreaders_count value="<?=intval($prefs->get('topreaders_count'))?>" /> readers in last <input size=3 type=string name=topreaders_days value="<?=intval($prefs->get('topreaders_days'))?>" /> days</b> statistics on the login page<br><br>
|
||||
Suggest users to subscribe to <input size=3 type=string name=suggestadd value="<?=intval($prefs->get('suggestadd'))?>" /> most popular feeds<br><br>
|
||||
<input type=submit name=adminprefs value="Save Options" />
|
||||
Enable logging? <input type=checkbox name=logging <?php if($prefs->get('logging')) echo "checked" ?>><br><br>
|
||||
Purge read items after <input size=4 type=string name=purge value="<?php echo $prefs->get('purge')?>"> days (leave blank to never purge)<br><br>
|
||||
Allow automatic feed updates every <input size=4 type=string name=autotimeout value="<?php echo $prefs->get('autotimeout')?>"> minutes<br><br>
|
||||
Allow manual feed updates every <input size=4 type=string name=manualtimeout value="<?php echo $prefs->get('manualtimeout')?>"> minutes<br><br>
|
||||
<input type=submit name=adminprefs value="Save Options">
|
||||
</form>
|
||||
|
||||
<br><h1>Add User</h1>
|
||||
|
@ -353,14 +306,13 @@ Username: <input type=string name=username> Password: <input type=string name=pa
|
|||
</form>
|
||||
|
||||
<?php
|
||||
$result = fof_db_query("select user_name from $FOF_USER_TABLE where user_id > 1");
|
||||
|
||||
$delete_options = '';
|
||||
while($row = fof_db_get_row($result))
|
||||
{
|
||||
$username = $row['user_name'];
|
||||
$delete_options .= "<option value=$username>$username</option>";
|
||||
}
|
||||
$result = fof_db_query("select user_name from $FOF_USER_TABLE where user_id > 1");
|
||||
|
||||
while($row = fof_db_get_row($result))
|
||||
{
|
||||
$username = $row['user_name'];
|
||||
$delete_options .= "<option value=$username>$username</option>";
|
||||
}
|
||||
|
||||
if(isset($delete_options))
|
||||
{
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
|
||||
include_once("fof-main.php");
|
||||
|
||||
$prefs = FoF_Prefs::instance();
|
||||
$prefs =& FoF_Prefs::instance();
|
||||
|
||||
foreach($_POST as $k => $v)
|
||||
{
|
||||
|
@ -22,3 +22,5 @@ foreach($_POST as $k => $v)
|
|||
}
|
||||
|
||||
$prefs->save();
|
||||
|
||||
?>
|
||||
|
|
430
sha256.inc
|
@ -1,430 +0,0 @@
|
|||
<?php
|
||||
/*
|
||||
* Transparent SHA-256 Implementation for PHP 4 and PHP 5
|
||||
*
|
||||
* Author: Perry McGee (pmcgee@nanolink.ca)
|
||||
* Website: http://www.nanolink.ca/pub/sha256
|
||||
*
|
||||
* Copyright (C) 2006,2007,2008,2009 Nanolink Solutions
|
||||
*
|
||||
* Created: Feb 11, 2006
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
* or see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* Include:
|
||||
*
|
||||
* require_once("[path/]sha256.inc.php");
|
||||
*
|
||||
* Usage Options:
|
||||
*
|
||||
* 1) $shaStr = hash('sha256', $string_to_hash);
|
||||
*
|
||||
* 2) $shaStr = sha256($string_to_hash[, bool ignore_php5_hash = false]);
|
||||
*
|
||||
* 3) $obj = new nanoSha2([bool $upper_case_output = false]);
|
||||
* $shaStr = $obj->hash($string_to_hash[, bool $ignore_php5_hash = false]);
|
||||
*
|
||||
* Reference: http://csrc.nist.gov/groups/ST/toolkit/secure_hashing.html
|
||||
*
|
||||
* 2007-12-13: Cleaned up for initial public release
|
||||
* 2008-05-10: Moved all helper functions into a class. API access unchanged.
|
||||
* 2009-06-23: Created abstraction of hash() routine
|
||||
* 2009-07-23: Added detection of 32 vs 64bit platform, and patches.
|
||||
* Ability to define "_NANO_SHA2_UPPER" to yeild upper case hashes.
|
||||
* 2009-08-01: Added ability to attempt to use mhash() prior to running pure
|
||||
* php code.
|
||||
*
|
||||
* NOTE: Some sporadic versions of PHP do not handle integer overflows the
|
||||
* same as the majority of builds. If you get hash results of:
|
||||
* 7fffffff7fffffff7fffffff7fffffff7fffffff7fffffff7fffffff7fffffff
|
||||
*
|
||||
* If you do not have permissions to change PHP versions (if you did
|
||||
* you'd probably upgrade to PHP 5 anyway) it is advised you install a
|
||||
* module that will allow you to use their hashing routines, examples are:
|
||||
* - mhash module : http://ca3.php.net/mhash
|
||||
* - Suhosin : http://www.hardened-php.net/suhosin/
|
||||
*
|
||||
* If you install the Suhosin module, this script will transparently
|
||||
* use their routine and define the PHP routine as _nano_sha256().
|
||||
*
|
||||
* If the mhash module is present, and $ignore_php5_hash = false the
|
||||
* script will attempt to use the output from mhash prior to running
|
||||
* the PHP code.
|
||||
*/
|
||||
if (!class_exists('nanoSha2'))
|
||||
{
|
||||
class nanoSha2
|
||||
{
|
||||
// php 4 - 5 compatable class properties
|
||||
var $toUpper;
|
||||
var $platform;
|
||||
|
||||
// Php 4 - 6 compatable constructor
|
||||
function nanoSha2($toUpper = false) {
|
||||
// Determine if the caller wants upper case or not.
|
||||
$this->toUpper = is_bool($toUpper)
|
||||
? $toUpper
|
||||
: ((defined('_NANO_SHA2_UPPER')) ? true : false);
|
||||
|
||||
// Deteremine if the system is 32 or 64 bit.
|
||||
$tmpInt = (int)4294967295;
|
||||
$this->platform = ($tmpInt > 0) ? 64 : 32;
|
||||
}
|
||||
|
||||
// Do the SHA-256 Padding routine (make input a multiple of 512 bits)
|
||||
function char_pad($str)
|
||||
{
|
||||
$tmpStr = $str;
|
||||
|
||||
$l = strlen($tmpStr)*8; // # of bits from input string
|
||||
|
||||
$tmpStr .= "\x80"; // append the "1" bit followed by 7 0's
|
||||
|
||||
$k = (512 - (($l + 8 + 64) % 512)) / 8; // # of 0 bytes to append
|
||||
$k += 4; // PHP Strings will never exceed (2^31)-1, 1st 32bits of
|
||||
// the 64-bit value representing $l can be all 0's
|
||||
|
||||
for ($x = 0; $x < $k; $x++) {
|
||||
$tmpStr .= "\0";
|
||||
}
|
||||
|
||||
// append the 32-bits representing # of bits from input string ($l)
|
||||
$tmpStr .= chr((($l>>24) & 0xFF));
|
||||
$tmpStr .= chr((($l>>16) & 0xFF));
|
||||
$tmpStr .= chr((($l>>8) & 0xFF));
|
||||
$tmpStr .= chr(($l & 0xFF));
|
||||
|
||||
return $tmpStr;
|
||||
}
|
||||
|
||||
// Here are the bitwise and functions as defined in FIPS180-2 Standard
|
||||
function addmod2n($x, $y, $n = 4294967296) // Z = (X + Y) mod 2^32
|
||||
{
|
||||
$mask = 0x80000000;
|
||||
|
||||
if ($x < 0) {
|
||||
$x &= 0x7FFFFFFF;
|
||||
$x = (float)$x + $mask;
|
||||
}
|
||||
|
||||
if ($y < 0) {
|
||||
$y &= 0x7FFFFFFF;
|
||||
$y = (float)$y + $mask;
|
||||
}
|
||||
|
||||
$r = $x + $y;
|
||||
|
||||
if ($r >= $n) {
|
||||
while ($r >= $n) {
|
||||
$r -= $n;
|
||||
}
|
||||
}
|
||||
|
||||
return (int)$r;
|
||||
}
|
||||
|
||||
// Logical bitwise right shift (PHP default is arithmetic shift)
|
||||
function SHR($x, $n) // x >> n
|
||||
{
|
||||
if ($n >= 32) { // impose some limits to keep it 32-bit
|
||||
return (int)0;
|
||||
}
|
||||
|
||||
if ($n <= 0) {
|
||||
return (int)$x;
|
||||
}
|
||||
|
||||
$mask = 0x40000000;
|
||||
|
||||
if ($x < 0) {
|
||||
$x &= 0x7FFFFFFF;
|
||||
$mask = $mask >> ($n-1);
|
||||
return ($x >> $n) | $mask;
|
||||
}
|
||||
|
||||
return (int)$x >> (int)$n;
|
||||
}
|
||||
|
||||
function ROTR($x, $n) { return (int)(($this->SHR($x, $n) | ($x << (32-$n)) & 0xFFFFFFFF)); }
|
||||
function Ch($x, $y, $z) { return ($x & $y) ^ ((~$x) & $z); }
|
||||
function Maj($x, $y, $z) { return ($x & $y) ^ ($x & $z) ^ ($y & $z); }
|
||||
function Sigma0($x) { return (int) ($this->ROTR($x, 2)^$this->ROTR($x, 13)^$this->ROTR($x, 22)); }
|
||||
function Sigma1($x) { return (int) ($this->ROTR($x, 6)^$this->ROTR($x, 11)^$this->ROTR($x, 25)); }
|
||||
function sigma_0($x) { return (int) ($this->ROTR($x, 7)^$this->ROTR($x, 18)^$this->SHR($x, 3)); }
|
||||
function sigma_1($x) { return (int) ($this->ROTR($x, 17)^$this->ROTR($x, 19)^$this->SHR($x, 10)); }
|
||||
|
||||
/*
|
||||
* Custom functions to provide PHP support
|
||||
*/
|
||||
// split a byte-string into integer array values
|
||||
function int_split($input)
|
||||
{
|
||||
$l = strlen($input);
|
||||
|
||||
if ($l <= 0) {
|
||||
return (int)0;
|
||||
}
|
||||
|
||||
if (($l % 4) != 0) { // invalid input
|
||||
return false;
|
||||
}
|
||||
|
||||
for ($i = 0; $i < $l; $i += 4)
|
||||
{
|
||||
$int_build = (ord($input[$i]) << 24);
|
||||
$int_build += (ord($input[$i+1]) << 16);
|
||||
$int_build += (ord($input[$i+2]) << 8);
|
||||
$int_build += (ord($input[$i+3]));
|
||||
|
||||
$result[] = $int_build;
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Process and return the hash.
|
||||
*
|
||||
* @param $str Input string to hash
|
||||
* @param $ig_func Option param to ignore checking for php > 5.1.2
|
||||
* @return string Hexadecimal representation of the message digest
|
||||
*/
|
||||
function hash($str, $ig_func = false)
|
||||
{
|
||||
unset($binStr); // binary representation of input string
|
||||
unset($hexStr); // 256-bit message digest in readable hex format
|
||||
|
||||
// check for php's internal sha256 function, ignore if ig_func==true
|
||||
if ($ig_func == false) {
|
||||
if (version_compare(PHP_VERSION,'5.1.2','>=')) {
|
||||
return hash("sha256", $str, false);
|
||||
} else if (function_exists('mhash') && defined('MHASH_SHA256')) {
|
||||
return base64_encode(bin2hex(mhash(MHASH_SHA256, $str)));
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* SHA-256 Constants
|
||||
* Sequence of sixty-four constant 32-bit words representing the
|
||||
* first thirty-two bits of the fractional parts of the cube roots
|
||||
* of the first sixtyfour prime numbers.
|
||||
*/
|
||||
$K = array((int)0x428a2f98, (int)0x71374491, (int)0xb5c0fbcf,
|
||||
(int)0xe9b5dba5, (int)0x3956c25b, (int)0x59f111f1,
|
||||
(int)0x923f82a4, (int)0xab1c5ed5, (int)0xd807aa98,
|
||||
(int)0x12835b01, (int)0x243185be, (int)0x550c7dc3,
|
||||
(int)0x72be5d74, (int)0x80deb1fe, (int)0x9bdc06a7,
|
||||
(int)0xc19bf174, (int)0xe49b69c1, (int)0xefbe4786,
|
||||
(int)0x0fc19dc6, (int)0x240ca1cc, (int)0x2de92c6f,
|
||||
(int)0x4a7484aa, (int)0x5cb0a9dc, (int)0x76f988da,
|
||||
(int)0x983e5152, (int)0xa831c66d, (int)0xb00327c8,
|
||||
(int)0xbf597fc7, (int)0xc6e00bf3, (int)0xd5a79147,
|
||||
(int)0x06ca6351, (int)0x14292967, (int)0x27b70a85,
|
||||
(int)0x2e1b2138, (int)0x4d2c6dfc, (int)0x53380d13,
|
||||
(int)0x650a7354, (int)0x766a0abb, (int)0x81c2c92e,
|
||||
(int)0x92722c85, (int)0xa2bfe8a1, (int)0xa81a664b,
|
||||
(int)0xc24b8b70, (int)0xc76c51a3, (int)0xd192e819,
|
||||
(int)0xd6990624, (int)0xf40e3585, (int)0x106aa070,
|
||||
(int)0x19a4c116, (int)0x1e376c08, (int)0x2748774c,
|
||||
(int)0x34b0bcb5, (int)0x391c0cb3, (int)0x4ed8aa4a,
|
||||
(int)0x5b9cca4f, (int)0x682e6ff3, (int)0x748f82ee,
|
||||
(int)0x78a5636f, (int)0x84c87814, (int)0x8cc70208,
|
||||
(int)0x90befffa, (int)0xa4506ceb, (int)0xbef9a3f7,
|
||||
(int)0xc67178f2);
|
||||
|
||||
// Pre-processing: Padding the string
|
||||
$binStr = $this->char_pad($str);
|
||||
|
||||
// Parsing the Padded Message (Break into N 512-bit blocks)
|
||||
$M = str_split($binStr, 64);
|
||||
|
||||
// Set the initial hash values
|
||||
$h[0] = (int)0x6a09e667;
|
||||
$h[1] = (int)0xbb67ae85;
|
||||
$h[2] = (int)0x3c6ef372;
|
||||
$h[3] = (int)0xa54ff53a;
|
||||
$h[4] = (int)0x510e527f;
|
||||
$h[5] = (int)0x9b05688c;
|
||||
$h[6] = (int)0x1f83d9ab;
|
||||
$h[7] = (int)0x5be0cd19;
|
||||
|
||||
// loop through message blocks and compute hash. ( For i=1 to N : )
|
||||
for ($i = 0; $i < count($M); $i++)
|
||||
{
|
||||
// Break input block into 16 32bit words (message schedule prep)
|
||||
$MI = $this->int_split($M[$i]);
|
||||
|
||||
// Initialize working variables
|
||||
$_a = (int)$h[0];
|
||||
$_b = (int)$h[1];
|
||||
$_c = (int)$h[2];
|
||||
$_d = (int)$h[3];
|
||||
$_e = (int)$h[4];
|
||||
$_f = (int)$h[5];
|
||||
$_g = (int)$h[6];
|
||||
$_h = (int)$h[7];
|
||||
unset($_s0);
|
||||
unset($_s1);
|
||||
unset($_T1);
|
||||
unset($_T2);
|
||||
$W = array();
|
||||
|
||||
// Compute the hash and update
|
||||
for ($t = 0; $t < 16; $t++)
|
||||
{
|
||||
// Prepare the first 16 message schedule values as we loop
|
||||
$W[$t] = $MI[$t];
|
||||
|
||||
// Compute hash
|
||||
$_T1 = $this->addmod2n($this->addmod2n($this->addmod2n($this->addmod2n($_h, $this->Sigma1($_e)), $this->Ch($_e, $_f, $_g)), $K[$t]), $W[$t]);
|
||||
$_T2 = $this->addmod2n($this->Sigma0($_a), $this->Maj($_a, $_b, $_c));
|
||||
|
||||
// Update working variables
|
||||
$_h = $_g; $_g = $_f; $_f = $_e; $_e = $this->addmod2n($_d, $_T1);
|
||||
$_d = $_c; $_c = $_b; $_b = $_a; $_a = $this->addmod2n($_T1, $_T2);
|
||||
}
|
||||
|
||||
for (; $t < 64; $t++)
|
||||
{
|
||||
// Continue building the message schedule as we loop
|
||||
$_s0 = $W[($t+1)&0x0F];
|
||||
$_s0 = $this->sigma_0($_s0);
|
||||
$_s1 = $W[($t+14)&0x0F];
|
||||
$_s1 = $this->sigma_1($_s1);
|
||||
|
||||
$W[$t&0xF] = $this->addmod2n($this->addmod2n($this->addmod2n($W[$t&0xF], $_s0), $_s1), $W[($t+9)&0x0F]);
|
||||
|
||||
// Compute hash
|
||||
$_T1 = $this->addmod2n($this->addmod2n($this->addmod2n($this->addmod2n($_h, $this->Sigma1($_e)), $this->Ch($_e, $_f, $_g)), $K[$t]), $W[$t&0xF]);
|
||||
$_T2 = $this->addmod2n($this->Sigma0($_a), $this->Maj($_a, $_b, $_c));
|
||||
|
||||
// Update working variables
|
||||
$_h = $_g; $_g = $_f; $_f = $_e; $_e = $this->addmod2n($_d, $_T1);
|
||||
$_d = $_c; $_c = $_b; $_b = $_a; $_a = $this->addmod2n($_T1, $_T2);
|
||||
}
|
||||
|
||||
$h[0] = $this->addmod2n($h[0], $_a);
|
||||
$h[1] = $this->addmod2n($h[1], $_b);
|
||||
$h[2] = $this->addmod2n($h[2], $_c);
|
||||
$h[3] = $this->addmod2n($h[3], $_d);
|
||||
$h[4] = $this->addmod2n($h[4], $_e);
|
||||
$h[5] = $this->addmod2n($h[5], $_f);
|
||||
$h[6] = $this->addmod2n($h[6], $_g);
|
||||
$h[7] = $this->addmod2n($h[7], $_h);
|
||||
}
|
||||
|
||||
// Convert the 32-bit words into human readable hexadecimal format.
|
||||
$hexStr = sprintf("%08x%08x%08x%08x%08x%08x%08x%08x", $h[0], $h[1], $h[2], $h[3], $h[4], $h[5], $h[6], $h[7]);
|
||||
|
||||
return ($this->toUpper) ? strtoupper($hexStr) : $hexStr;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('str_split'))
|
||||
{
|
||||
/**
|
||||
* Splits a string into an array of strings with specified length.
|
||||
* Compatability with older verions of PHP
|
||||
*/
|
||||
function str_split($string, $split_length = 1)
|
||||
{
|
||||
$sign = ($split_length < 0) ? -1 : 1;
|
||||
$strlen = strlen($string);
|
||||
$split_length = abs($split_length);
|
||||
|
||||
if (($split_length == 0) || ($strlen == 0)) {
|
||||
$result = false;
|
||||
} elseif ($split_length >= $strlen) {
|
||||
$result[] = $string;
|
||||
} else {
|
||||
$length = $split_length;
|
||||
|
||||
for ($i = 0; $i < $strlen; $i++)
|
||||
{
|
||||
$i = (($sign < 0) ? $i + $length : $i);
|
||||
$result[] = substr($string, $sign*$i, $length);
|
||||
$i--;
|
||||
$i = (($sign < 0) ? $i : $i + $length);
|
||||
|
||||
$length = (($i + $split_length) > $strlen)
|
||||
? ($strlen - ($i + 1))
|
||||
: $split_length;
|
||||
}
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Main routine called from an application using this include.
|
||||
*
|
||||
* General usage:
|
||||
* require_once('sha256.inc.php');
|
||||
* $hashstr = sha256('abc');
|
||||
*
|
||||
* Note:
|
||||
* PHP Strings are limitd to (2^31)-1, so it is not worth it to
|
||||
* check for input strings > 2^64 as the FIPS180-2 defines.
|
||||
*/
|
||||
// 2009-07-23: Added check for function as the Suhosin plugin adds this routine.
|
||||
if (!function_exists('sha256')) {
|
||||
function sha256($str, $ig_func = false) {
|
||||
$obj = new nanoSha2((defined('_NANO_SHA2_UPPER')) ? true : false);
|
||||
return $obj->hash($str, $ig_func);
|
||||
}
|
||||
} else {
|
||||
function _nano_sha256($str, $ig_func = false) {
|
||||
$obj = new nanoSha2((defined('_NANO_SHA2_UPPER')) ? true : false);
|
||||
return $obj->hash($str, $ig_func);
|
||||
}
|
||||
}
|
||||
|
||||
// support to give php4 the hash() routine which abstracts this code.
|
||||
if (!function_exists('hash'))
|
||||
{
|
||||
function hash($algo, $data)
|
||||
{
|
||||
if (empty($algo) || !is_string($algo) || !is_string($data)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (function_exists($algo)) {
|
||||
return $algo($data);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Bugzilla password hashing */
|
||||
function bz_crypt($password, $salt)
|
||||
{
|
||||
$algorithm = '';
|
||||
if (preg_match('/{([^}]+)}$/', $salt, $m))
|
||||
$algorithm = $m[1];
|
||||
|
||||
if (!$algorithm)
|
||||
return crypt($password, $salt);
|
||||
elseif (strtolower($algorithm) == 'sha-256')
|
||||
{
|
||||
$salt = substr($salt, 0, 8);
|
||||
return $salt . substr(base64_encode(pack('H*',sha256($password . $salt))), 0, -1) . '{' . $algorithm . '}';
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
?>
|
270
shared.php
|
@ -16,10 +16,10 @@ $fof_no_login = true;
|
|||
include_once("fof-main.php");
|
||||
include_once("fof-render.php");
|
||||
|
||||
$user = !empty($_GET['user']) ? intval($_GET['user']) : 0;
|
||||
if(!$user) die;
|
||||
$user = $_GET['user'];
|
||||
if(!isset($user)) die;
|
||||
|
||||
$format = !empty($_GET['format']) ? $_GET['format'] : '';
|
||||
$format = $_GET['format'];
|
||||
|
||||
$prefs = new FoF_Prefs($user);
|
||||
$sharing = $prefs->get("sharing");
|
||||
|
@ -28,108 +28,97 @@ if($sharing == "no") die;
|
|||
$name = $prefs->get("sharedname");
|
||||
$url = $prefs->get("sharedurl");
|
||||
|
||||
$what = $sharing;
|
||||
$extratitle = '';
|
||||
if(isset($_GET['what']))
|
||||
$which = ($sharing == "all") ? "all" : "shared";
|
||||
|
||||
if(isset($_GET['which']))
|
||||
{
|
||||
$what = ($sharing == "all") ? $_GET['what'] : "$sharing, " . $_GET['what'];
|
||||
$extratitle .= " items tagged " . $_GET['what'];
|
||||
$which = ($sharing == "all") ? $_GET['which'] : "shared " . $_GET['which'];
|
||||
$extratitle = " items tagged " . $_GET['which'];
|
||||
}
|
||||
|
||||
$feed = NULL;
|
||||
if(isset($_GET['feed']))
|
||||
{
|
||||
$feed = intval($_GET['feed']);
|
||||
$r = fof_db_get_feed_by_id($feed, fof_current_user());
|
||||
$extratitle .= ' from <a href="' . htmlspecialchars($r['feed_link']) . '">' . htmlspecialchars(fof_feed_title($r)) . '</a>';
|
||||
$feed = $_GET['feed'];
|
||||
$r = fof_db_get_feed_by_id($feed);
|
||||
$extratitle .= " from <a href='" . $r['feed_link'] . "'>" . $r['feed_title'] . "</a>";
|
||||
}
|
||||
|
||||
$when = NULL;
|
||||
if(isset($_GET['when']) && preg_match('#^\d+/\d+/\d+$#s', $_GET['when']))
|
||||
$when = $_GET['when'];
|
||||
$result = fof_get_items($user, $feed, $which, NULL, 0, 100);
|
||||
|
||||
$offset = isset($_GET['offset']) ? intval($_GET['offset']) : 0;
|
||||
|
||||
$result = fof_get_items($user, $feed, $what, $when, $offset, 101);
|
||||
if (count($result) > 100)
|
||||
$shared_feed = htmlspecialchars("http://" . $_SERVER['SERVER_NAME'] . $_SERVER['PHP_SELF'] . "?user=$user&format=atom");
|
||||
$shared_link = htmlspecialchars("http://" . $_SERVER['SERVER_NAME'] . $_SERVER['PHP_SELF'] . "?user=$user");
|
||||
|
||||
if(isset($_GET['which']))
|
||||
{
|
||||
$next = true;
|
||||
array_pop($result);
|
||||
$shared_feed .= '&which=' . $_GET['which'];
|
||||
$shared_link .= '&which=' . $_GET['which'];
|
||||
}
|
||||
else
|
||||
$next = false;
|
||||
|
||||
function lnk($what = NULL, $atom = false, $offset = NULL)
|
||||
if(isset($_GET['feed']))
|
||||
{
|
||||
global $user;
|
||||
$link = "http://" . $_SERVER['SERVER_NAME'] . $_SERVER['PHP_SELF'] . "?user=$user";
|
||||
if (isset($_GET['what']) && $what === NULL)
|
||||
$what = $_GET['what'];
|
||||
if ($what !== NULL)
|
||||
$link .= '&what='.urlencode($what);
|
||||
if (!empty($_GET['feed']))
|
||||
$link .= '&feed='.intval($_GET['feed']);
|
||||
if ($offset > 0)
|
||||
$link .= '&offset='.intval($offset);
|
||||
if ($atom)
|
||||
$link .= '&format=atom';
|
||||
return htmlspecialchars($link);
|
||||
$shared_feed .= '&feed=' . $_GET['feed'];
|
||||
$shared_link .= '&feed=' . $_GET['feed'];
|
||||
}
|
||||
|
||||
|
||||
if($format == "atom")
|
||||
{
|
||||
header("Content-Type: application/atom+xml; charset=utf-8");
|
||||
print '<?xml version="1.0"?>';
|
||||
header("Content-Type: application/atom+xml; charset=utf-8");
|
||||
echo '<?xml version="1.0"?>';
|
||||
?>
|
||||
|
||||
<feed xmlns="http://www.w3.org/2005/Atom">
|
||||
<title>Feed on Feeds - Shared Items<?php if($name) echo " from $name"; if($extratitle) echo " " . strip_tags($extratitle) ?></title>
|
||||
<updated><?= gmdate('Y-m-d\TH:i:s\Z')?></updated>
|
||||
<updated><?php echo gmdate('Y-m-d\TH:i:s\Z')?></updated>
|
||||
<generator uri="http://feedonfeeds.com/">Feed on Feeds</generator>
|
||||
<?php if($name) echo "<author><name>$name</name></author>"; ?>
|
||||
<id><?= lnk(NULL, true) ?></id>
|
||||
<link href="<?= lnk(NULL, true) ?>" rel="self" type="application/atom+xml"/>
|
||||
<link href="<?= lnk() ?>" rel="alternate"/>
|
||||
<id><?php echo $shared_feed ?></id>
|
||||
<link href="<?php echo $shared_feed ?>" rel="self" type="application/atom+xml"/>
|
||||
<link href="<?php echo $shared_link ?>" rel="alternate"/>
|
||||
|
||||
<?php
|
||||
|
||||
foreach($result as $item)
|
||||
{
|
||||
$feed_link = htmlspecialchars($item['feed_link']);
|
||||
$feed_url = htmlspecialchars(preg_replace('!^([a-z0-9_]+)://[^/]*:[^/]*@!is', '\1://', $item['feed_url']));
|
||||
$feed_title = htmlspecialchars(fof_feed_title($item));
|
||||
|
||||
$item_link = htmlspecialchars($item['item_link']);
|
||||
$feed_url = htmlspecialchars($item['feed_url']);
|
||||
$feed_title = htmlspecialchars($item['feed_title']);
|
||||
|
||||
$item_link = htmlspecialchars($item['item_link']);
|
||||
|
||||
$item_guid = $item['item_guid'];
|
||||
if (!preg_match("/^[a-z0-9\.\+\-]+:/", $item_guid))
|
||||
if(!ereg("^[a-z0-9\.\+\-]+:", $item_guid))
|
||||
{
|
||||
$item_guid = $feed_link . '#' . $item_guid;
|
||||
}
|
||||
$item_guid = htmlspecialchars($item_guid);
|
||||
|
||||
$item_title = htmlspecialchars($item['item_title']);
|
||||
$item_content = htmlspecialchars($item['item_content']);
|
||||
|
||||
$item_title = htmlspecialchars($item['item_title']);
|
||||
$item_content = htmlspecialchars($item['item_content']);
|
||||
|
||||
$item_published = gmdate('Y-m-d\TH:i:s\Z', $item['item_published']);
|
||||
$item_cached = gmdate('Y-m-d\TH:i:s\Z', $item['item_cached']);
|
||||
$item_updated = gmdate('Y-m-d\TH:i:s\Z', $item['item_updated']);
|
||||
|
||||
if(!$item_title) $item_title = "[no title]";
|
||||
$item_published = gmdate('Y-m-d\TH:i:s\Z', $item['item_published']);
|
||||
$item_cached = gmdate('Y-m-d\TH:i:s\Z', $item['item_cached']);
|
||||
$item_updated = gmdate('Y-m-d\TH:i:s\Z', $item['item_updated']);
|
||||
|
||||
if(!$item_title) $item_title = "[no title]";
|
||||
|
||||
?>
|
||||
|
||||
<entry>
|
||||
<id><?= $item_guid ?></id>
|
||||
<link href="<?= $item_link ?>" rel="alternate" type="text/html"/>
|
||||
<title type="html"><?= $item_title ?></title>
|
||||
<summary type="html"><?= $item_content ?></summary>
|
||||
<updated><?= $item_updated ?></updated>
|
||||
<id><?php echo $item_guid ?></id>
|
||||
<link href="<?php echo $item_link ?>" rel="alternate" type="text/html"/>
|
||||
<title type="html"><?php echo $item_title ?></title>
|
||||
<summary type="html"><?php echo $item_content ?></summary>
|
||||
<updated><?php echo $item_updated ?></updated>
|
||||
<source>
|
||||
<id><?= $feed_link ?></id>
|
||||
<link href="<?= $feed_link ?>" rel="alternate" type="text/html"/>
|
||||
<link href="<?= $feed_url ?>" rel="self" type="application/atom+xml"/>
|
||||
<title><?= $feed_title ?></title>
|
||||
<id><?php echo $feed_link ?></id>
|
||||
<link href="<?php echo $feed_link ?>" rel="alternate" type="text/html"/>
|
||||
<link href="<?php echo $feed_url ?>" rel="self" type="application/atom+xml"/>
|
||||
<title><?php echo $feed_title ?></title>
|
||||
</source>
|
||||
</entry>
|
||||
</entry>
|
||||
<?php
|
||||
}
|
||||
echo '</feed>';
|
||||
|
@ -138,50 +127,37 @@ else
|
|||
{
|
||||
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 xmlns="http://www.w3.org/1999/xhtml">
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<link rel="alternate" href="<?= lnk(NULL, true) ?>" type="application/atom+xml"/>
|
||||
<title>Feed on Feeds - Shared Items<?php if($name) echo " from $name"; if($extratitle) echo " " . strip_tags($extratitle) ?></title>
|
||||
<link rel="stylesheet" href="fof.css" media="screen" />
|
||||
<style>
|
||||
.box
|
||||
{
|
||||
font-family: georgia;
|
||||
background: #eee;
|
||||
border: 1px solid black;
|
||||
width: 30em;
|
||||
margin: 10px auto 20px;
|
||||
padding: 1em;
|
||||
text-align: center;
|
||||
}
|
||||
.pages { text-align: center; }
|
||||
.pages a { margin: 0.5em; }
|
||||
</style>
|
||||
</head>
|
||||
<head>
|
||||
<link rel="alternate" href="<?php echo $shared_feed?>" type="application/atom+xml"/>
|
||||
<title>Feed on Feeds - Shared Items<?php if($name) echo " from $name"; if($extratitle) echo " " . strip_tags($extratitle) ?></title>
|
||||
<link rel="stylesheet" href="fof.css" media="screen" />
|
||||
<style>
|
||||
.box
|
||||
{
|
||||
font-family: georgia;
|
||||
background: #eee;
|
||||
border: 1px solid black;
|
||||
width: 30em;
|
||||
margin: 10px auto 20px;
|
||||
padding: 1em;
|
||||
text-align: center;
|
||||
}
|
||||
</style>
|
||||
|
||||
<body>
|
||||
|
||||
<h1 class="box">
|
||||
<a href="http://feedonfeeds.com/">Feed on Feeds</a> - Shared Items
|
||||
<?php if($name) { ?>
|
||||
from <a href="<?= lnk() ?>"><?= $name ?></a>
|
||||
<?php if($url) { ?>
|
||||
<a href="<?= $url ?>"><img src="image/external.png" width="10" height="10" /></a>
|
||||
<?php } ?>
|
||||
<?= $extratitle ? "<br><i>$extratitle</i>" : "" ?>
|
||||
<?php } ?>
|
||||
</h1>
|
||||
|
||||
<div class="pages">
|
||||
<?php if($offset) { ?>
|
||||
<a href="<?= lnk(NULL, false, max($offset-100, 0)) ?>">newer items</a>
|
||||
<?php } if($next) { ?>
|
||||
<a href="<?= lnk(NULL, false, $offset+100) ?>">earlier items</a>
|
||||
<?php } ?>
|
||||
</div>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<h1 class="box"><a href="http://feedonfeeds.com/">Feed on Feeds</a> - Shared Items
|
||||
<?php if($name) echo " from ";
|
||||
if($url) echo "<a href='$url'>";
|
||||
if($name) echo "$name";
|
||||
if($url) echo "</a>";
|
||||
if($extratitle) echo "<br><i>$extratitle</i>" ?>
|
||||
</h1>
|
||||
<div id="items">
|
||||
|
||||
<?php
|
||||
|
@ -190,57 +166,65 @@ $first = true;
|
|||
|
||||
foreach($result as $item)
|
||||
{
|
||||
$item_id = $item['item_id'];
|
||||
print '<div class="item shown" id="i' . $item_id . '">';
|
||||
|
||||
$item_id = $item['item_id'];
|
||||
print '<div class="item shown" id="i' . $item_id . '">';
|
||||
|
||||
$feed_link = $item['feed_link'];
|
||||
$feed_title = fof_feed_title($item);
|
||||
$feed_image = $item['feed_image'];
|
||||
$feed_description = $item['feed_description'];
|
||||
$feed_title = $item['feed_title'];
|
||||
$feed_image = $item['feed_image'];
|
||||
$feed_description = $item['feed_description'];
|
||||
|
||||
$item_link = $item['item_link'];
|
||||
$item_id = $item['item_id'];
|
||||
$item_title = $item['item_title'];
|
||||
$item_content = $item['item_content'];
|
||||
$item_link = $item['item_link'];
|
||||
$item_id = $item['item_id'];
|
||||
$item_title = $item['item_title'];
|
||||
$item_content = $item['item_content'];
|
||||
$item_read = $item['item_read'];
|
||||
|
||||
$item_published = gmdate("Y-n-d g:ia", $item['item_published'] + $offset*60*60);
|
||||
$item_cached = gmdate("Y-n-d g:ia", $item['item_cached'] + $offset*60*60);
|
||||
$item_updated = gmdate("Y-n-d g:ia", $item['item_updated'] + $offset*60*60);
|
||||
|
||||
if(!$item_title) $item_title = "[no title]";
|
||||
$item_published = gmdate("Y-n-d g:ia", $item['item_published'] + $offset*60*60);
|
||||
$item_cached = gmdate("Y-n-d g:ia", $item['item_cached'] + $offset*60*60);
|
||||
$item_updated = gmdate("Y-n-d g:ia", $item['item_updated'] + $offset*60*60);
|
||||
|
||||
if(!$item_title) $item_title = "[no title]";
|
||||
|
||||
?>
|
||||
|
||||
<div class="header">
|
||||
<h1>
|
||||
<?php if($item_link) { ?>
|
||||
<a href="<?=htmlspecialchars($item_link)?>"><?= $item_title ?></a>
|
||||
<?php } else { ?>
|
||||
<?= $item_title ?>
|
||||
<?php } ?>
|
||||
</h1>
|
||||
<span class='dash'> - </span>
|
||||
<h2>
|
||||
<a href="<?=htmlspecialchars($feed_link)?>" title="<?=htmlspecialchars($feed_description)?>"><img src="<?=htmlspecialchars($feed_image)?>" height="16" width="16" border="0" /></a>
|
||||
<a href="<?=htmlspecialchars($feed_link)?>" title="<?=htmlspecialchars($feed_description)?>"><?=htmlspecialchars($feed_title)?></a>
|
||||
</h2>
|
||||
<span class="tags">
|
||||
<?php foreach($item['tags'] as $t) {
|
||||
if (!preg_match('#\b'.str_replace('#', '\\#', preg_quote($t)).'\b#', $sharing)) { ?>
|
||||
<a href="<?= lnk($t) ?>"><?=htmlspecialchars($t)?></a>
|
||||
<?php } } ?>
|
||||
</span>
|
||||
<span class="meta">on <?= $item_published ?> GMT</span>
|
||||
|
||||
<h1>
|
||||
<a href="<?php echo $item_link ?>">
|
||||
<?php echo $item_title ?>
|
||||
</a>
|
||||
</h1>
|
||||
|
||||
|
||||
<span class='dash'> - </span>
|
||||
|
||||
<h2>
|
||||
|
||||
<a href="<?php echo $feed_link ?>" title='<?php echo $feed_description ?>'><img src="<?php echo $feed_image ?>" height="16" width="16" border="0" /></a>
|
||||
<a href="<?php echo $feed_link ?>" title='<?php echo $feed_description ?>'><?php echo $feed_title ?></a>
|
||||
|
||||
</h2>
|
||||
|
||||
<span class="meta">on <?php echo $item_published ?> GMT</span>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="body"><?= $item_content ?></div>
|
||||
|
||||
<div class="body"><?php echo $item_content ?></div>
|
||||
|
||||
<div class="clearer"></div>
|
||||
</div>
|
||||
|
||||
<?php } if(!$result) { ?>
|
||||
<p><i>No shared items.</i></p>
|
||||
<?php } ?>
|
||||
<?php
|
||||
}
|
||||
|
||||
if(count($result) == 0)
|
||||
{
|
||||
echo "<p><i>No shared items.</i></p>";
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
</div></body></html>
|
||||
|
||||
|
|
202
sidebar.php
|
@ -17,10 +17,11 @@ include_once("fof-main.php");
|
|||
fof_set_content_type();
|
||||
|
||||
?>
|
||||
<img id="throbber" src="image/throbber.gif" align="left" style="display: none" />
|
||||
<img id="throbber" src="image/throbber.gif" align="left" style="position: fixed; left: 0; top: 0; display: none;">
|
||||
|
||||
<div id="welcome">Welcome <b><?php echo $fof_user_name ?></b>! <a href="prefs.php">prefs</a> | <a href="logout.php">log out</a> | <a href="http://feedonfeeds.com/">about</a></div>
|
||||
<div id="addupd"><a href="add.php"><b>Add Feeds</b></a> / <a href="update.php"><b>Update Feeds</b></a></div>
|
||||
<center id="welcome">Welcome <b><?php echo $fof_user_name ?></b>! <a href="prefs.php">prefs</a> | <a href="logout.php">log out</a> | <a href="http://feedonfeeds.com/">about</a></center>
|
||||
<br>
|
||||
<center><a href="add.php"><b>Add Feeds</b></a> / <a href="update.php"><b>Update Feeds</b></a></center>
|
||||
|
||||
<ul id="nav">
|
||||
|
||||
|
@ -29,17 +30,27 @@ fof_set_content_type();
|
|||
$order = $fof_prefs_obj->get('feed_order');
|
||||
$direction = $fof_prefs_obj->get('feed_direction');
|
||||
|
||||
$what = !empty($_GET['what']) ? $_GET['what'] : 'unread';
|
||||
$when = !empty($_GET['when']) ? $_GET['when'] : NULL;
|
||||
$search = !empty($_GET['search']) ? $_GET['search'] : NULL;
|
||||
if(!isset($_GET['what']))
|
||||
{
|
||||
$what = "unread";
|
||||
}
|
||||
else
|
||||
{
|
||||
$what = $_GET['what'];
|
||||
}
|
||||
|
||||
$when = $_GET['when'];
|
||||
|
||||
$search = $_GET['search'];
|
||||
|
||||
echo "<script>what='$what'; when='$when';</script>";
|
||||
|
||||
|
||||
$feeds = fof_get_feeds(fof_current_user(), $order, $direction);
|
||||
|
||||
$unread = $starred = $total = 0;
|
||||
foreach($feeds as $row)
|
||||
{
|
||||
$n++;
|
||||
$unread += $row['feed_unread'];
|
||||
$starred += $row['feed_starred'];
|
||||
$total += $row['feed_items'];
|
||||
|
@ -57,11 +68,11 @@ else
|
|||
echo "<script>starred = $starred;</script>";
|
||||
|
||||
?>
|
||||
|
||||
|
||||
<li <?php if($what == "unread") echo "style='background: #ddd'" ?> ><a href=".?what=unread"><font color=red><b>Unread <?php if($unread) echo "($unread)" ?></b></font></a></li>
|
||||
<li <?php if($what == "star") echo "style='background: #ddd'" ?> ><a href=".?what=star"><img src="image/star-on.gif" border="0" height="10" width="10"> Starred <span id="starredcount"><?php if($starred) echo "($starred)" ?></span></a></li>
|
||||
<li <?php if($what == "all" && isset($when)) echo "style='background: #ddd'" ?> ><a href="?what=all&when=today">< Today</a></li>
|
||||
<li <?php if($what == "all" && !isset($when)) echo "style='background: #ddd'" ?> ><a href="?what=all">All Items <?php if($total) echo "($total)" ?></a></li>
|
||||
<li <?php if($what == "all" && isset($when)) echo "style='background: #ddd'" ?> ><a href=".?what=all&when=today">< Today</a></li>
|
||||
<li <?php if($what == "all" && !isset($when)) echo "style='background: #ddd'" ?> ><a href=".?what=all&how=paged">All Items <?php if($total) echo "($total)" ?></a></li>
|
||||
<li <?php if(isset($search)) echo "style='background: #ddd'" ?> ><a href="javascript:Element.toggle('search'); Field.focus('searchfield');void(0);">Search</a>
|
||||
<form action="." id="search" <?php if(!isset($search)) echo 'style="display: none"' ?>>
|
||||
<input id="searchfield" name="search" value="<?php echo $search?>">
|
||||
|
@ -81,6 +92,7 @@ echo "<script>starred = $starred;</script>";
|
|||
$tags = fof_get_tags(fof_current_user());
|
||||
|
||||
$n = 0;
|
||||
|
||||
foreach($tags as $tag)
|
||||
{
|
||||
$tag_id = $tag['tag_id'];
|
||||
|
@ -101,42 +113,50 @@ if($n)
|
|||
</tr>
|
||||
|
||||
<?php
|
||||
$t = 0;
|
||||
foreach($tags as $tag)
|
||||
{
|
||||
$tag_name = $tag['tag_name'];
|
||||
$tag_id = $tag['tag_id'];
|
||||
$count = $tag['count'];
|
||||
$unread = $tag['unread'];
|
||||
{
|
||||
$tag_name = $tag['tag_name'];
|
||||
$tag_id = $tag['tag_id'];
|
||||
$count = $tag['count'];
|
||||
$unread = $tag['unread'];
|
||||
|
||||
if($tag_id == 1 || $tag_id == 2) continue;
|
||||
|
||||
if($tag_id == 1 || $tag_id == 2) continue;
|
||||
if(++$t % 2)
|
||||
{
|
||||
print "<tr class=\"odd-row\">";
|
||||
}
|
||||
else
|
||||
{
|
||||
print "<tr>";
|
||||
}
|
||||
|
||||
if(++$t % 2)
|
||||
print "<tr class=\"odd-row\">";
|
||||
else
|
||||
print "<tr>";
|
||||
print "<td>";
|
||||
if($unread) print "<a class='unread' href='.?what=$tag_name+unread'>$unread</a>/";
|
||||
print "<a href='.?what=$tag_name'>$count</a></td>";
|
||||
print "<td><b><a href='.?what=$tag_name'>$tag_name</a></b></td>";
|
||||
print "<td><a href=\"#\" title=\"untag all items\" onclick=\"if(confirm('Untag all [$tag_name] items --are you SURE?')) { delete_tag('$tag_name'); return false; } else { return false; }\">[x]</a></td>";
|
||||
|
||||
print "<td>";
|
||||
if ($unread) print "<a class='unread' href='.?what=$tag_name,unread'>$unread</a>/";
|
||||
print "<a href='?what=$tag_name'>$count</a></td>";
|
||||
print "<td><b><a href='.?what=$tag_name".($unread?",unread":"")."'>$tag_name</a></b></td>";
|
||||
print "<td><a href=\"#\" title=\"untag all items\" onclick=\"if(confirm('Untag all [$tag_name] items --are you SURE?')) { delete_tag('$tag_name'); return false; } else { return false; }\">[x]</a></td>";
|
||||
|
||||
print "</tr>";
|
||||
print "</tr>";
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
|
||||
</table>
|
||||
|
||||
</div>
|
||||
|
||||
<br>
|
||||
|
||||
<?php } ?>
|
||||
|
||||
|
||||
<div id="feeds">
|
||||
|
||||
<div id="feedlist">
|
||||
|
||||
<table cellspacing="0" cellpadding="1" border="0" id="feedlisttable">
|
||||
<table cellspacing="0" cellpadding="1" border="0">
|
||||
|
||||
<tr class="heading">
|
||||
|
||||
|
@ -164,9 +184,9 @@ foreach (array("feed_age", "max_date", "feed_unread", "feed_url", "feed_title")
|
|||
{
|
||||
$url = "return change_feed_order('$col', 'asc')";
|
||||
}
|
||||
|
||||
|
||||
echo "<td><nobr><a href='#' title='$title[$col]' onclick=\"$url\">";
|
||||
|
||||
|
||||
if($col == "feed_unread")
|
||||
{
|
||||
echo "<span class=\"unread\">#</span>";
|
||||
|
@ -175,12 +195,12 @@ foreach (array("feed_age", "max_date", "feed_unread", "feed_url", "feed_title")
|
|||
{
|
||||
echo $name[$col];
|
||||
}
|
||||
|
||||
|
||||
if($col == $order)
|
||||
{
|
||||
echo ($direction == "asc") ? "↓" : "↑";
|
||||
}
|
||||
|
||||
|
||||
echo "</a></nobr></td>";
|
||||
}
|
||||
|
||||
|
@ -193,63 +213,72 @@ foreach (array("feed_age", "max_date", "feed_unread", "feed_url", "feed_title")
|
|||
|
||||
foreach($feeds as $row)
|
||||
{
|
||||
$id = $row['feed_id'];
|
||||
$url = $row['feed_url'];
|
||||
$title = fof_feed_title($row);
|
||||
$link = $row['feed_link'];
|
||||
$description = $row['feed_description'];
|
||||
$age = $row['feed_age'];
|
||||
$unread = $row['feed_unread'];
|
||||
$starred = $row['feed_starred'];
|
||||
$items = $row['feed_items'];
|
||||
$agestr = $row['agestr'];
|
||||
$agestrabbr = $row['agestrabbr'];
|
||||
$lateststr = $row['lateststr'];
|
||||
$lateststrabbr = $row['lateststrabbr'];
|
||||
$id = $row['feed_id'];
|
||||
$url = $row['feed_url'];
|
||||
$title = $row['feed_title'];
|
||||
$link = $row['feed_link'];
|
||||
$description = $row['feed_description'];
|
||||
$age = $row['feed_age'];
|
||||
$unread = $row['feed_unread'];
|
||||
$starred = $row['feed_starred'];
|
||||
$items = $row['feed_items'];
|
||||
$agestr = $row['agestr'];
|
||||
$agestrabbr = $row['agestrabbr'];
|
||||
$lateststr = $row['lateststr'];
|
||||
$lateststrabbr = $row['lateststrabbr'];
|
||||
|
||||
if(++$t % 2)
|
||||
print "<tr class=\"odd-row\">";
|
||||
else
|
||||
print "<tr>";
|
||||
|
||||
$u = ".?feed=$id";
|
||||
$u2 = ".?feed=$id&what=all";
|
||||
if(++$t % 2)
|
||||
{
|
||||
print "<tr class=\"odd-row\">";
|
||||
}
|
||||
else
|
||||
{
|
||||
print "<tr>";
|
||||
}
|
||||
|
||||
print "<td><span title=\"$agestr\" id=\"${id}-agestr\">$agestrabbr</span></td>";
|
||||
$u = ".?feed=$id";
|
||||
$u2 = ".?feed=$id&what=all&how=paged";
|
||||
|
||||
print "<td><span title=\"$lateststr\" id=\"${id}-lateststr\">$lateststrabbr</span></td>";
|
||||
print "<td><span title=\"$agestr\" id=\"${id}-agestr\">$agestrabbr</span></td>";
|
||||
|
||||
print "<td class=\"nowrap\" id=\"${id}-items\">";
|
||||
print "<td><span title=\"$lateststr\" id=\"${id}-lateststr\">$lateststrabbr</span></td>";
|
||||
|
||||
if($unread)
|
||||
print "<a class=\"unread\" title=\"new items\" href=\"$u\">$unread</a>/";
|
||||
print "<td class=\"nowrap\" id=\"${id}-items\">";
|
||||
|
||||
print "<a href=\"$u2\" title=\"all items\">$items</a>";
|
||||
if($unread)
|
||||
{
|
||||
print "<a class=\"unread\" title=\"new items\" href=\"$u\">$unread</a>/";
|
||||
}
|
||||
|
||||
print "</td>";
|
||||
print "<a href=\"$u2\" title=\"all items\">$items</a>";
|
||||
|
||||
print "<td align='center'>";
|
||||
if($row['feed_image'] && $fof_prefs_obj->get('favicons'))
|
||||
print "<a href=\"$url\" title=\"feed\"><img src='" . $row['feed_image'] . "' width='16' height='16' border='0' /></a>";
|
||||
else
|
||||
print "<a href=\"$url\" title=\"feed\"><img src='image/feed-icon.png' width='16' height='16' border='0' /></a>";
|
||||
print "</td>";
|
||||
print "</td>";
|
||||
|
||||
print "<td>";
|
||||
print "<a href=\"".($unread ? $u : $u2)."\" title=\"".($unread ? "unread" : "all")." items\"><b>".htmlspecialchars($title)."</b></a>";
|
||||
if ($link)
|
||||
print " <a href=\"$link\" title=\"home page\"><img width=\"10\" height=\"10\" alt='home page' src='image/external.png' /></a>";
|
||||
print "</td>";
|
||||
print "<td><nobr>";
|
||||
print "<td align='center'>";
|
||||
if($row['feed_image'] && $fof_prefs_obj->get('favicons'))
|
||||
{
|
||||
print "<a href=\"$url\" title=\"feed\"><img src='" . $row['feed_image'] . "' width='16' height='16' border='0' /></a>";
|
||||
}
|
||||
else
|
||||
{
|
||||
print "<a href=\"$url\" title=\"feed\"><img src='image/feed-icon.png' width='16' height='16' border='0' /></a>";
|
||||
}
|
||||
print "</td>";
|
||||
|
||||
print "<a href=\"update.php?feed=$id\" title=\"update\">u</a>";
|
||||
$stitle = addslashes($title);
|
||||
print " <a href=\"#\" title=\"mark all read\" onclick=\"if(confirm('Mark all [$stitle] items as read --are you SURE?')) { mark_feed_read($id); return false; } else { return false; }\">m</a>";
|
||||
print " <a href=\"delete.php?feed=$id\" title=\"delete\" onclick=\"return confirm('Unsubscribe [$stitle] --are you SURE?')\">d</a>";
|
||||
print "<td>";
|
||||
print "<a href=\"$link\" title=\"home page\"><b>$title</b></a></td>";
|
||||
|
||||
print "</nobr></td>";
|
||||
print "<td><nobr>";
|
||||
|
||||
print "<a href=\"update.php?feed=$id\" title=\"update\">u</a>";
|
||||
$stitle = htmlspecialchars(addslashes($title));
|
||||
print " <a href=\"#\" title=\"mark all read\" onclick=\"if(confirm('Mark all [$stitle] items as read --are you SURE?')) { mark_feed_read($id); return false; } else { return false; }\">m</a>";
|
||||
print " <a href=\"delete.php?feed=$id\" title=\"delete\" onclick=\"return confirm('Unsubscribe [$stitle] --are you SURE?')\">d</a>";
|
||||
|
||||
print "</nobr></td>";
|
||||
|
||||
print "</tr>";
|
||||
print "</tr>";
|
||||
}
|
||||
|
||||
?>
|
||||
|
@ -259,3 +288,22 @@ foreach($feeds as $row)
|
|||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<?php
|
||||
|
||||
$order = $_GET['order'];
|
||||
$direction = $_GET['direction'];
|
||||
|
||||
if(!isset($order))
|
||||
{
|
||||
$order = "title";
|
||||
}
|
||||
|
||||
if(!isset($direction))
|
||||
{
|
||||
$direction = "asc";
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
Index: simplepie.inc
|
||||
===================================================================
|
||||
--- simplepie.inc (revision 810)
|
||||
+++ simplepie.inc (working copy)
|
||||
@@ -6495,6 +6495,10 @@
|
||||
curl_setopt($fp, CURLOPT_FOLLOWLOCATION, 1);
|
||||
curl_setopt($fp, CURLOPT_MAXREDIRS, $redirects);
|
||||
}
|
||||
+
|
||||
+ // added by FoF to enable https and digest authentication
|
||||
+ curl_setopt($fp, CURLOPT_SSL_VERIFYPEER, false);
|
||||
+ curl_setopt($fp, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
|
||||
|
||||
$this->headers = curl_exec($fp);
|
||||
if (curl_errno($fp) == 23 || curl_errno($fp) == 61)
|
|
@ -17,12 +17,11 @@ include_once("fof-main.php");
|
|||
fof_set_content_type();
|
||||
|
||||
?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<title>feed on feeds - uninstallation</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<link rel="stylesheet" href="fof.css" media="screen" />
|
||||
<script src="fof.js" type="text/javascript"></script>
|
||||
<meta name="ROBOTS" content="NOINDEX, NOFOLLOW" />
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
*
|
||||
*/
|
||||
|
||||
set_time_limit(60*100);
|
||||
set_time_limit(60*10);
|
||||
|
||||
ob_start();
|
||||
|
||||
|
@ -20,7 +20,7 @@ $fof_no_login = true;
|
|||
$fof_user_id = 1;
|
||||
include_once("fof-main.php");
|
||||
|
||||
$p = FoF_Prefs::instance();
|
||||
$p =& FoF_Prefs::instance();
|
||||
$fof_admin_prefs = $p->prefs;
|
||||
|
||||
fof_log("=== update started, timeout = $fof_admin_prefs[autotimeout], purge = $fof_admin_prefs[purge] ===", "update");
|
||||
|
@ -45,9 +45,9 @@ $feeds = fof_multi_sort($feeds, 'feed_cache_attempt_date', false);
|
|||
|
||||
foreach($feeds as $feed)
|
||||
{
|
||||
$id = $feed['feed_id'];
|
||||
$id = $feed['feed_id'];
|
||||
fof_log("updating $feed[feed_url]", "update");
|
||||
fof_update_feed($id);
|
||||
fof_update_feed($id);
|
||||
}
|
||||
|
||||
fof_log("optimizing database", "update");
|
||||
|
@ -57,3 +57,4 @@ fof_db_optimize();
|
|||
fof_log("=== update complete ===", "update");
|
||||
|
||||
ob_end_clean();
|
||||
?>
|
||||
|
|
|
@ -1,5 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
if [ -z "`ps ax | grep php | grep update-quiet | head -n 1 | awk '{print $1}'`" ]; then
|
||||
cd `dirname $0` && /usr/bin/php update-quiet.php
|
||||
fi
|
14
update.php
|
@ -19,7 +19,7 @@ print("<br>");
|
|||
$feed = $_GET['feed'];
|
||||
$feeds = array();
|
||||
|
||||
$p = FoF_Prefs::instance();
|
||||
$p =& FoF_Prefs::instance();
|
||||
$admin_prefs = $p->admin_prefs;
|
||||
|
||||
if($feed)
|
||||
|
@ -43,7 +43,7 @@ else
|
|||
{
|
||||
$title = $feed['feed_title'];
|
||||
list($timestamp, ) = fof_nice_time_stamp($feed['feed_cache_date']);
|
||||
|
||||
|
||||
print "$title was just updated $timestamp!<br>";
|
||||
}
|
||||
else
|
||||
|
@ -56,12 +56,12 @@ else
|
|||
$feeds = fof_multi_sort($feeds, 'feed_cache_attempt_date', false);
|
||||
|
||||
print("<script>\nwindow.onload = ajaxupdate;\nfeedslist = [");
|
||||
|
||||
|
||||
foreach($feeds as $feed)
|
||||
{
|
||||
$title = $feed['feed_title'];
|
||||
$id = $feed['feed_id'];
|
||||
|
||||
$title = $feed['feed_title'];
|
||||
$id = $feed['feed_id'];
|
||||
|
||||
$feedjson[] = "{'id': $id, 'title': '" . addslashes($title) . "'}";
|
||||
}
|
||||
|
||||
|
@ -69,5 +69,5 @@ print(join($feedjson, ", "));
|
|||
print("];\n</script>");
|
||||
|
||||
include("footer.php");
|
||||
|
||||
?>
|
||||
|
||||
|
|
30
urandom.inc
|
@ -1,30 +0,0 @@
|
|||
<?php
|
||||
|
||||
function urandom($nbytes = 16)
|
||||
{
|
||||
$pr_bits = NULL;
|
||||
// Unix/Linux platform?
|
||||
$fp = @fopen('/dev/urandom', 'rb');
|
||||
if ($fp !== FALSE)
|
||||
{
|
||||
$pr_bits = @fread($fp, $nbytes);
|
||||
@fclose($fp);
|
||||
}
|
||||
// MS-Windows platform?
|
||||
elseif (@class_exists('COM'))
|
||||
{
|
||||
// http://msdn.microsoft.com/en-us/library/aa388176(VS.85).aspx
|
||||
try
|
||||
{
|
||||
$CAPI_Util = new COM('CAPICOM.Utilities.1');
|
||||
$pr_bits = $CAPI_Util->GetRandom($nbytes,0);
|
||||
// if we ask for binary data PHP munges it, so we
|
||||
// request base64 return value.
|
||||
$pr_bits = base64_decode($pr_bits);
|
||||
}
|
||||
catch (Exception $ex)
|
||||
{
|
||||
}
|
||||
}
|
||||
return $pr_bits;
|
||||
}
|
|
@ -4,44 +4,50 @@
|
|||
*
|
||||
* view-action.php - marks selected items as read (or unread)
|
||||
*
|
||||
*
|
||||
* Copyright (C) 2004-2007 Stephen Minutillo
|
||||
* steve@minutillo.com - http://minutillo.com/steve/
|
||||
*
|
||||
* Distributed under the GPL - see LICENSE
|
||||
*
|
||||
*/
|
||||
|
||||
include_once("fof-main.php");
|
||||
|
||||
$items = [];
|
||||
while (list ($key, $val) = each ($_POST))
|
||||
{
|
||||
$first = false;
|
||||
if ($val == "checked")
|
||||
|
||||
if($val == "checked")
|
||||
{
|
||||
$key = substr($key, 1);
|
||||
$items[] = $key;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty($_REQUEST['deltag']))
|
||||
if($_REQUEST['deltag'])
|
||||
{
|
||||
fof_untag(fof_current_user(), $_REQUEST['deltag']);
|
||||
fof_untag(fof_current_user(), $_REQUEST['deltag']);
|
||||
}
|
||||
elseif (!empty($_POST['feed']))
|
||||
else if($_POST['feed'])
|
||||
{
|
||||
fof_db_mark_feed_read(fof_current_user(), $_POST['feed']);
|
||||
fof_db_mark_feed_read(fof_current_user(), $_POST['feed']);
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($items)
|
||||
{
|
||||
if ($_POST['action'] == 'read')
|
||||
fof_db_mark_read(fof_current_user(), $items);
|
||||
elseif ($_POST['action'] == 'unread')
|
||||
fof_db_mark_unread(fof_current_user(), $items);
|
||||
elseif ($_POST['action'] == 'delete')
|
||||
fof_db_delete_items(fof_current_user(), $items, !fof_is_admin());
|
||||
}
|
||||
|
||||
if($items)
|
||||
{
|
||||
if($_POST['action'] == 'read')
|
||||
{
|
||||
fof_db_mark_read(fof_current_user(), $items);
|
||||
}
|
||||
|
||||
if($_POST['action'] == 'unread')
|
||||
{
|
||||
fof_db_mark_unread(fof_current_user(), $items);
|
||||
}
|
||||
}
|
||||
|
||||
header("Location: " . urldecode($_POST['return']));
|
||||
}
|
||||
?>
|
||||
|
|