aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/develop/change_smiley_ref.php
diff options
context:
space:
mode:
authorMeik Sievertsen <acydburn@phpbb.com>2005-10-03 15:44:41 +0000
committerMeik Sievertsen <acydburn@phpbb.com>2005-10-03 15:44:41 +0000
commit9439a3f49a0c528782ed9e7d34aee4770e07bdc2 (patch)
tree0717d4cf31bc17113df727c624d6c5b87e2deb8b /phpBB/develop/change_smiley_ref.php
parented9bac63e592670fee0c750d80959820b6dca2d4 (diff)
downloadforums-9439a3f49a0c528782ed9e7d34aee4770e07bdc2.tar
forums-9439a3f49a0c528782ed9e7d34aee4770e07bdc2.tar.gz
forums-9439a3f49a0c528782ed9e7d34aee4770e07bdc2.tar.bz2
forums-9439a3f49a0c528782ed9e7d34aee4770e07bdc2.tar.xz
forums-9439a3f49a0c528782ed9e7d34aee4770e07bdc2.zip
blabla
git-svn-id: file:///svn/phpbb/trunk@5250 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/develop/change_smiley_ref.php')
-rw-r--r--phpBB/develop/change_smiley_ref.php62
1 files changed, 62 insertions, 0 deletions
diff --git a/phpBB/develop/change_smiley_ref.php b/phpBB/develop/change_smiley_ref.php
new file mode 100644
index 0000000000..db65dd52d4
--- /dev/null
+++ b/phpBB/develop/change_smiley_ref.php
@@ -0,0 +1,62 @@
+<?php
+/***************************************************************************
+ * merge_clean_posts.php
+ * -------------------
+ * begin : Tuesday, February 25, 2003
+ * copyright : (C) 2003 The phpBB Group
+ * email : support@phpbb.com
+ *
+ * $Id$
+ *
+ ***************************************************************************/
+
+/***************************************************************************
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ ***************************************************************************/
+
+//
+// Security message:
+//
+// This script is potentially dangerous.
+// Remove or comment the next line (die(".... ) to enable this script.
+// Do NOT FORGET to either remove this script or disable it after you have used it.
+//
+die("Please read the first lines of this script for instructions on how to enable it");
+
+@set_time_limit(2400);
+
+// This script adds missing permissions
+$db = $dbhost = $dbuser = $dbpasswd = $dbport = $dbname = '';
+
+define('IN_PHPBB', 1);
+define('ANONYMOUS', 1);
+$phpEx = substr(strrchr(__FILE__, '.'), 1);
+$phpbb_root_path='./../';
+include($phpbb_root_path . 'config.'.$phpEx);
+require($phpbb_root_path . 'includes/acm/acm_' . $acm_type . '.'.$phpEx);
+require($phpbb_root_path . 'includes/db/' . $dbms . '.'.$phpEx);
+include($phpbb_root_path . 'includes/functions.'.$phpEx);
+
+$cache = new acm();
+$db = new $sql_db();
+
+// Connect to DB
+$db->sql_connect($dbhost, $dbuser, $dbpasswd, $dbname, $dbport, false);
+
+$sql = "SELECT post_id, post_text FROM {$table_prefix}posts WHERE post_text LIKE '%{SMILE_PATH}%'";
+$result = $db->sql_query($sql);
+
+while ($row = $db->sql_fetchrow($result))
+{
+ $db->sql_query("UPDATE {$table_prefix}posts SET post_text = '" . $db->sql_escape(str_replace('{SMILE_PATH}', '{SMILIES_PATH}', $row['post_text'])) . "' WHERE post_id = " . $row['post_id']);
+}
+$db->sql_freeresult($result);
+
+echo "<p><b>Done</b></p>\n";
+
+?> \ No newline at end of file