From e616d0e1a29105727afdc53bcb161cab5fd837ba Mon Sep 17 00:00:00 2001 From: vitalif Date: Thu, 28 Jan 2010 13:49:32 +0000 Subject: [PATCH] Most popular feed suggestion option --- add.php | 47 +++++++++++++++++++++++++++++++++-------------- fof-db.php | 15 +++++++++++++++ fof.css | 6 ++++++ prefs.php | 18 ++++++++++-------- sidebar.php | 2 +- 5 files changed, 65 insertions(+), 23 deletions(-) diff --git a/add.php b/add.php index b88c953..649ffde 100644 --- a/add.php +++ b/add.php @@ -73,32 +73,51 @@ if($_SERVER["HTTPS"] == "on") $add_feed_url .= "://" . $_SERVER["HTTP_HOST"] . $_SERVER["SCRIPT_NAME"]; ?> -
If your browser is cool, you can register Feed on Feeds as a Feed Reader. If it is not cool, you can still use the FoF subscribe 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!
+
-
+

Use FeedOnFeeds for reading feeds always

- - -
-
+
+If your browser is cool, you can register Feed on Feeds as a Feed Reader. +If it is not cool, you can still use the FoF subscribe 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! +
-When adding feeds, mark items as unread

+When adding feeds, mark items as unread
-Login: Password: (optional) for password-protected feeds

+

Enter URL manually

-RSS or weblog URL:

+

+Login: Password: (optional) for password-protected feeds
+RSS or weblog URL:
+

-OPML URL: +

OPML import

-

- - -OPML filename: +

+OPML URL:
+OPML filename: +

+

OPML export

+
+ +admin_prefs['suggestadd'])) && + count($suggest = fof_db_get_most_popular_feeds($suggest))) { ?> +

Most popular feeds

+

+ +
+ +

+ + +
+ 1 order by readers desc + ".(!is_null($count) ? "limit $count" : "")); + $feeds = array(); + while ($row = mysql_fetch_assoc($result)) + $feeds[] = $row; + return $feeds; +} + ?> diff --git a/fof.css b/fof.css index 2573a97..256b95f 100644 --- a/fof.css +++ b/fof.css @@ -1,3 +1,5 @@ +img { border-width: 0; } + p { margin: 0; @@ -374,3 +376,7 @@ 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; } diff --git a/prefs.php b/prefs.php index 1fa62ce..3dc7cc9 100644 --- a/prefs.php +++ b/prefs.php @@ -21,9 +21,10 @@ 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', $_POST['logging']); - $prefs->set('topreaders_days', $_POST['topreaders_days']); - $prefs->set('topreaders_count', $_POST['topreaders_count']); + $prefs->set('logging', $_POST['logging'] && 1); + $prefs->set('suggestadd', intval($_POST['suggestadd'])); + $prefs->set('topreaders_days', intval($_POST['topreaders_days'])); + $prefs->set('topreaders_count', intval($_POST['topreaders_count'])); $prefs->save(); @@ -334,12 +335,13 @@ foreach($feeds as $row)

Feed on Feeds - Admin Options

-Enable logging? get('logging')) echo "checked" ?>>

-Purge read items after days (leave blank to never purge)

-Allow automatic feed updates every minutes

-Allow manual feed updates every minutes

+Enable logging? get('logging')) echo "checked" ?> />

+Purge read items after days (leave blank to never purge)

+Allow automatic feed updates every minutes

+Allow manual feed updates every minutes

Show Top readers in last days statistics on the login page

- +Suggest users to subscribe to most popular feeds

+

Add User

diff --git a/sidebar.php b/sidebar.php index 0da30a6..2cb1283 100644 --- a/sidebar.php +++ b/sidebar.php @@ -251,7 +251,7 @@ foreach($feeds as $row) print ""; print "".htmlspecialchars($title).""; if ($link) - print " "; + print " home page"; print ""; print "";