<commit_before><?php
include_once "init.php";
$old_table = "old_table";
$new_table = "new_table";

$old_content = db_query("SELECT * FROM $old_table");
while($row = db_fetch_assoc($old_content)){
  
  foreach($row as $key=>$value){
      if($key == "parent"){
         if(!is_null($value) and !empty($value)){
         $sub_query = db_query("select id from $old_table where systemname='".db_escape($value)."'");
         $result = db_fetch_assoc($sub_query);
         $row["parent"] = $result["id"];
        } else {
          $row["parent"] = "NULL";
        } 
         }
         
  }
  
  db_query("INSERT INTO `".$new_table."` (id, notinfeed, systemname, title, content, active,
created, lastchangeby, autor, views, comments_enabled, redirection, menu, position, parent, lastmodified)

VALUES (".$row["id"].",0, '".db_escape(utf8_decode($row["systemname"]))."', 
'".db_escape($row["title"])."', 
".db_escape($row["content"])."',
 1, ".time().",
1, 1, 0, 0, 
'', '".db_escape($row["menu"])."', 
".$row["position"].", ".$row["parent"].", ".time().")");
}<commit_msg>value != "-"<commit_after><?php
include_once "init.php";
$old_table = "old_cotent";
$new_table = "new_content";

$old_content = db_query("SELECT * FROM $old_table");
while($row = db_fetch_assoc($old_content)){
  
  foreach($row as $key=>$value){
      if($key == "parent"){
         if(!is_null($value) and !empty($value) and $value != "-"){
         $sub_query = db_query("select id from $old_table where systemname='".db_escape($value)."'");
         $result = db_fetch_assoc($sub_query);
         $row["parent"] = $result["id"];
        } else {
          $row["parent"] = "NULL";
        } 
         }
         
  }
  
  db_query("INSERT INTO `".$new_table."` (id, notinfeed, systemname, title, content, active,
created, lastchangeby, autor, views, comments_enabled, redirection, menu, position, parent, lastmodified)

VALUES (".$row["id"].",0, '".db_escape(utf8_decode($row["systemname"]))."', 
'".db_escape(utf8_decode($row["title"]))."', 
'".db_escape(utf8_decode($row["content"]))."',
 1, ".time().",
1, 1, 0, 0, 
'', '".db_escape($row["menu"])."', 
".$row["position"].", ".$row["parent"].", ".time().")")or die (db_error());
}
{'fraction_non_alphanumeric': 0.2395644283121597, 'fraction_numerical': 0.007259528130671506, 'mean_word_length': 4.0, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2347577', 'n_tokens_mistral': 807, 'n_tokens_neox': 785, 'n_words': 143}