egroupware_official/admin/newheadline.php

116 lines
3.9 KiB
PHP
Raw Normal View History

2000-08-18 05:24:22 +02:00
<?php
/**************************************************************************\
* phpGroupWare - administration *
* http://www.phpgroupware.org *
* -------------------------------------------- *
* This program 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. *
\**************************************************************************/
/* $Id$ */
if ($submit) {
$phpgw_info["flags"] = array("noheader" => True, "nonavbar" => True);
2000-08-18 05:24:22 +02:00
}
$phpgw_info["flags"]["currentapp"] = "admin";
2000-08-18 05:24:22 +02:00
include("../header.inc.php");
if (! $submit) {
?>
2000-09-03 22:25:31 +02:00
<form method="POST" action="<?php echo $phpgw->link("newheadline.php"); ?>">
2000-08-18 05:24:22 +02:00
<center>
<table border=0 width=65%>
<tr>
2000-09-07 22:49:55 +02:00
<td><?php echo lang("Display"); ?></td>
2000-08-18 05:24:22 +02:00
<td><input name="n_display"></td>
</tr>
<tr>
2000-09-07 22:49:55 +02:00
<td><?php echo lang("Base URL"); ?></td>
2000-08-18 05:24:22 +02:00
<td><input name="n_base_url"></td>
</tr>
<tr>
2000-09-07 22:49:55 +02:00
<td><?php echo lang("News File"); ?></td>
2000-08-18 05:24:22 +02:00
<td><input name="n_newsfile"></td>
</tr>
<tr>
2000-09-07 22:49:55 +02:00
<td><?php echo lang("Minutes between Reloads"); ?></td>
2000-08-18 05:24:22 +02:00
<td><input name="n_cachetime"></td>
</tr>
<tr>
2000-09-07 22:49:55 +02:00
<td><?php echo lang("Listings Displayed"); ?></td>
2000-08-18 05:24:22 +02:00
<td><input name="n_listings"></td>
</tr>
<tr>
2000-09-07 22:49:55 +02:00
<td><?php echo lang("News Type"); ?></td>
2000-08-18 05:24:22 +02:00
<td>
<?
$news_type = array('rdf','fm','lt','sf','rdf-chan');
for($i=0;$i<count($news_type);$i++) {
echo "<input type=\"radio\" name=\"n_newstype\" value=\""
. $news_type[$i] . "\">&nbsp;$news_type[$i]<br>";
}
?>
</td>
</tr>
<tr>
<td colspan=2>
2000-09-07 22:49:55 +02:00
<input type="submit" name="submit" value="<?php echo lang("submit"); ?>">
2000-08-18 05:24:22 +02:00
</td>
</tr>
</table>
</center>
</form>
<?php
include($phpgw_info["server"]["api_dir"] . "/footer.inc.php");
} else {
if (! $n_display)
2000-09-07 22:49:55 +02:00
$error = "<br>" . lang("You must enter a display");
2000-08-18 05:24:22 +02:00
if (! $n_base_url)
2000-09-07 22:49:55 +02:00
$error = "<br>" . lang("You must enter a base url");
2000-08-18 05:24:22 +02:00
if (! $n_newsfile)
2000-09-07 22:49:55 +02:00
$error = "<br>" . lang("You must enter a news url");
2000-08-18 05:24:22 +02:00
if (! $n_cachetime)
2000-09-07 22:49:55 +02:00
$error = "<br>" . lang("You must enter the number of minutes between reload");
2000-08-18 05:24:22 +02:00
if (! $n_listings)
2000-09-07 22:49:55 +02:00
$error = "<br>" . lang("You must enter the number of listings display");
2000-08-18 05:24:22 +02:00
if (! $n_newstype)
2000-09-07 22:49:55 +02:00
$error = "<br>" . lang("You must select a file type");
2000-08-18 05:24:22 +02:00
if ($error)
exit;
$phpgw->db->query("select display from news_site where base_url='"
. addslashes(strtolower($n_base_url)) . "' and newsfile='"
. addslashes(strtolower($n_newsfile)) . "'");
$phpgw->db->next_record();
if ($phpgw->db->f("display")) {
navigation_bar();
2000-09-07 22:49:55 +02:00
echo "<center>" . lang("That site has already been entered") . "</center>";
2000-08-18 05:24:22 +02:00
exit;
}
$phpgw->db->lock("news_site");
$sql = "insert into news_site (display,base_url,newsfile,"
. "lastread,newstype,cachetime,listings) "
. "values ('" . addslashes($n_display) . "','"
. addslashes(strtolower($n_base_url)) . "','"
. addslashes(strtolower($n_newsfile)) . "',0,'"
. $n_newstype . "',$n_cachetime,$n_listings)";
$phpgw->db->query($sql);
$phpgw->db->unlock();
Header("Location: " . $phpgw->link($directorys["webserver_url"]
. "/admin/headlines.php", "cd=28"));
}
?>