* * Distributed under the GPL - see LICENSE * */ /* FIXME: add form fallbacks for ajax actions */ require_once 'fof-main.php'; include 'header.php'; function pretty_time($t) { return strftime('%c', $t); } $p = &FoF_Prefs::instance(); $fof_admin_prefs = $p->admin_prefs; if (empty($_GET['feed'])) { echo '

No Feed

Nothing to detail.
' . "\n"; die(); } $feed_id = $_GET['feed']; /* handle updates */ $messages = array(); if (isset($_POST['alt_title'])) { if (fof_db_subscription_title_set(fof_current_user(), $feed_id, $_POST['alt_title'])) { if (empty($_POST['alt_title'])) { $messages[] = 'Cleared custom title.'; } else { $messages[] = 'Set custom title to "' . $_POST['alt_title'] . '"'; } } else { $messages[] = 'Failed to set custom title!'; } } if (isset($_POST['alt_image'])) { if (fof_db_subscription_image_set(fof_current_user(), $feed_id, $_POST['alt_image'])) { if (empty($_POST['alt_image'])) { $messages[] = 'Cleared custom image.'; } else { $messages[] = 'Set custom image to "' . $_POST['alt_image'] . '"'; } } else { $messages[] = 'Failed to set custom image!'; } } if (isset($_POST['new_tag'])) { if (fof_tag_feed(fof_current_user(), $feed_id, $_POST['new_tag'])) { $messages[] = 'Feed will now be tagged with "' . $_POST['new_tag'] . '"'; } else { $messages[] = 'Failed to set tag on feed!'; } } if (!empty($messages)) { echo '
'; foreach ($messages as $msg) { echo '
' . $msg . '
' . "\n"; } echo '
' . "\n"; /* sidebar will be wrong until refreshed */ echo ''; } /* let admin see any feed */ if (fof_is_admin()) { echo '

Admin Feed Details

' . "\n"; echo '
' . "\n"; echo '

Subscribers

' . "\n"; echo '' . "\n"; echo '
' . "\n"; } elseif (fof_db_is_subscribed_id(fof_current_user(), $feed_id)) { echo '

Feed Details

' . "\n"; } else { echo '

Not Subscribed

You don\'t know anything about that feed.
' . "\n"; die(); } if (fof_is_admin() && !fof_db_is_subscribed_id(fof_current_user(), $feed_id)) { /* fof_get_feed expects a subscription, so shirk that and just populate overall stats */ $feed_row = fof_db_get_feed_by_id($feed_id); fof_db_subscription_feed_fix($feed_row); list($feed_row['feed_items'], $feed_row['feed_tagged'], $counts) = fof_db_feed_counts(fof_current_user(), $feed_id); $feed_row = array_merge(array('tags' => array(), 'feed_unread' => 0, 'feed_read' => 0, 'feed_starred' => 0, 'feed_age' => $feed_row['feed_cache_date']), $feed_row); list($feed_row['agestr'], $feed_row['agestrabbr']) = fof_nice_time_stamp($feed_row['feed_cache_date']); $max_stmt = fof_db_get_latest_item_age(fof_current_user(), $feed_id); $feed_row['max_date'] = fof_db_get_row($max_stmt, 'max_date', TRUE); list($feed_row['lateststr'], $feed_row['lateststrabbr']) = fof_nice_time_stamp($feed_row['max_date']); /* not subscribed, so no subscription preferences to change.. */ $admin_view = true; } else { $feed_row = fof_get_feed(fof_current_user(), $feed_id); $admin_view = false; } /* only include the update scripts if subscribed */ if (!$admin_view || fof_db_is_subscribed_id(fof_current_user(), $feed_id)) { $feed_id_js = json_encode($feed_id); ?>

General

Item Counts

Item History

New items per day (today at left)
' . "\n"; echo '

Purge Potential

' . "\n"; /* NOTE: not accurate, don't know how many items were listed in latest feed fetch */ $purge_statement = fof_db_items_purge_list($feed_id, $fof_admin_prefs['purge'], $fof_admin_prefs['purge_grace'], array('folded')); $purge_items = $purge_statement->fetchAll(); $purge_count = count($purge_items); echo '
' . ($purge_count ? $purge_count : 'No') . ' item' . ($purge_count == 1 ? '' : 's') . ' likely to be purged on next update.
' . "\n"; echo '' . "\n"; } ?>

Dates

Tags Automatically Applied to Items from this Feed