[geeklog-cvs] geeklog-1.3/public_html lib-common.php,1.243,1.244 submit.php,1.54,1.55
geeklog-cvs-admin at lists.geeklog.net
geeklog-cvs-admin at lists.geeklog.net
Tue Aug 12 17:10:07 EDT 2003
- Previous message (by thread): [geeklog-cvs] geeklog-1.3/public_html/layout/Classic/admin/syndication feededitor.thtml,NONE,1.1 listfeeds.thtml,NONE,1.1 listitem.thtml,NONE,1.1 selecttype.thtml,NONE,1.1
- Next message (by thread): [geeklog-cvs] geeklog-1.3/public_html/admin syndication.php,NONE,1.1 moderation.php,1.41,1.42 story.php,1.99,1.100
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /usr/cvs/geeklog/geeklog-1.3/public_html
In directory geeklog_prod:/tmp/cvs-serv26144/public_html
Modified Files:
lib-common.php submit.php
Log Message:
Admin interface for Content Syndication; Extensions to the Plugin API to allow plugins to create feeds; Other feed formats can be implemented as classes.
Index: lib-common.php
===================================================================
RCS file: /usr/cvs/geeklog/geeklog-1.3/public_html/lib-common.php,v
retrieving revision 1.243
retrieving revision 1.244
diff -C2 -d -r1.243 -r1.244
*** lib-common.php 5 Aug 2003 19:03:50 -0000 1.243
--- lib-common.php 12 Aug 2003 21:10:04 -0000 1.244
***************
*** 143,146 ****
--- 143,153 ----
/**
+ * This is the syndication library used to offer (RSS) feeds.
+ *
+ */
+
+ require_once( $_CONF['path_system'] . 'lib-syndication.php' );
+
+ /**
* This is the custom library.
*
***************
*** 1268,1506 ****
/**
- * Creates a vaild RDF file from the stories
*
! * The core of this code has been lifted from phpweblog which is licenced
! * under the GPL. It has since been heavily modified.
*
! * @see function COM_rdfUpToDateCheck
*
*/
!
! function COM_exportRDF()
{
! global $_TABLES, $_CONF, $LANG01;
if( $_CONF['backend'] > 0 )
{
! $outputfile = $_CONF['rdf_file'];
! if( !empty( $_CONF['default_charset'] ))
! {
! $rdencoding = $_CONF['default_charset'];
! }
! else
! {
! $rdencoding = 'UTF-8';
! }
! $rdtitle = htmlspecialchars( $_CONF['site_name'] );
! $rdlink = $_CONF['site_url'];
! $rddescr = htmlspecialchars( $_CONF['site_slogan'] );
! if( !empty( $_CONF['rdf_language'] ))
! {
! $rdlang = $_CONF['rdf_language'];
! }
! else
! {
! $rdlang = $_CONF['locale'];
! }
!
! $where = '';
! if( !empty( $_CONF['rdf_limit'] ))
! {
! if( substr( $_CONF['rdf_limit'], -1 ) == 'h' ) // last xx hours
! {
! $limit = '';
! $hours = substr( $_CONF['rdf_limit'], 0, -1 );
! $where = " AND date >= DATE_SUB(NOW(),INTERVAL $hours HOUR)";
! }
! else
! {
! $limit = ' LIMIT ' . $_CONF['rdf_limit'];
! }
! }
! else
! {
! $limit = ' LIMIT 10';
! }
!
! // get list of topics that anonymous users have access to
! $tresult = DB_query( "SELECT tid FROM {$_TABLES['topics']}"
! . COM_getPermSQL( 'WHERE', 1 ));
! $tnumrows = DB_numRows( $tresult );
! $tlist = '';
! for( $i = 1; $i <= $tnumrows; $i++ )
! {
! $T = DB_fetchArray( $tresult );
! $tlist .= "'" . $T['tid'] . "'";
! if( $i < $tnumrows )
! {
! $tlist .= ',';
! }
! }
! if( !empty( $tlist ))
! {
! $where .= " AND (tid IN ($tlist))";
! }
!
! $result = DB_query( "SELECT sid,title,introtext FROM {$_TABLES['stories']} WHERE draft_flag = 0 AND date <= NOW() $where AND perm_anon > 0 ORDER BY date DESC $limit" );
!
! if( !$file = @fopen( $outputfile, w ))
! {
! COM_errorLog( "{$LANG01[54]} $outputfile", 1 );
! }
! else
{
! fputs( $file, "<?xml version=\"1.0\" encoding=\"$rdencoding\"?>\n\n" );
! fputs( $file, "<!DOCTYPE rss PUBLIC \"-//Netscape Communications//DTD RSS 0.91//EN\"\n \"http://my.netscape.com/publish/formats/rss-0.91.dtd\">\n" );
! fputs( $file, "<rss version=\"0.91\">\n\n" );
! fputs( $file, "<channel>\n" );
! fputs( $file, "<title>$rdtitle</title>\n" );
! fputs( $file, "<link>$rdlink</link>\n" );
! fputs( $file, "<description>$rddescr</description>\n" );
! fputs( $file, "<language>$rdlang</language>\n\n" );
!
! $sids = '';
! $nrows = DB_numRows( $result );
! for( $i = 1; $i <= $nrows; $i++ )
{
! $row = DB_fetchArray( $result );
! $sids .= $row['sid'];
!
! if( $i <> $nrows )
! {
! $sids .= ',';
! }
!
! $title = 'title';
! $link = 'sid';
!
! if( $_CONF['rdf_storytext'] > 0 )
{
! $desc = '<description>';
!
! $storytext = stripslashes( strip_tags( $row['introtext'] ));
! $storytext = trim( $storytext );
! $storytext = preg_replace( "/(\015)/", "", $storytext);
!
! if( $_CONF['rdf_storytext'] > 1 )
! {
! if( strlen( $storytext ) > $_CONF['rdf_storytext'] )
! {
! $storytext = substr( $storytext, 0,
! $_CONF['rdf_storytext'] ) . '...';
! }
! }
!
! $desc .= htmlspecialchars( $storytext )
! . "</description>\n";
}
else
{
! $desc = '';
! }
!
! fputs ( $file, "<item>\n" );
!
! $title = '<title>'
! . htmlspecialchars( stripslashes( $row[$title] ))
! . "</title>\n";
! $link = '<link>' . $_CONF['site_url'] . '/article.php?story='
! . $row[$link] . "</link>\n";
!
! fputs( $file, $title );
! fputs( $file, $link );
! if( !empty( $desc ))
! {
! fputs( $file, $desc );
}
- fputs( $file, "</item>\n\n" );
- }
-
- DB_query( "UPDATE {$_TABLES['vars']} SET value = '$sids' WHERE name = 'rdf_sids'" );
-
- fputs( $file, "</channel>\n" );
- fputs( $file, "</rss>\n" );
- fclose( $file );
- }
- }
- }
-
- /**
- *
- * Checks to see if RDF file needs updating and updates it if so.
- * Checks to see if we need to update the RDF as a result
- * of an article with a future publish date reaching it's
- * publish time and if so updates the RDF file.
- *
- * @see function COM_exportRDF
- *
- */
-
- function COM_rdfUpToDateCheck()
- {
- global $_TABLES, $_CONF;
-
- if( $_CONF['backend'] > 0 )
- {
- $where = '';
- if( !empty( $_CONF['rdf_limit'] ))
- {
- if( substr( $_CONF['rdf_limit'], -1 ) == 'h' ) // last xx hours
- {
- $limit = '';
- $hours = substr( $_CONF['rdf_limit'], 0, -1 );
- $where = " AND date >= DATE_SUB(NOW(),INTERVAL $hours HOUR)";
}
else
{
! $limit = ' LIMIT ' . $_CONF['rdf_limit'];
! }
! }
! else
! {
! $limit = ' LIMIT 10';
! }
!
! // get list of topics that anonymous users have access to
! $tresult = DB_query( "SELECT tid FROM {$_TABLES['topics']}"
! . COM_getPermSQL( 'WHERE', 1 ));
! $tnumrows = DB_numRows( $tresult );
! $tlist = '';
! for( $i = 1; $i <= $tnumrows; $i++ )
! {
! $T = DB_fetchArray( $tresult );
! $tlist .= "'" . $T['tid'] . "'";
! if( $i < $tnumrows )
! {
! $tlist .= ',';
}
! }
! if( !empty( $tlist ))
! {
! $where .= " AND (tid IN ($tlist))";
! }
!
! $result = DB_query( "SELECT sid FROM {$_TABLES['stories']} WHERE draft_flag = 0 AND date <= NOW() $where AND perm_anon > 0 ORDER BY date DESC $limit" );
! $nrows = DB_numRows( $result );
! $sids = '';
!
! for( $i = 1; $i <= $nrows; $i++ )
! {
! $A = DB_fetchArray( $result );
! $sids .= $A['sid'];
!
! if( $i <> $nrows )
{
! $sids .= ',';
}
}
-
- $last_rdf_sids = DB_getItem( $_TABLES['vars'], 'value',
- "name = 'rdf_sids'" );
-
- if( $sids <> $last_rdf_sids )
- {
- COM_exportRDF ();
- }
}
}
--- 1275,1323 ----
/**
*
! * Checks to see if RDF file needs updating and updates it if so.
! * Checks to see if we need to update the RDF as a result
! * of an article with a future publish date reaching it's
! * publish time and if so updates the RDF file.
*
! * @see file lib-syndication.php
*
*/
! function COM_rdfUpToDateCheck()
{
! global $_CONF, $_TABLES;
if( $_CONF['backend'] > 0 )
{
! $result = DB_query( "SELECT fid,type,topic,limits,update_info FROM {$_TABLES['syndication']} WHERE is_enabled = 1" );
! $num = DB_numRows( $result );
! for( $i = 0; $i < $num; $i++)
{
! $A = DB_fetchArray( $result );
! $is_current = true;
! if( $A['type'] == 'geeklog' )
{
! if( $A['topic'] == '::all' )
{
! $is_current = SYND_feedUpdateCheckAll( $A['update_info'],
! $A['limits'] );
}
else
{
! $is_current = SYND_feedUpdateChecktopic( $A['topic'],
! $A['update_info'], $A['limits'] );
}
}
else
{
! $is_current = PLG_feedUpdateCheck( $A['type'], $A['fid'],
! $A['topic'], $A['update_info'], $A['limits'] );
}
! if( !$is_current )
{
! SYND_updateFeed( $A['fid'] );
}
}
}
}
***************
*** 2461,2464 ****
--- 2278,2293 ----
$adminmenu->set_var( 'option_label', $LANG01[105] );
$adminmenu->set_var( 'option_count', 'N/A' );
+
+ $retval .= $adminmenu->parse( 'item',
+ ( $thisUrl == $url ) ? 'current' : 'option' );
+ }
+
+ if(( $_CONF['backend'] == 1 ) && SEC_inGroup( 'Root' ))
+ {
+ $url = $_CONF['site_admin_url'] . '/syndication.php';
+ $adminmenu->set_var( 'option_url', $url );
+ $adminmenu->set_var( 'option_label', $LANG01[38] );
+ $count = DB_count( $_TABLES['syndication'] );
+ $adminmenu->set_var( 'option_count', $count );
$retval .= $adminmenu->parse( 'item',
Index: submit.php
===================================================================
RCS file: /usr/cvs/geeklog/geeklog-1.3/public_html/submit.php,v
retrieving revision 1.54
retrieving revision 1.55
diff -C2 -d -r1.54 -r1.55
*** submit.php 25 Jun 2003 08:39:02 -0000 1.54
--- submit.php 12 Aug 2003 21:10:04 -0000 1.55
***************
*** 711,714 ****
--- 711,717 ----
$related = addslashes (COM_whatsRelated ($introtext, $_USER['uid'], $A['tid']));
DB_save ($_TABLES['stories'], 'sid,uid,tid,title,introtext,related,date,commentcode,postmode,owner_id,group_id,perm_owner,perm_group,perm_members,perm_anon', "{$A["sid"]},{$_USER['uid']},'{$A["tid"]}','{$A['title']}','{$A["introtext"]}','{$related}',NOW(),{$_CONF['comment_code']},'{$A["postmode"]}',{$_USER['uid']},{$T['group_id']},{$T['perm_owner']},{$T['perm_group']},{$T['perm_members']},{$T['perm_anon']}");
+
+ COM_rdfUpToDateCheck ();
+ COM_olderStuff ();
if (isset ($_CONF['notification']) && in_array ('story', $_CONF['notification'])) {
$A['uid'] = $_USER['uid'];
- Previous message (by thread): [geeklog-cvs] geeklog-1.3/public_html/layout/Classic/admin/syndication feededitor.thtml,NONE,1.1 listfeeds.thtml,NONE,1.1 listitem.thtml,NONE,1.1 selecttype.thtml,NONE,1.1
- Next message (by thread): [geeklog-cvs] geeklog-1.3/public_html/admin syndication.php,NONE,1.1 moderation.php,1.41,1.42 story.php,1.99,1.100
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the geeklog-cvs
mailing list