PHP Code:
<?php
error_reporting(E_ALL & ~E_NOTICE);
require_once('./global.php');
echo "Stripping HTML from all posts, please stand by ...<br>";
$DB_site->query("LOCK TABLES post WRITE");
$posts= $DB_site->query("SELECT * FROM " . TABLE_PREFIX . "post");
$i = 0;
while ($post = $DB_site->fetch_array($posts)) {
// Remove the HTML
$post['pagetext'] = strip_tags(unhtmlspecialchars($post['pagetext']));
// Remove non-breaking spaces
$post['pagetext'] = preg_replace("'&(nbsp|#160);'si", "", $post['pagetext']);
// Write the post back
$DB_site->query("UPDATE " . TABLE_PREFIX . "post SET pagetext='" . addslashes($post['pagetext']) . "' WHERE postid=" . $post['postid']);
if ($i % 100 == 0) {
echo ".";
flush();
}
$i++;
}
$DB_site->query("UNLOCK TABLES");
echo "<br>Finished!"
?>
No warranties. Please note that this script wil take kinda long to finish (depending on the size of you board). No warranties.