Thanks Raymond. That fixed the token error for me.
This isn't 'solved' though r.dziadusz...
Problem after running the script: all previous apostrophes (and quotation marks) are now in Ascii Html': ' , " Any ideas on how to fix this? (I have vbseo and tried the character replacement function - doesn't work. I also rebuilt the post cache after running the BB script - didn't change anything). Only apostrophes and quotation marks which were there before the script was run have been affected (new posts containing them will display normally) I can 'cheat' a partial fix by using vb censoring but I'd rather not.
Also, & is showing everywhere as &
Problem 2: for some reason I have this BB code in some places: [Lang=x], [lang = x] etc How do I amend your script (clearBB.php) to kill those too?
Last edited by norku; 11-10-11 at 12:03.
Sorry I've marked it as solved, I supposed it work for both of you
I will investigate why you get ', please tell me what charset do you use (describe how to do it, you can find it in readme.html file )
About second problem, it appeard becouse users add "lang" code manualy
If you want to remove ii using my script for first case [ Lang=x]
please find these lines:
if ((strpos($message['pagetext'], '[lang=')) !== FALSE){
$new_message = basic_clear($new_message, '[lang=');
}
and put exactly after it:
if ((strpos($message['pagetext'], '[Lang=')) !== FALSE){
$new_message = basic_clear($new_message, '[Lang=');
}
-this wasn't tested is just a quick fix
but in second case [I][ lang = x][/I] this bbcode doesn't work and it is more complicated, also can affect with some more problems, becouse you show me tag with two gaps, but i don't know if there were ones with three gaps etc, and becouse of that you can have some text cutted, i need to figure out if it is possible to remove tags like this safely.
Edit
About ' we are curently working on it pleae wait a second
Last edited by r.dziadusz; 11-10-11 at 12:49.
Hi and thanks. I started a new thread on this so could you delete it please?
My charset is ISO-8859-1
Thanks also for the info on the script.
Looking forward to hearing from you on the Ascii html thing as I would really like to get that fixed.
Hi we still working on it, we have to overcome some temporary vbulletin issue in our test forum, sorry for delay, you will get the solution as soon as possible!
Hi i know what seems to be the issue, I guess you use previous version of clearBB so like I said it was a beta version.
To remove & etc. please restore your database from your backup just before using the robot, and create this file again exactly as is descrption:CLICK, using current - (not previous, it could create problem - sorry for that)version of script
Last edited by r.dziadusz; 12-10-11 at 11:13.
And lose 2 days worth of posts/threads on the affected forum? I can't do that...
Ok i can create for you another script that will remove all of it ' , " , &
I'm sorry that this ASCI html codes appears, but please note that you use beta version of this product, we will do anything to help you
That would be excellent. Thanks. Will the script remove them even if they are joined onto other words like this: "Munchen-Nordwest" ?
Last edited by norku; 12-10-11 at 17:27.
It is also beta version
1.Please create file and save it as "decode.php"
2.Put the code below into it and save it
3.Upload to your server, forum root
4.Do the backup of your database
5.Turn off your forum
6.Log in as admin
7.In your browser, put url with destination to your "clearBB.php"
8.Press "clear" button
<?php echo "<input type=\"hidden\" name=\"securitytoken\" value=\"" . $vbulletin->userinfo['securitytoken'] . "\" />\n";?>
<p style="text-align: center">
Use this program to change asci html code into "normal" signs
</br>This script has big influence on your
database and changes are permanent - <b>can not be undone</b> therefore:
</br>
make sure you did the <b>backup of your database!</b> and remember to <b>turn
off your forum</b> during using this script!</p>
<form action="decode.php?do=execute" method="post"><input type="submit"
value="clear" style="width: 70%; margin-left: 15%" /></form>
<?php
function update_pagetext(&$new_message, $message_id) {
global $vbulletin;
$vbulletin->db->query_write("
UPDATE " . TABLE_PREFIX . "post
SET pagetext = '".addslashes($new_message)."'
WHERE postid = " .$message_id
);
}
function update_tittle(&$new_tittle, $tittle_id) {
global $vbulletin;
$vbulletin->db->query_write("
UPDATE " . TABLE_PREFIX . "post
SET title = '".addslashes($new_tittle)."'
WHERE postid = " .$tittle_id
);
$vbulletin->db->query_write("
UPDATE " . TABLE_PREFIX . "thread
SET title = '".addslashes($new_tittle)."'
WHERE firstpostid = " .$tittle_id
);
}
require_once('./global.php');
if ($_REQUEST['do'] == 'execute') {
$to_remove = array(">", "<", "&", "'", """);
$result = $vbulletin->db->query_read("SELECT * FROM ".TABLE_PREFIX."post WHERE pagetext LIKE '%>%' OR pagetext like '%<%' OR pagetext like '%&%' OR pagetext like '%'%' OR pagetext like '%"%' OR title LIKE '%&%' OR title LIKE '%'%' OR title LIKE '%<%' OR title LIKE '%>%' OR title LIKE '%"%' " );
while ($message = $db->fetch_array($result)){
$new_message = $message['pagetext'];
if ((strpos($message['pagetext'], '>')) !== FALSE){
$new_message = str_replace('>','>',$new_message);
}
if ((strpos($message['pagetext'], '<')) !== FALSE){
$new_message = str_replace('<','<',$new_message);
}
if ((strpos($message['pagetext'], '&')) !== FALSE){
$new_message = str_replace('&','&',$new_message);
}
if ((strpos($message['pagetext'], ''')) !== FALSE){
$new_message = str_replace(''',"'",$new_message);
}
if ((strpos($message['pagetext'], '"')) !== FALSE){
$new_message = str_replace('"','"',$new_message);
}
update_pagetext($new_message,$message['postid']);
$new_title = $message['title'];
if ((strpos($message['title'], '>')) !== FALSE){
$new_title = str_replace('>','>',$new_title);
}
if ((strpos($message['title'], '<')) !== FALSE){
$new_title = str_replace('<','<',$new_title);
}
if ((strpos($message['title'], '&')) !== FALSE){
$new_title = str_replace('&','&',$new_title);
}
if ((strpos($message['title'], ''')) !== FALSE){
$new_title = str_replace(''',"'",$new_title);
}
if ((strpos($message['title'], '"')) !== FALSE){
$new_title = str_replace('"','"',$new_title);
}
update_tittle($new_title, $message['postid']);
}
}
?>
Last edited by r.dziadusz; 18-10-11 at 19:36.