[geeklog-cvs] geeklog-1.3/public_html/admin block.php,1.63,1.64 syndication.php,1.6,1.7
dhaun at iowaoutdoors.org
dhaun at iowaoutdoors.org
Sun Jan 23 06:07:20 EST 2005
Update of /var/cvs/geeklog-1.3/public_html/admin
In directory www:/tmp/cvs-serv31343/public_html/admin
Modified Files:
block.php syndication.php
Log Message:
Incorporated new framework for reading and writing feeds (RSS, RDF, Atom), provided by Michael Jervis.
Index: block.php
===================================================================
RCS file: /var/cvs/geeklog-1.3/public_html/admin/block.php,v
retrieving revision 1.63
retrieving revision 1.64
diff -C2 -d -r1.63 -r1.64
*** block.php 29 Sep 2004 17:43:43 -0000 1.63
--- block.php 23 Jan 2005 11:07:18 -0000 1.64
***************
*** 9,18 ****
// | Geeklog block administration. |
// +---------------------------------------------------------------------------+
! // | Copyright (C) 2000-2004 by the following authors: |
// | |
! // | Authors: Tony Bibbs - tony at tonybibbs.com |
! // | Mark Limburg - mlimburg at users.sourceforge.net |
! // | Jason Whittenburg - jwhitten at securitygeeks.com |
! // | Dirk Haun - dirk at haun-online.de |
// +---------------------------------------------------------------------------+
// | |
--- 9,19 ----
// | Geeklog block administration. |
// +---------------------------------------------------------------------------+
! // | Copyright (C) 2000-2005 by the following authors: |
// | |
! // | Authors: Tony Bibbs - tony AT tonybibbs DOT com |
! // | Mark Limburg - mlimburg AT users DOT sourceforge DOT net |
! // | Jason Whittenburg - jwhitten AT securitygeeks DOT com |
! // | Dirk Haun - dirk AT haun-online DOT de |
! // | Michael Jervis - mike AT fuckingbrit DOT com |
// +---------------------------------------------------------------------------+
// | |
***************
*** 38,42 ****
// to the script. This will sometimes cause errors but it will allow you to see
// the data being passed in a POST operation
! // echo COM_debug($HTTP_POST_VARS);
require_once ('../lib-common.php');
--- 39,43 ----
// to the script. This will sometimes cause errors but it will allow you to see
// the data being passed in a POST operation
! // echo COM_debug($_POST);
require_once ('../lib-common.php');
***************
*** 167,171 ****
if (!empty($bid)) {
! $result = DB_query("SELECT * FROM {$_TABLES['blocks']} where bid ='$bid'");
$A = DB_fetchArray($result);
$access = SEC_hasAccess($A['owner_id'],$A['group_id'],$A['perm_owner'],$A['perm_group'],$A['perm_members'],$A['perm_anon']);
--- 168,172 ----
if (!empty($bid)) {
! $result = DB_query("SELECT * FROM {$_TABLES['blocks']} WHERE bid ='$bid'");
$A = DB_fetchArray($result);
$access = SEC_hasAccess($A['owner_id'],$A['group_id'],$A['perm_owner'],$A['perm_group'],$A['perm_members'],$A['perm_anon']);
***************
*** 300,303 ****
--- 301,306 ----
$block_templates->set_var('max_url_length', 255);
$block_templates->set_var('block_rdfurl', $A['rdfurl']);
+ $block_templates->set_var('lang_rdflimit', $LANG21[62]);
+ $block_templates->set_var('block_rdflimit', $A['rdflimit']);
$block_templates->set_var('lang_lastrdfupdate', $LANG21[15]);
$block_templates->set_var('block_rdfupdated', $A['rdfupdated']);
***************
*** 324,327 ****
--- 327,331 ----
* @param string $rdfurl URL to headline feed for portal blocks
* @param string $rdfupdated Date RSS/RDF feed was last updated
+ * @param string $rdflimit max. number of entries to import from feed
* @param string $phpblockfn Name of php function to call to get content
* @param int $onleft Flag indicates if block shows up on left or right
***************
*** 336,342 ****
*
*/
! function saveblock ($bid, $name, $title, $help, $type, $blockorder, $content, $tid, $rdfurl, $rdfupdated, $phpblockfn, $onleft, $owner_id, $group_id, $perm_owner, $perm_group, $perm_members, $perm_anon, $is_enabled)
{
! global $_CONF, $_TABLES, $LANG01, $LANG21, $MESSAGE, $HTTP_POST_VARS;
$retval = '';
--- 340,346 ----
*
*/
! function saveblock ($bid, $name, $title, $help, $type, $blockorder, $content, $tid, $rdfurl, $rdfupdated, $rdflimit, $phpblockfn, $onleft, $owner_id, $group_id, $perm_owner, $perm_group, $perm_members, $perm_anon, $is_enabled)
{
! global $_CONF, $_TABLES, $LANG01, $LANG21, $MESSAGE, $_POST;
$retval = '';
***************
*** 384,387 ****
--- 388,392 ----
$rdfurl = '';
$rdfupdated = '';
+ $rdflimit = 0;
$phpblockfn = '';
}
***************
*** 405,424 ****
$rdfurl = '';
$rdfupdated = '';
}
if ($type == 'normal') {
$rdfurl = '';
$rdfupdated = '';
$phpblockfn = '';
$content = addslashes ($content);
}
! if ($type == 'layout') {
! $rdfurl = '';
! $rdfupdated = '';
! $phpblockfn = '';
}
$title = addslashes (COM_stripslashes ($title));
$phpblockfn = addslashes (COM_stripslashes ($phpblockfn));
! DB_save($_TABLES['blocks'],'bid,name,title,help,type,blockorder,content,tid,rdfurl,rdfupdated,phpblockfn,onleft,owner_id,group_id,perm_owner,perm_group,perm_members,perm_anon,is_enabled',"$bid,'$name','$title','$help','$type','$blockorder','$content','$tid','$rdfurl','$rdfupdated','$phpblockfn',$onleft,$owner_id,$group_id,$perm_owner,$perm_group,$perm_members,$perm_anon,$is_enabled");
if (($type == 'gldefault') && ($name == 'older_stories')) {
--- 410,429 ----
$rdfurl = '';
$rdfupdated = '';
+ $rdflimit = 0;
}
if ($type == 'normal') {
$rdfurl = '';
$rdfupdated = '';
+ $rdflimit = 0;
$phpblockfn = '';
$content = addslashes ($content);
}
! if ($rdflimit < 0) {
! $rdflimit = 0;
}
$title = addslashes (COM_stripslashes ($title));
$phpblockfn = addslashes (COM_stripslashes ($phpblockfn));
! DB_save($_TABLES['blocks'],'bid,name,title,help,type,blockorder,content,tid,rdfurl,rdfupdated,rdflimit,phpblockfn,onleft,owner_id,group_id,perm_owner,perm_group,perm_members,perm_anon,is_enabled',"$bid,'$name','$title','$help','$type','$blockorder','$content','$tid','$rdfurl','$rdfupdated','$rdflimit','$phpblockfn',$onleft,$owner_id,$group_id,$perm_owner,$perm_group,$perm_members,$perm_anon,$is_enabled");
if (($type == 'gldefault') && ($name == 'older_stories')) {
***************
*** 569,578 ****
function moveBlock()
{
! global $_CONF, $_TABLES, $LANG21, $HTTP_GET_VARS;
$retval = '';
! $bid = $HTTP_GET_VARS['bid'];
! $where = $HTTP_GET_VARS['where'];
// if the block id exists
--- 574,583 ----
function moveBlock()
{
! global $_CONF, $_TABLES, $LANG21, $_GET;
$retval = '';
! $bid = $_GET['bid'];
! $where = $_GET['where'];
// if the block id exists
***************
*** 649,667 ****
// MAIN
! if (isset ($HTTP_POST_VARS['mode'])) {
! $mode = $HTTP_POST_VARS['mode'];
! }
! else {
! $mode = $HTTP_GET_VARS['mode'];
! }
! if (isset ($HTTP_POST_VARS['bid'])) {
! $bid = COM_applyFilter ($HTTP_POST_VARS['bid']);
! }
! else {
! $bid = COM_applyFilter ($HTTP_GET_VARS['bid']);
! }
! if (isset($HTTP_POST_VARS['blkChange'])) {
! changeBlockStatus($HTTP_POST_VARS['blkChange']);
}
--- 654,662 ----
// MAIN
! $mode = $_REQUEST['mode'];
! $bid = COM_applyFilter ($_REQUEST['bid']);
! if (isset ($_POST['blkChange'])) {
! changeBlockStatus ($_POST['blkChange']);
}
***************
*** 674,687 ****
}
} else if (($mode == $LANG21[54]) && !empty ($LANG21[54])) { // save
! $display .= saveblock ($bid, $HTTP_POST_VARS['name'],
! $HTTP_POST_VARS['title'], $HTTP_POST_VARS['help'],
! $HTTP_POST_VARS['type'], $HTTP_POST_VARS['blockorder'],
! $HTTP_POST_VARS['content'], $HTTP_POST_VARS['tid'],
! $HTTP_POST_VARS['rdfurl'], $HTTP_POST_VARS['rdfupdated'],
! $HTTP_POST_VARS['phpblockfn'], $HTTP_POST_VARS['onleft'],
! $HTTP_POST_VARS['owner_id'], $HTTP_POST_VARS['group_id'],
! $HTTP_POST_VARS['perm_owner'], $HTTP_POST_VARS['perm_group'],
! $HTTP_POST_VARS['perm_members'], $HTTP_POST_VARS['perm_anon'],
! $HTTP_POST_VARS['is_enabled']);
} else if ($mode == 'edit') {
$display .= COM_siteHeader ()
--- 669,681 ----
}
} else if (($mode == $LANG21[54]) && !empty ($LANG21[54])) { // save
! $display .= saveblock ($bid, $_POST['name'], $_POST['title'],
! $_POST['help'], $_POST['type'], $_POST['blockorder'],
! $_POST['content'], $_POST['tid'], $_POST['rdfurl'],
! $_POST['rdfupdated'],
! COM_applyFilter ($_POST['rdflimit'], true),
! $_POST['phpblockfn'], $_POST['onleft'],
! $_POST['owner_id'], $_POST['group_id'], $_POST['perm_owner'],
! $_POST['perm_group'], $_POST['perm_members'],
! $_POST['perm_anon'], $_POST['is_enabled']);
} else if ($mode == 'edit') {
$display .= COM_siteHeader ()
***************
*** 696,703 ****
$display .= COM_siteHeader ();
$msg = 0;
! if (isset ($HTTP_POST_VARS['msg'])) {
! $msg = COM_applyFilter ($HTTP_POST_VARS['msg'], true);
! } else if (isset ($HTTP_GET_VARS['msg'])) {
! $msg = COM_applyFilter ($HTTP_GET_VARS['msg'], true);
}
if ($msg > 0) {
--- 690,697 ----
$display .= COM_siteHeader ();
$msg = 0;
! if (isset ($_POST['msg'])) {
! $msg = COM_applyFilter ($_POST['msg'], true);
! } else if (isset ($_GET['msg'])) {
! $msg = COM_applyFilter ($_GET['msg'], true);
}
if ($msg > 0) {
Index: syndication.php
===================================================================
RCS file: /var/cvs/geeklog-1.3/public_html/admin/syndication.php,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** syndication.php 13 Jan 2004 19:15:52 -0000 1.6
--- syndication.php 23 Jan 2005 11:07:18 -0000 1.7
***************
*** 9,15 ****
// | Geeklog content syndication administration |
// +---------------------------------------------------------------------------+
! // | Copyright (C) 2003-2004 by the following authors: |
// | |
! // | Authors: Dirk Haun - dirk at haun-online.de |
// +---------------------------------------------------------------------------+
// | |
--- 9,16 ----
// | Geeklog content syndication administration |
// +---------------------------------------------------------------------------+
! // | Copyright (C) 2003-2005 by the following authors: |
// | |
! // | Authors: Dirk Haun - dirk AT haun-online DOT de |
! // | Michael Jervis - mike AT fuckingbrit DOT com |
// +---------------------------------------------------------------------------+
// | |
***************
*** 77,80 ****
--- 78,82 ----
$feed_template->set_var ('lang_filename', $LANG33[16]);
$feed_template->set_var ('lang_format', $LANG33[17]);
+ $feed_template->set_var ('lang_version', $LANG33[43]);
$feed_template->set_var ('lang_updated', $LANG33[18]);
$feed_template->set_var ('lang_enabled', $LANG33[19]);
***************
*** 103,106 ****
--- 105,109 ----
$feed_template->set_var ('feed_type', ucwords ($A['type']));
$feed_template->set_var ('feed_format', ucwords ($A['format']));
+ $feed_template->set_var ('feed_version', $A['version']);
$feed_template->set_var ('feed_filename', $A['filename']);
$feed_template->set_var ('feed_filename_and_link', $link);
***************
*** 124,131 ****
/**
! * Create a list of all available feed formats. Assumes there is a class named
! * xxx.feed.class.php for every format "xxx" (in system/classes).
*
! * @return array array of names of feed formats (and classes)
*
*/
--- 127,133 ----
/**
! * Get a list of feed formats from the feed parser factory.
*
! * @return array array of names of feed formats (and versions)
*
*/
***************
*** 134,145 ****
global $_CONF;
! $formats = array ();
! $fd = opendir ($_CONF['path_system'] . '/classes');
! while (($file = @readdir ($fd)) !== false) {
! if (preg_match ('/(.*)\.feed\.class\.php$/i', $file, $match)) {
! $formats[] = $match[1];
! }
! }
sort ($formats);
--- 136,145 ----
global $_CONF;
! // Import the feed handling classes:
! require_once ($_CONF['path_system']
! . '/classes/syndication/parserfactory.class.php');
+ $factory = new FeedParserFactory ();
+ $formats = $factory->getFeedTypes ();
sort ($formats);
***************
*** 204,208 ****
$A['fid'] = $fid;
$A['type'] = $type;
! $A['format'] = 'rss';
$A['limits'] = $_CONF['rdf_limit'];
$A['content_length'] = $_CONF['rdf_storytext'];
--- 204,208 ----
$A['fid'] = $fid;
$A['type'] = $type;
! $A['format'] = 'rss-0.9x';
$A['limits'] = $_CONF['rdf_limit'];
$A['content_length'] = $_CONF['rdf_storytext'];
***************
*** 265,273 ****
$selection = '<select name="format">' . LB;
foreach ($formats as $f) {
! $selection .= '<option value="' . $f . '"';
! if ($A['format'] == $f) {
$selection .= ' selected="selected"';
}
! $selection .= '>' . ucwords ($f) . '</option>' . LB;
}
$selection .= '</select>' . LB;
--- 265,275 ----
$selection = '<select name="format">' . LB;
foreach ($formats as $f) {
! $selection .= '<option value="' . $f['name'] . '-' . $f['version']
! . '"';
! if ($A['format'] == $f['name'] . '-' . $f['version']) {
$selection .= ' selected="selected"';
}
! $selection .= '>' . ucwords ($f['name'] . ' ' . $f['version'])
! . '</option>' . LB;
}
$selection .= '</select>' . LB;
***************
*** 480,517 ****
$display = '';
! if (count ($HTTP_POST_VARS) == 0) {
! $http_input_vars = $HTTP_GET_VARS;
! } else {
! $http_input_vars = $HTTP_POST_VARS;
! }
!
! if ($http_input_vars['mode'] == 'edit') {
! if ($http_input_vars['fid'] == 0) {
$display .= newfeed ();
} else {
$display .= COM_siteHeader ('menu')
! . editfeed ($http_input_vars['fid'])
. COM_siteFooter ();
}
}
! else if (($http_input_vars['mode'] == $LANG33[1]) && !empty ($LANG33[1]))
{
$display .= COM_siteHeader ('menu')
! . editfeed (0, $http_input_vars['type'])
. COM_siteFooter ();
}
! else if (($http_input_vars['mode'] == $LANG33[2]) && !empty ($LANG33[2]))
{
! $display .= savefeed ($http_input_vars);
}
! else if (($http_input_vars['mode'] == $LANG33[3]) && !empty ($LANG33[3]))
{
! $display .= deletefeed ($http_input_vars['fid']);
}
else
{
$display .= COM_siteHeader ('menu');
! if (isset ($http_input_vars['msg'])) {
! $display .= COM_showMessage ($http_input_vars['msg']);
}
$display .= listfeeds ()
--- 482,513 ----
$display = '';
! if ($_REQUEST['mode'] == 'edit') {
! if ($_REQUEST['fid'] == 0) {
$display .= newfeed ();
} else {
$display .= COM_siteHeader ('menu')
! . editfeed ($_REQUEST['fid'])
. COM_siteFooter ();
}
}
! else if (($_REQUEST['mode'] == $LANG33[1]) && !empty ($LANG33[1]))
{
$display .= COM_siteHeader ('menu')
! . editfeed (0, $_REQUEST['type'])
. COM_siteFooter ();
}
! else if (($_REQUEST['mode'] == $LANG33[2]) && !empty ($LANG33[2]))
{
! $display .= savefeed ($_REQUEST);
}
! else if (($_REQUEST['mode'] == $LANG33[3]) && !empty ($LANG33[3]))
{
! $display .= deletefeed ($_REQUEST['fid']);
}
else
{
$display .= COM_siteHeader ('menu');
! if (isset ($_REQUEST['msg'])) {
! $display .= COM_showMessage ($_REQUEST['msg']);
}
$display .= listfeeds ()
More information about the geeklog-cvs
mailing list