[geeklog-cvs] geeklog-1.3/public_html index.php,1.59,1.60 lib-common.php,1.346,1.347

blaine at iowaoutdoors.org blaine at iowaoutdoors.org
Fri Jul 30 23:30:37 EDT 2004


Update of /var/cvs/geeklog-1.3/public_html
In directory www:/tmp/cvs-serv6727/public_html

Modified Files:
	index.php lib-common.php 
Log Message:
Package of changes to support the Story Archive Feature

Index: lib-common.php
===================================================================
RCS file: /var/cvs/geeklog-1.3/public_html/lib-common.php,v
retrieving revision 1.346
retrieving revision 1.347
diff -C2 -d -r1.346 -r1.347
*** lib-common.php	27 Jul 2004 18:37:16 -0000	1.346
--- lib-common.php	31 Jul 2004 03:30:35 -0000	1.347
***************
*** 400,404 ****
              'bodytext'         => 'storybodytext.thtml',
              'featuredarticle'  => 'featuredstorytext.thtml',
!             'featuredbodytext' => 'featuredstorybodytext.thtml'
              ));
  
--- 400,406 ----
              'bodytext'         => 'storybodytext.thtml',
              'featuredarticle'  => 'featuredstorytext.thtml',
!             'featuredbodytext'=>'featuredstorybodytext.thtml',
!             'archivearticle'=>'archivestorytext.thtml',
!             'archivebodytext'=>'archivestorybodytext.thtml'
              ));
  
***************
*** 607,610 ****
--- 609,617 ----
          $article->parse( 'finalstory', 'featuredarticle' );
      }
+     elseif ($A['statuscode'] == 10)
+     {
+         $article->parse( 'story_bodyhtml', 'archivestorybodytext', true );
+         $article->parse( 'finalstory', 'archivearticle' );
+     }
      else
      {

Index: index.php
===================================================================
RCS file: /var/cvs/geeklog-1.3/public_html/index.php,v
retrieving revision 1.59
retrieving revision 1.60
diff -C2 -d -r1.59 -r1.60
*** index.php	31 May 2004 08:45:08 -0000	1.59
--- index.php	31 Jul 2004 03:30:35 -0000	1.60
***************
*** 125,128 ****
--- 125,146 ----
  COM_featuredCheck();
  
+ // Scan for any stories that have expired and should be deleted
+ $expiresql = DB_query("SELECT sid,tid,title,expire,statuscode FROM {$_TABLES['stories']}"
+                             . " WHERE tid != '{$_CONF['archivetopic']}'"
+                             . " AND (expire <= NOW()) AND (statuscode >= 10)");
+ while (list ($sid,$expiretopic,$title,$expire,$statuscode) = DB_fetchArray($expiresql)) {
+     if ($statuscode == 10) {
+         if (DB_COUNT($_TABLES['topics'],"tid", $_CONF['archivetopic']) > 0) {
+             COM_errorLOG("Archive Story: $sid, Topic:$expiretopic, Title: $title. Expired :$expire");
+             DB_query("UPDATE {$_TABLES['stories']} SET tid = '{$_CONF['archivetopic']}' WHERE sid='{$sid}'");
+         } else {
+             COM_errorLOG("ERROR: Archive Topic does not exist. Attempt to archive Story: $sid");
+         }
+     } else {
+         COM_errorLOG("Delete Story and comments: $sid, Topic:$expiretopic, Title: $title. Expired :$expire");
+         DB_query("DELETE FROM {$_TABLES['stories']} WHERE sid='{$sid}'");
+         DB_query("DELETE FROM {$_TABLES['comments']} WHERE sid='{$sid}'");
+     }
+ }
  $sql = " (date <= NOW()) AND (draft_flag = 0)";
  
***************
*** 133,136 ****
--- 151,157 ----
      $sql .= " AND frontpage = 1 ";
  }
+ if ($topic != $_CONF['archivetopic']) {
+     $sql .= " AND s.tid != '{$_CONF['archivetopic']}' ";
+ }
  
  $sql .= COM_getPermSQL ('AND', 0, 2, 's');




More information about the geeklog-cvs mailing list