@@ 292-305 (lines=14) @@ | ||
289 | * |
|
290 | * @return bool |
|
291 | */ |
|
292 | function xoops_module_update_xnewsletter_rename_table($tablename) |
|
293 | { |
|
294 | global $xoopsDB; |
|
295 | ||
296 | if (tableExists($xoopsDB->prefix($tablename))) { |
|
297 | $sql = sprintf('ALTER TABLE ' . $xoopsDB->prefix($tablename) . ' RENAME ' . $xoopsDB->prefix('mod_' . $tablename)); |
|
298 | $result = $xoopsDB->queryF($sql); |
|
299 | if (!$result) { |
|
300 | echo '<br>' . _MI_XNEWSLETTER_UPGRADEFAILED . ": RENAME table '" . $tablename . "'"; |
|
301 | // ++$errors; |
|
302 | } |
|
303 | } |
|
304 | ||
305 | return true; |
|
306 | } |
|
307 | ||
308 | /** |
|
@@ 313-326 (lines=14) @@ | ||
310 | * |
|
311 | * @return bool |
|
312 | */ |
|
313 | function xoops_module_update_xnewsletter_rename_mod_table($tablename) |
|
314 | { |
|
315 | global $xoopsDB; |
|
316 | ||
317 | if (tableExists($xoopsDB->prefix('mod_' . $tablename))) { |
|
318 | $sql = sprintf('ALTER TABLE ' . $xoopsDB->prefix('mod_' . $tablename) . ' RENAME ' . $xoopsDB->prefix($tablename)); |
|
319 | $result = $xoopsDB->queryF($sql); |
|
320 | if (!$result) { |
|
321 | echo '<br>' . _MI_XNEWSLETTER_UPGRADEFAILED . ": RENAME table '" . $tablename . "'"; |
|
322 | // ++$errors; |
|
323 | } |
|
324 | } |
|
325 | ||
326 | return true; |
|
327 | } |
|
328 | ||
329 | /** |