Platform  3.1
PHP API documentation
 All Data Structures Namespaces Files Functions Variables Pages
migr_histo.php
Go to the documentation of this file.
1 <?php
2 /*
3  * @author Anakeen
4  * @license http://creativecommons.org/licenses/by-nc-sa/2.0/fr/ Anakeen - licence CC
5  * @package FDL
6 */
7 /**
8  * Generated Header (not documented yet)
9  *
10  * @author Anakeen 2000
11  * @version $Id: migr_histo.php,v 1.2 2006/08/10 08:45:36 eric Exp $
12  * @license http://creativecommons.org/licenses/by-nc-sa/2.0/fr/ Anakeen - licence CC
13  * @package FDL
14  * @subpackage
15  */
16 /**
17  */
18 // refreah for a classname
19 // use this only if you have changed title attributes
20 include_once ("FDL/Lib.Dir.php");
21 
22 function converthisto($dbaccess, $id, $initid, $comment)
23 {
24 
25  $tc = explode("\n", $comment);
26 
27  $h = new DocHisto($dbaccess);
28  $h->id = $id;
29  $h->level = HISTO_INFO;
30  $h->initid = $initid;
31  $h->uid = "0";
32 
33  foreach ($tc as $vc) {
34  if (preg_match("/([^\[]*)\[([^]]*)\](.*)/", $vc, $reg)) {
35  $kc++;
36  if (preg_match("|([0-9]{1,2})/([0-9]{1,2})/([0-9]{1,4}) ([0-2]{0,1}[0-9]):([0-5]{0,1}[0-9])|", $reg[1], $regt)) {
37  $stime = strftime("%d-%m-%Y %H:%M", mktime($regt[4], $regt[5], $regt[6], $regt[2], $regt[1], $regt[3]));
38  } else $stime = $reg[1];
39 
40  $h->date = $stime;
41  $h->uname = $reg[2];
42  $h->comment = $reg[3];
43 
44  $err = $h->Add();
45  if ($err != "") return $err;
46  } else {
47  print "\t bizarre $is : $comment\n";
48  }
49  };
50  return $err;
51 }
52 $dbaccess = GetParam("FREEDOM_DB");
53 $filter[] = "comment is not null";
54 
55 $ldoc = getChildDoc($dbaccess, 0, 0, "ALL", $filter, 1, "ITEM", 0, false, "", false, "also");
56 
58 
59 while ($doc = getNextDoc($dbaccess, $ldoc)) {
60  print "$reste)" . $doc->title . "\n";
61  converthisto($dbaccess, $doc->id, $doc->initid, $doc->comment);
62  $reste--;
63 }
64 ?>
← centre documentaire © anakeen - published under CC License - Dynacase