From b6cf43baab010d181601bb6aaae62dbab646203d Mon Sep 17 00:00:00 2001 From: Mike Crute Date: Thu, 19 Apr 2012 13:43:47 -0400 Subject: Initial import --- reader_shared.php | 68 +++++++++++++++++++++++++++++++++++++++++++++++++ weighted_categories.php | 35 +++++++++++++++++++++++++ 2 files changed, 103 insertions(+) create mode 100644 reader_shared.php create mode 100644 weighted_categories.php diff --git a/reader_shared.php b/reader_shared.php new file mode 100644 index 0000000..f3be003 --- /dev/null +++ b/reader_shared.php @@ -0,0 +1,68 @@ +

Options changes saved.

'); +} +?> +
+

Google Reader Shared Items Options

+ +
+
+

Google Reader

+ + + + + + + + + +
+ +

+
+
+', ($class != '') ? " class=\"$class\"" : ''); + $feed = simplexml_load_file($feedurl); + $loopcount = 0; + + foreach ($feed->entry as $item) { + if ($loopcount < $display) { + printf('
  • %s - %s
  • ',$item->link[1]['href'],$item->title,$item->source->title); + $loopcount++; + } + } + echo(''); + } +} + +function readerShared_Menu() { + add_options_page('Google Reader Shared Options', 'Google Reader', 9, basename(__FILE__)); +} + +add_action('admin_menu', 'readerShared_Menu'); +?> \ No newline at end of file diff --git a/weighted_categories.php b/weighted_categories.php new file mode 100644 index 0000000..d391472 --- /dev/null +++ b/weighted_categories.php @@ -0,0 +1,35 @@ +cat_name; + $counts[$catname] = $cat->category_count; + $catlinks[$catname] = $cat->category_nicename; + } + + // calculate the font sizes but always fall back to a safe value + $spread = (max($counts) - min($counts)) <= 0 ? max($counts) - min($counts) : 1; + $fontspread = ($largest - $smallest) <= 0 ? $largest - $smallest : 1; + $fontstep = $spread / $fontspread; + + // print the links out + foreach ($counts as $catname => $count) + { + $catlink = $catlinks[$catname]; + $fontsize = ($smallest + ($count/$fontstep)) . $unit; + echo("$catname\n"); + } +} +?> \ No newline at end of file -- cgit v1.2.3