[geeklog-cvs] geeklog-1.3/public_html/admin/install install.php,1.54,1.55

geeklog-cvs-admin at lists.geeklog.net geeklog-cvs-admin at lists.geeklog.net
Mon Sep 8 16:49:16 EDT 2003


Update of /usr/cvs/geeklog/geeklog-1.3/public_html/admin/install
In directory geeklog_prod:/tmp/cvs-serv9300/install

Modified Files:
	install.php 
Log Message:
Recreate the 'date' field for links where it is NULL.


Index: install.php
===================================================================
RCS file: /usr/cvs/geeklog/geeklog-1.3/public_html/admin/install/install.php,v
retrieving revision 1.54
retrieving revision 1.55
diff -C2 -d -r1.54 -r1.55
*** install.php	13 Aug 2003 09:00:26 -0000	1.54
--- install.php	8 Sep 2003 20:49:14 -0000	1.55
***************
*** 492,495 ****
--- 492,516 ----
              DB_query ("INSERT INTO {$_TABLES['syndication']} (title, description, limits, content_length, filename, charset, language, is_enabled, updated, update_info) VALUES ('{$_CONF['site_name']}', '{$_CONF['site_slogan']}', '{$_CONF['rdf_limit']}', {$_CONF['rdf_storytext']}, '{$filename}', '{$_CONF['default_charset']}', '{$_CONF['rdf_language']}', {$_CONF['backend']}, '0000-00-00 00:00:00', NULL)");
  
+             // recreate 'date' field for old links
+             $result = DB_query ("SELECT lid FROM {$_TABLES['links']} WHERE date IS NULL");
+             $num = DB_numRows ($result);
+             if ($num > 0) {
+                 for ($i = 0; $i < $num; $i++) {
+                     $A = DB_fetchArray ($result);
+ 
+                     $myyear = substr ($A['lid'], 0, 4);
+                     $mymonth = substr ($A['lid'], 4, 2);
+                     $myday = substr ($A['lid'], 6, 2);
+                     $myhour = substr ($A['lid'], 8, 2);
+                     $mymin = substr ($A['lid'], 10, 2);
+                     $mysec = substr ($A['lid'], 12, 2);
+ 
+                     $mtime = mktime ($myhour, $mymin, $mysec,
+                                      $mymonth, $myday, $myyear);
+                     $date = date ("Y-m-d H:i:s", $mtime);
+                     DB_query ("UPDATE {$_TABLES['links']} SET date = '$date' WHERE lid = '{$A['lid']}'");
+                 }
+             }
+ 
              $current_gl_version = '1.3.9';
              $_SQL = '';





More information about the geeklog-cvs mailing list