@@ 307-315 (lines=9) @@ | ||
304 | $errorData = true; |
|
305 | break; |
|
306 | } |
|
307 | if (!is_null($save_sql_id_as)) { |
|
308 | $sql_id = @mysqli_insert_id($sqlParser->conn); |
|
309 | if (!$sql_id) { |
|
310 | $query = "SELECT id FROM $dbase.`" . $table_prefix . "site_templates` WHERE templatename='$name' LIMIT 1;"; |
|
311 | $idQuery = mysqli_fetch_assoc(mysqli_query($sqlParser->conn, $query)); |
|
312 | $sql_id = $idQuery['id']; |
|
313 | } |
|
314 | $custom_placeholders[$save_sql_id_as] = $sql_id; |
|
315 | } |
|
316 | } else { |
|
317 | $installDataLevel['templates'][$moduleTemplate[0]]['type'] = 'create'; |
|
318 | $query = "INSERT INTO $dbase.`" . $table_prefix . "site_templates` (templatename,description,content,category,locked) VALUES('$name','$desc','$template',$category_id,'$locked');"; |
@@ 698-706 (lines=9) @@ | ||
695 | $category = mysqli_real_escape_string($sqlParser->conn, $category); |
|
696 | $rs = mysqli_query($sqlParser->conn, |
|
697 | "SELECT id FROM $dbase.`" . $table_prefix . "categories` WHERE category = '" . $category . "'"); |
|
698 | if (mysqli_num_rows($rs) && ($row = mysqli_fetch_assoc($rs))) { |
|
699 | $category_id = $row['id']; |
|
700 | } else { |
|
701 | $q = "INSERT INTO $dbase.`" . $table_prefix . "categories` (`category`) VALUES ('{$category}');"; |
|
702 | $rs = mysqli_query($sqlParser->conn, $q); |
|
703 | if ($rs) { |
|
704 | $category_id = mysqli_insert_id($sqlParser->conn); |
|
705 | } |
|
706 | } |
|
707 | } |
|
708 | ||
709 | return $category_id; |