| @@ 264-284 (lines=21) @@ | ||
| 261 | /** |
|
| 262 | * @param $pid |
|
| 263 | */ |
|
| 264 | function deletePrefix($pid) |
|
| 265 | { |
|
| 266 | global $xoopsDB; |
|
| 267 | ||
| 268 | $row = getPrefix($pid); |
|
| 269 | ||
| 270 | if ($row['template_id']) { |
|
| 271 | installTemplate($pid, true); |
|
| 272 | ||
| 273 | $sql = 'DELETE FROM ' . $xoopsDB->prefix('gwiki_template'); |
|
| 274 | $sql .= ' WHERE template_id = "' . $row['template_id'] . '" '; |
|
| 275 | $result = $xoopsDB->queryF($sql); |
|
| 276 | } |
|
| 277 | ||
| 278 | $sql = 'DELETE FROM ' . $xoopsDB->prefix('gwiki_prefix'); |
|
| 279 | // $sql .= ' WHERE prefix_id = "'.$pid.'" '; |
|
| 280 | $sql .= " WHERE prefix_id = '{$pid}' "; |
|
| 281 | $result = $xoopsDB->queryF($sql); |
|
| 282 | ||
| 283 | redirect_header('prefixes.php', 2, _MD_GWIKI_DBUPDATED); |
|
| 284 | } |
|
| 285 | ||
| 286 | /** |
|
| 287 | * @param $pid |
|
| @@ 484-504 (lines=21) @@ | ||
| 481 | /** |
|
| 482 | * @param $pid |
|
| 483 | */ |
|
| 484 | function deleteTemplate($pid) |
|
| 485 | { |
|
| 486 | global $xoopsDB; |
|
| 487 | ||
| 488 | $row = getPrefix($pid); |
|
| 489 | ||
| 490 | if ($row['template_id']) { |
|
| 491 | installTemplate($pid, true); |
|
| 492 | ||
| 493 | $sql = 'UPDATE ' . $xoopsDB->prefix('gwiki_prefix'); |
|
| 494 | $sql .= ' SET prefix_template_id = \'0\''; |
|
| 495 | // $sql .= ' WHERE prefix_id = "'.$pid.'" '; |
|
| 496 | $sql .= " WHERE prefix_id = '{$pid}' "; |
|
| 497 | $result = $xoopsDB->queryF($sql); |
|
| 498 | ||
| 499 | $sql = 'DELETE FROM ' . $xoopsDB->prefix('gwiki_template'); |
|
| 500 | $sql .= ' WHERE template_id = "' . $row['template_id'] . '" '; |
|
| 501 | $result = $xoopsDB->queryF($sql); |
|
| 502 | } |
|
| 503 | redirect_header('prefixes.php', 2, _MD_GWIKI_DBUPDATED); |
|
| 504 | } |
|
| 505 | ||
| 506 | /** |
|
| 507 | * @param $pid |
|