Location: PHPKode > projects > Buzzword > buzzword-0.8.12/planet/subscription.php
<?php

/*
 * buzzword
 * Copyright (c) 2003 Jon Tai
 *
 * $Id: subscription.php 20 2004-04-27 23:53:26Z brad $
 *
 * This file is part of buzzword.
 *
 * buzzword is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * buzzword 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 General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with buzzword; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

require_once './config.inc';

$subscription = new planet_subscription(import_planet_subscription_key());
if (!$subscription->exists())
    display_error('subscription does not exist');

// refresh cache
$subscription->fetch_feed();

$BUZZWORD_BREADCRUMBS[] = "<a href=\"subscription.php?e={$subscription->subscription_key}\">".$subscription->get_display_short_title()."</a>";
include_once '../includes/header.inc';

?>
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr>
<td id="content">
<h1><?php echo $subscription->get_display_short_title(); ?></h1>
<?php

$entries = get_planet_entries($subscription->subscription_key);
$display_icon = true;

foreach ($entries as $entry) {

?>
<div class="content-container">
<h2><a href="<?php echo $entry->trackback_url; ?>"><?php echo $entry->title; ?></a></h2>
<?php

    // display the subscription's icon once
    if ($display_icon) {
        $display_icon = false;

        if ($subscription->icon != 0 && $subscription->icon->exists()) {

?>
<div class="planet-icon"><a href="subscription.php?s=<?php echo $entry->parent->subscription_key; ?>"><img 
 src="../gallery/thumb.php?i=<?php echo $entry->parent->icon->image_key; ?>" <?php echo $entry->parent->icon->get_alt(); ?> 
 border="0" <?php echo $entry->parent->icon->get_thumb_size(); ?>></a></div>
<?php

        }
    }

?>
<p><?php echo $entry->get_display_body(); ?></p>
<span class="planet-date">
<?php 

echo '<a href="'.$entry->trackback_url.'">('.$entry->get_display_date_created()
     .' '.$entry->get_display_time_created().')</a>';

?></span>
</div>
<?php

}

?>
</td>
<td id="sidebar">
<h1>this subscription</h1>
<div class="sidebar-container">
<p>
<?php

echo 'last fetched: '.$subscription->get_display_date_last_retrieved()
     .' '.$subscription->get_display_time_last_retrieved()."<br>\n";
echo 'url: <a href="'.$subscription->url.'">'.$subscription->get_display_short_url()."</a><br>\n";
echo 'feed url: <a href="'.$subscription->feed_url.'">'.$subscription->get_display_short_feed_url()."</a><br><br>\n";
echo str_plural(count($entries), "entry", "entries")." in this subscription<br>\n";

?>
</p>
</div>
<h1>subscriptions</h1>
<div class="sidebar-container">
<p>
<?php

echo get_sidebar_planet_subscriptions();

?>
</p>
</div>
<?php

echo relevance_hook('planet_subscription', $subscription->subscription_key);

?>
<?php if (defined('ADMIN_LOGGED_IN')) { ?>
<h1>administration</h1>
<div class="sidebar-container">
<p>
<a href="newsubscription.php">new subscription</a><br>
<a href="editsubscription.php?s=<?php echo $subscription->subscription_key; ?>">edit subscription</a><br>
<a href="delsubscription.php?s=<?php echo $subscription->subscription_key; ?>">delete subscription</a><br>
<a href="../admin/preferences.php">preferences</a><br>
<a href="../admin/index.php?admin-logout=1">log out</a><br>
</p>
</div>
<?php } ?>
</td>
</tr>
</table>
<?php

include_once '../includes/footer.inc';

?>
Return current item: Buzzword