aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/acp/acp_reasons.php
diff options
context:
space:
mode:
authorDavid M <davidmj@users.sourceforge.net>2008-01-04 18:35:49 +0000
committerDavid M <davidmj@users.sourceforge.net>2008-01-04 18:35:49 +0000
commitaf738dbc2a48713f59779410955282aa5760b741 (patch)
tree35053fbc840e81689dada401b978ae8dfb181d33 /phpBB/includes/acp/acp_reasons.php
parentedd6c34eda14fbef5bd1e6502735c45d038d6575 (diff)
downloadforums-af738dbc2a48713f59779410955282aa5760b741.tar
forums-af738dbc2a48713f59779410955282aa5760b741.tar.gz
forums-af738dbc2a48713f59779410955282aa5760b741.tar.bz2
forums-af738dbc2a48713f59779410955282aa5760b741.tar.xz
forums-af738dbc2a48713f59779410955282aa5760b741.zip
Ch-ch-ch-changes
- Made us more DB independent by making many queries capability based instead of DB specific - Finished PHP5ifying of the acm_file class, now with some (hopefully) enhancements to its performance - Sped up viewforum considerably (also goes towards mcp_forum) I really hope I didn't explode CVS... git-svn-id: file:///svn/phpbb/trunk@8301 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/acp/acp_reasons.php')
-rw-r--r--phpBB/includes/acp/acp_reasons.php53
1 files changed, 11 insertions, 42 deletions
diff --git a/phpBB/includes/acp/acp_reasons.php b/phpBB/includes/acp/acp_reasons.php
index 8d7bc88769..80c8e5323d 100644
--- a/phpBB/includes/acp/acp_reasons.php
+++ b/phpBB/includes/acp/acp_reasons.php
@@ -211,53 +211,22 @@ class acp_reasons
// Let the deletion be confirmed...
if (confirm_box(true))
{
- $sql = 'SELECT reason_id
+ $sql = 'SELECT reason_id, report_text
FROM ' . REPORTS_REASONS_TABLE . "
WHERE LOWER(reason_title) = 'other'";
$result = $db->sql_query($sql);
- $other_reason_id = (int) $db->sql_fetchfield('reason_id');
+ $row = $db->sql_fetchrow($result);
+
+ $other_reason_id = (int) $row['reason_id'];
+ $report_text = $row['report_text'];
+
$db->sql_freeresult($result);
- switch ($db->sql_layer)
- {
- // The ugly one!
- case 'mysqli':
- case 'mysql4':
- case 'mysql':
- // Change the reports using this reason to 'other'
- $sql = 'UPDATE ' . REPORTS_TABLE . '
- SET reason_id = ' . $other_reason_id . ", report_text = CONCAT('" . $db->sql_escape($reason_row['reason_description']) . "\n\n', report_text)
- WHERE reason_id = $reason_id";
- break;
-
- // Standard? What's that?
- case 'mssql':
- case 'mssql_odbc':
- // Change the reports using this reason to 'other'
- $sql = "DECLARE @ptrval binary(16)
-
- SELECT @ptrval = TEXTPTR(report_text)
- FROM " . REPORTS_TABLE . "
- WHERE reason_id = " . $reason_id . "
-
- UPDATETEXT " . REPORTS_TABLE . ".report_text @ptrval 0 0 '" . $db->sql_escape($reason_row['reason_description']) . "\n\n'
-
- UPDATE " . REPORTS_TABLE . '
- SET reason_id = ' . $other_reason_id . "
- WHERE reason_id = $reason_id";
- break;
-
- // Teh standard
- case 'postgres':
- case 'oracle':
- case 'firebird':
- case 'sqlite':
- // Change the reports using this reason to 'other'
- $sql = 'UPDATE ' . REPORTS_TABLE . '
- SET reason_id = ' . $other_reason_id . ", report_text = '" . $db->sql_escape($reason_row['reason_description']) . "\n\n' || report_text
- WHERE reason_id = $reason_id";
- break;
- }
+ $report_text .= $reason_row['reason_description'] . "\n\n";
+
+ $sql = 'UPDATE ' . REPORTS_TABLE . '
+ SET reason_id = ' . $other_reason_id . ", report_text = '" . $db->sql_escape($report_text) "'
+ WHERE reason_id = $reason_id";
$db->sql_query($sql);
$db->sql_query('DELETE FROM ' . REPORTS_REASONS_TABLE . ' WHERE reason_id = ' . $reason_id);