includes/lang.php
changeset 377 bb3e6c3bd4f4
parent 376 66732bd4532c
child 387 92664d2efab8
equal deleted inserted replaced
376:66732bd4532c 377:bb3e6c3bd4f4
   358         }
   358         }
   359       }
   359       }
   360     }
   360     }
   361     
   361     
   362     $delete_list = implode(" OR\n  ", $delete_list);
   362     $delete_list = implode(" OR\n  ", $delete_list);
   363     $sql = "DELETE FROM " . table_prefix . "language_strings WHERE $delete_list;";
   363     
   364     
   364     if ( !empty($delete_list) )
   365     // Free some memory
   365     {
   366     unset($delete_list);
   366       $sql = "DELETE FROM " . table_prefix . "language_strings WHERE $delete_list;";
   367     
   367       
   368     // Run the query
   368       // Free some memory
   369     $q = $db->sql_query($sql);
   369       unset($delete_list);
   370     if ( !$q )
   370       
   371       $db->_die('lang.php - couldn\'t kill off them old strings');
   371       // Run the query
   372     
   372       $q = $db->sql_query($sql);
   373     $insert_list = implode(",\n  ", $insert_list);
   373       if ( !$q )
   374     $sql = "INSERT INTO " . table_prefix . "language_strings(lang_id, string_category, string_name, string_content) VALUES\n  $insert_list;";
   374         $db->_die('lang.php - couldn\'t kill off them old strings');
   375     
   375     }
   376     // Free some memory
   376     
   377     unset($insert_list);
   377     if ( !empty($insert_list) )
   378     
   378     {
   379     // Run the query
   379       $insert_list = implode(",\n  ", $insert_list);
   380     $q = $db->sql_query($sql);
   380       $sql = "INSERT INTO " . table_prefix . "language_strings(lang_id, string_category, string_name, string_content) VALUES\n  $insert_list;";
   381     if ( !$q )
   381       
   382       $db->_die('lang.php - couldn\'t insert strings in import()');
   382       // Free some memory
       
   383       unset($insert_list);
       
   384       
       
   385       // Run the query
       
   386       $q = $db->sql_query($sql);
       
   387       if ( !$q )
       
   388         $db->_die('lang.php - couldn\'t insert strings in import()');
       
   389     }
   383     
   390     
   384     // YAY! done!
   391     // YAY! done!
   385     // This will regenerate the cache file if possible.
   392     // This will regenerate the cache file if possible.
   386     $this->regen_caches();
   393     $this->regen_caches();
   387   }
   394   }