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

/*
 * buzzword
 * Copyright (c) 2003 Jon Tai
 *
 * $Id: newsubscription.php 21 2004-04-28 16:26:53Z 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';
force_admin_login();

if (get_request_var('subscription-submit')) {
    $subscription = new planet_subscription(mysql_unique_key(DB_PREFIX.'planet_subscriptions', 'subscription_key'));
    $subscription->title = ($title = get_request_var('title')) ? $title : 'subscription';
    $subscription->url = ($url = get_request_var('url')) ? $url : '';
    $subscription->feed_url = ($feed_url = get_request_var('feed_url')) ? $feed_url : '';
    $subscription->icon = class_exists('gallery_image') ? new gallery_image(get_request_var('highlight')) : 0;
    $subscription->create();
  
    header('Location: subscription.php?s='.$subscription->subscription_key);
    exit;
}

include '../includes/header.inc';

?>
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr>
<td id="content">
<h1>new subscription</h1>
<div class="content-container">
<?php
if (class_exists('gallery_image')) {
?>
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="gallery-highlight">
<a href="#" onClick="gallery_filebrowser_popup('subscription', ''); return false;">
<img name="highlight" src="../gallery/images/spacer.gif" width=<?php echo
 get_pref('gallery_thumb_width'); ?> height=<?php echo
 round(get_pref('gallery_thumb_width') * 3 / 4); ?> alt=""></a>
</td>
<td class="gallery-description">
Click on the image to choose a new icon for this subscription.
</td>
</tr>
</table>
<?php

}

?>
<form name="subscription" method="post" action="newsubscription.php">
<input type="hidden" name="highlight" value="">
<input type="hidden" name="subscription-submit" value="1">
<p>subscription title:<br>
<input type="text" name="title" class="input"></p>
<p>subscription url:<br>
<input type="text" name="url" class="input"></p>
<p>subscription feed url:<br>
<input type="text" name="feed_url" class="input"></p>
<p><input type="submit" value="save" class="submit"></p>
</form>
</div>
</td>
</tr>
</table>
<?php

include '../includes/footer.inc';

?>
Return current item: Buzzword