示例#1
0
    echo "  <td align=right>";
    foreach ($tags as $tag) {
        echo $tag . ' <a href="' . fof_url('prefs.php', array('untagfeed' => $id, 'tag' => $tag), $anchor) . '">[x]</a> ';
    }
    echo "</td>\n";
    $title = htmlspecialchars($title);
    echo "  <td>\n    <form method=\"post\" action=\"prefs.php#{$anchor}\">\n      <input type=\"hidden\" name=\"feed_id\" value=\"{$id}\">\n      <input type=\"text\" name=\"tag\">\n      <input type=\"submit\" name=\"tagfeed\" value=\"Tag Feed\"> <small><i>(separate tags with spaces)</i></small>\n    </form>\n  </td>\n";
    echo "</tr>\n";
}
?>
</table>
</div>


<?php 
if (fof_is_admin()) {
    ?>

<br><h1 id="adminprefs">Feed on Feeds - Admin Options</h1>
<form method="post" action="prefs.php#adminprefs" style="border: 1px solid black; margin: 10px; padding: 10px;">
Enable logging? <input type=checkbox name="logging" <?php 
    echo $prefs->get('logging') ? "checked" : '';
    ?>
> Log Topic Restriction (space separated): <input type="text" name="log_topics" value="<?php 
    echo $prefs->get('log_topics');
    ?>
"><br><br>
Purge read items after <input size="4" type="text" name=purge value="<?php 
    echo $prefs->get('purge');
    ?>
"> days (leave blank to never purge)<br><br>
示例#2
0
    echo '<h2>Subscribers</h2>' . "\n";
    echo '<ul>' . "\n";
    $sub_statement = fof_db_get_subscribed_users($feed_id);
    $users = fof_db_get_users();
    while (($subscriber = fof_db_get_row($sub_statement, 'user_id')) !== false) {
        echo '<li>' . $users[$subscriber]['user_name'] . ' (' . $subscriber . ')</li>' . "\n";
    }
    echo '</ul>' . "\n";
    echo '</div>' . "\n";
} elseif (fof_db_is_subscribed_id(fof_current_user(), $feed_id)) {
    echo '<h1>Feed Details</h1>' . "\n";
} else {
    echo '<div class="error"><h1>Not Subscribed</h1>You don\'t know anything about that feed.</div>' . "\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;
}