PDA

View Full Version : Need Cleaner code for "exposed" HTML on import



DaSpyda
Mon 18th May '09, 9:38pm
I recently did a test import from IPB, and I am seeing this code in the quoted posts:

<div class='quotetop'>QUOTE (SpeedCostsMoney @ May 6 2009, 09:25 AM) <{POST_SNAPBACK}> (http://index.php/?act=findpost&pid=4955351)</div>

Please give me the code necessary for the cleaner.php file to clean this up - thanks!

Don

Jerry
Fri 22nd May '09, 2:42pm
What version of IPB did that come from ?

DaSpyda
Fri 22nd May '09, 4:17pm
Version 2.2

Jerry
Wed 27th May '09, 10:20pm
You'll have to use tools/cleaner.php if you've already done the import.

Around line 99 is this :



#$text = preg_replace('##siU', '', $text);


Change that to :



$text = preg_replace("#<div class='quotetop'>QUOTE \((.*) @(.*)<{POST_SNAPBACK}></div>#isU", '[QUOTE=$1]', $text);

DaSpyda
Wed 27th May '09, 10:56pm
Thank you, Jerry!

That was wonderful and perfect.

Now, on to the sigs, and that should be it:

<div align='center'>Proud to be your 2008 PresidenT[/b]</div> is what we're seeing

I think:


$text = preg_replace("#<div align='center'> \((.*) @(.*)[/b]</div>#isU", '[QUOTE=$1]', $text);


Would that be correct?

Don

Jerry
Thu 28th May '09, 2:45pm
Is that HTML you showed, the beginning of what should be a quote tag, or something you just want to remove ?

DaSpyda
Thu 28th May '09, 4:03pm
That's a signature with HTML code and the exposed code is what we want to eliminate.

Jerry
Fri 29th May '09, 1:23am
I'd just use the cleaner array for that :



$replacer = array(
"<div align='center'>" => "",
"[/b]</div>" => ""
);


and just above it, set :



$do_posts = false;
$do_sigs = true;
$do_thread_titles = false;
$do_pm_text = false;
$do_pm_text_title = false;

high76
Tue 2nd Jun '09, 4:45am
Im running into a similar issue, I want to remove:

<div class='quotetop'>CITATION(gerre @ 15 Apr 2008, 20:11 ) <{POST_SNAPBACK}> (index.php?act=findpost&pid=51023)</div>

trying

$text = preg_replace("#<div class='quotetop'>CITATION\((.*) @(.*)<{POST_SNAPBACK}>[/url]</div>#isU", '[QUOTE=$1]', $text);

doesnt work that way, can someone enlight me a little? ,) Thanks in advance!

Jerry
Wed 10th Jun '09, 1:47pm
Try this :



$text = preg_replace("#<div class='quotetop'>CITATION\((.*) @ (.*)\[url=\"index.php(.*)</div>#isU", '[QUOTE=$1]', $text);