Platon Technologies
not logged in Login Registration
EnglishSlovak
open source software development celebrating 10 years of open source development! Friday, October 16, 2026

Diff for scripts/php/konz-import/Attic/konz-convert.php between version 1.1 and 1.2

version 1.1, 2002/04/14 17:02:16 version 1.2, 2002/04/23 22:05:33
Line 12 
Line 12 
  */   */
   
 // Data source name configuration  // Data source name configuration
 $dsn = 'mysql://konzervativizmus:x@localhost/konzervativizmus';  $dsn = 'mysql://konzervat:x@localhost/konzervativizmus';
 $table = 'konz_import';  $table = 'konz_import';
 $data_field = '__DATA';  $data_field = '__DATA';
   
Line 22  if ($argc < 1) {
Line 22  if ($argc < 1) {
         die();          die();
 }  }
   
 function string_convent($str)  function string_convert($str)
 {  {
         //$str = str_replace('Ÿ', '&middot;', $str);          //$str = str_replace('Ÿ', '&middot;', $str);
         $str = str_replace('Ÿ', '<li>', $str);          $str = str_replace('Ÿ', '<li>', $str);
Line 32  function string_convent($str)
Line 32  function string_convent($str)
         $str = str_replace('„', '"', $str);          $str = str_replace('„', '"', $str);
         $str = str_replace('“', '"', $str);          $str = str_replace('“', '"', $str);
         $str = str_replace('–', '&#8211;', $str);          $str = str_replace('–', '&#8211;', $str);
           $str = str_replace('…', '.', $str);
   
         $str = str_replace(" \r\n", "<br>\n", $str);          $str = str_replace(" \r\n", "<br>\n", $str);
         $str = str_replace("\r\n", "\r\n\r\n", $str);          $str = str_replace("\r\n", "\r\n\r\n", $str);
   
Line 63  if (DB::isError($res = $db->query($query
Line 65  if (DB::isError($res = $db->query($query
 $authors = array('', 'Admin');  $authors = array('', 'Admin');
 while ($res->fetchInto($row)) {  while ($res->fetchInto($row)) {
         $rec = array();          $rec = array();
           $notice = 0;
   
         // Texts          // Texts
         $rec['hometext'] = $row['cAnotacia'];          $rec['hometext'] = $row['cAnotacia'];
         $rec['bodytext'] = isset($row['cAnotaciaSwitch'])          $rec['bodytext'] = isset($row['cAnotaciaSwitch'])
                         ? $row['cAnotacia'] . "\n\r\n\r" : "";                          ? $row['cAnotacia'] . "\n\r\n\r" : "";
         $rec['bodytext'] .= $row['__DATA'];          $rec['bodytext'] .= $row['__DATA'];
           $rec['bodytext'] = preg_replace('/([\w]+@([\w]+\.)+[\w]{2,3})/',
                   '<a href="mailto:$1">$1</a>', $rec['bodytext']);
           $rec['bodytext'] = preg_replace('/(www\.[\w\.\/]+)/',
                   '<a target=_blank href="http://$1">$1</a>', $rec['bodytext']);
   
           if (preg_match('/([\w]+@([\w]+\.)+[\w]{2,3})/', $rec['bodytext'])
                           || preg_match('/(www\.[\w\.\/]+)/', $rec['bodytext']))
                   $notice = 0 /* 1 */;
   
         // Titles          // Titles
         if (isset($row['cTitulok_1'])) {          if (isset($row['cTitulok_1'])) {
Line 137  while ($res->fetchInto($row)) {
Line 148  while ($res->fetchInto($row)) {
         $rec['section_id'] = $section_id;          $rec['section_id'] = $section_id;
   
         // Conversions          // Conversions
         $rec['hometext'] = string_convent($rec['hometext']);          $rec['hometext'] = string_convert($rec['hometext']);
         $rec['bodytext'] = string_convent($rec['bodytext']);          $rec['bodytext'] = string_convert($rec['bodytext']);
   
           // Notice
           if ($notice) {
                   echo $row['cTitulok'] . " [" . $row['cKategoria'] . "]\n";
           }
   
         $cols = '';          $cols = '';
         $vals = '';          $vals = '';

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

Platon Group <platon@platon.org> http://platon.org/
Copyright © 2002-2006 Platon Group
Site powered by Metafox CMS
Go to Top