includes/functions.php
changeset 241 c671f3bb8aed
parent 238 a78537db2850
child 242 78a94f7bb5e3
equal deleted inserted replaced
240:f0149a27df5f 241:c671f3bb8aed
  3204                          );');
  3204                          );');
  3205   if ( !$q )
  3205   if ( !$q )
  3206     $db->_die('functions.php - installing language');
  3206     $db->_die('functions.php - installing language');
  3207   
  3207   
  3208   $lang_id = $db->insert_id();
  3208   $lang_id = $db->insert_id();
  3209   if ( empty($lang_id) )
  3209   if ( empty($lang_id) || $lang_id == 0 )
  3210     return false;
  3210   {
       
  3211     $db->_die('functions.php - invalid returned lang_id');
       
  3212   }
  3211   
  3213   
  3212   // Do we also need to install a language file?
  3214   // Do we also need to install a language file?
  3213   if ( is_string($lang_file) && file_exists($lang_file) )
  3215   if ( is_string($lang_file) && file_exists($lang_file) )
  3214   {
  3216   {
  3215     $lang = new Language($lang_id);
  3217     $lang = new Language($lang_id);
  3216     $lang->import($lang_file);
  3218     $lang->import($lang_file);
       
  3219     $lang->fetch(false);
       
  3220     $lang->regen_caches();
  3217   }
  3221   }
  3218   else if ( is_string($lang_file) && !file_exists($lang_file) )
  3222   else if ( is_string($lang_file) && !file_exists($lang_file) )
  3219   {
  3223   {
  3220     echo '<b>Notice:</b> Can\'t load language file, so the specified language wasn\'t fully installed.<br />';
  3224     echo '<b>Notice:</b> Can\'t load language file, so the specified language wasn\'t fully installed.<br />';
  3221     return false;
  3225     return false;