function cms_module_table_name($module_directory, $table_name) { $table_prefix = cms_module_table_prefix($module_directory); if ($table_prefix != '') { return $table_prefix . '_' . $table_name; } else { return $table_name; } }
public function cms_execute_sql($SQL, $separator) { $queries = explode($separator, $SQL); foreach ($queries as $query) { if (trim($query) == '') { continue; } $table_prefix = cms_module_table_prefix($this->cms_module_path()); $module_prefix = cms_module_prefix($this->cms_module_path()); $query = preg_replace('/\\{\\{ complete_table_name:(.*) \\}\\}/si', $table_prefix == '' ? '$1' : $table_prefix . '_' . '$1', $query); $query = preg_replace('/\\{\\{ module_prefix \\}\\}/si', $module_prefix, $query); $this->db->query($query); } }