View Full Version : phpBB 2 BBcode problem
mgurain
Mon 4th Apr '05, 12:22pm
Hello,,
I have just imported all of phpBB 2.0.13 posts into my new VB3, but I have this big problem :
all the posts with some BBcodes are not displayed correctly in VB,
e.g. :
[align=center:82bf55b395]some text[/align:82bf55b395]
also smilles :
:idea:
:twisted:
also I think I solved the BBcode : size with custom BBcode in VB but I am not sure of the {option} part ? How will it convert for example size=4 to the corresponding size=4 in VB ?
I am in a big trouble if I don't solve this !!
thanks in advance,,
ZacUSNYR
Mon 4th Apr '05, 2:01pm
go to the smiles section in admincp - it only imports them but doesn't put them in the current smilies.
mgurain
Mon 4th Apr '05, 5:05pm
Hello,,
what about the important problem :
[align=center:82bf55b395]some text[/align:82bf55b395]
??
Jerry
Mon 4th Apr '05, 6:21pm
That is what cleaner.php is for, also the sizes are parsed out as it imports the posts if you don't want to use the cleaner you will have to add this code to line 116 of impex/systems/phpBB2/000.php
$text = preg_replace('#\[align=center:([a-z0-9]+)\](.*)\[/align:\\1\]#siU','
$2',$text);
mgurain
Mon 4th Apr '05, 7:34pm
Hello,,
thanks very much Jerry,
I have some more small questions before doing :
I have changed some fourms to be subforums of other in new VB, will that affect the re-import ?
also what should I re-import now ? only the threads ?
what about the user ids, I noticed that they changed after import ? will the re-import do recognize them ?
thanks in advance,,
Jerry
Mon 4th Apr '05, 7:39pm
Hello,,
thanks very much Jerry,
I have some more small questions before doing :
I have changed some fourms to be subforums of other in new VB, will that affect the re-import ?
As long has you haven't removed the importforumid they should be fine.
also what should I re-import now ? only the threads ?
what about the user ids, I noticed that they changed after import ? will the re-import do recognize them ?
Threads & posts. The id's have to change they are vBulletin id's not the source id's if you want the source id's they are user.importuserid.
mgurain
Mon 4th Apr '05, 8:48pm
Hello,,
Thanks Jerry again,,
If I open the board now for posting, then if I would like to do the same re-import or clean will that affect the new posts after the import ?
also, I did run clean.php by a direct URL call, but that seem to be hanging, was my method ok ? or there is a better solution ?
thanks in advance,,
Jerry
Mon 4th Apr '05, 8:56pm
If I open the board now for posting, then if I would like to do the same re-import or clean will that affect the new posts after the import ?
Only open a board once the import is complete and finished, if you re-do the import again you will loose the new data.
also, I did run clean.php by a direct URL call, but that seem to be hanging, was my method ok ? or there is a better solution ?
cleaner.php has to be configured for what strings you want to to swap out.
mgurain
Mon 4th Apr '05, 9:24pm
Hello,,
1. How to configer cleaner.php ?
2. How to run cleaner.php ?
3. what does it do exactly ?
4. I want to resolve other BBcodes such as :
some text
some text
some text
knowing these codes from bbcode.php from phpBB :
// align
$text = preg_replace("/\[align=(left|right|center|justify):$uid\]/si", $bbcode_tpl['align_open'], $text);
$text = str_replace("[/align:$uid]", $bbcode_tpl['align_close'], $text);
// image_url_herecode..
$patterns[] = "#\[left:$uid\](.*?)\[/left:$uid\]#si";
$replacements[] = $bbcode_tpl['left'];
// [right]image_url_here
code..
$patterns[] = "#\[right:$uid\](.*?)\[/right:$uid\]#si";
$replacements[] = $bbcode_tpl['right'];
also :
<!-- BEGIN video -->
<div align="center"><embed src="{URL}" width={WIDTH} height={HEIGHT}></embed></div>
<!-- END video -->
<!-- BEGIN web --><iframe width="100%" height="350" src="{URL}"></iframe><!-- END web -->
<!-- BEGIN hr --><hr noshade color='#000000' size='1'><!-- END hr -->
<!-- BEGIN fade_open -->
<span style="height: 1; Filter: Alpha(Opacity=100, FinishOpacity=0, Style=1, StartX=0, FinishX=100%)">
<!-- END fade_open -->
<!-- BEGIN fade_close -->
</span>
<!-- END fade_close -->
<!-- BEGIN glow_open --><span style="filter: glow(color={GLOWCOLOR}); height:20"><!-- END glow_open -->
<!-- BEGIN glow_close --></span><!-- END glow_close -->
<!-- BEGIN shadow_open --><span style="filter: shadow(color={SHADOWCOLOR}); height:20"><!-- END shadow_open -->
<!-- BEGIN shadow_close --></span><!-- END shadow_close -->
<!-- BEGIN highlight_open --><span style="background-color: {HIGHLIGHTCOLOR}"><!-- END highlight_open -->
<!-- BEGIN highlight_close --></span><!-- END highlight_close -->
<!-- BEGIN s_open --><s><!-- END s_open -->
<!-- BEGIN s_close --></s><!-- END s_close -->
<!-- BEGIN google --><a href="http://www.google.com/search?q={QUERY}" target="_blank">{STRING}</a><!-- END google -->
<!-- BEGIN left --><img src="{URL}" border="0" align="right" /><!-- END left -->
<!-- BEGIN right --><img src="{URL}" border="0" align="left" /><!-- END left -->
<!-- BEGIN scrollleft_open --><span><marquee direction="left"><!-- END scrollleft_open -->
<!-- BEGIN scrollleft_close --></marquee></span><!-- END scrollleft_close -->
<!-- BEGIN scrollright_open --><span><marquee direction="right"><!-- END scrollright_open -->
<!-- BEGIN scrollright_close --></marquee></span><!-- END scrollright_close -->
<!-- BEGIN scrollup_open --><span><marquee direction="up"><!-- END scrollup_open -->
<!-- BEGIN scrollup_close --></marquee></span><!-- END scrollup_close -->
<!-- BEGIN scrolldown_open --><span><marquee direction="down"><!-- END scrolldown_open -->
<!-- BEGIN scrolldown_close --></marquee></span><!-- END scrolldown_close -->
thanks in advance,,
Jerry
Mon 4th Apr '05, 9:32pm
Hello,,
1. How to configer cleaner.php ?
2. How to run cleaner.php ?
3. what does it do exactly ?
All the comments and explanations are in the file itself, it replaces text using str_replace() or using a regular expression, if you set it up for that.
4. I want to resolve other BBcodes such as :
some text
some text
some text
Then you will need to add the regular expression code to 000.php to do it on the first past or use cleaner.php tp swap it out after the import.
Jerry
Mon 4th Apr '05, 9:32pm
I see you edited your post, all this is custom and not defaut phpBB code.
mgurain
Tue 5th Apr '05, 8:06am
Hello Jerry,,
1. Can I open the board for posting, then do the cleaner.php any time (not re-import) and not lose the new data ?
2. Can you help me configer the cleaner.php at least for one expression, then I will do the rest ?
also : where should I place the Regular Expressions ? is it here :
$replacer = array(
"<img>" => "[img]",
"" => "",
"" => "",
"" => "",
"" => ""
);
or some where else ?
3. Should I then run the cleaner as I stated by calling it by typing the URL ?!! it seems will hang because explorer can not handle all of the database date shown in one webpage !!
thanks.
Jerry
Tue 5th Apr '05, 6:04pm
Hello Jerry,,
1. Can I open the board for posting, then do the cleaner.php any time (not re-import) and not lose the new data ?
Yes you can, though backup the database before running cleaner.php on a live board, always.
2. Can you help me configer the cleaner.php at least for one expression, then I will do the rest ?
Ok, give me 1 string you want matched and cleaned out.
also : where should I place the Regular Expressions ? is it here :
$replacer = array(
"<img>" => "[img]",
"" => "",
"" => "",
"" => "",
"" => ""
);
or some where else ?
Some where else, the $replacer array is for static strings, i.e. simple matching. The regular expression goes on line 77, 91 or 119 depending on what you want to clean out, where the code is commented out like so :
#$text = preg_replace('##siU', '', $text);
3. Should I then run the cleaner as I stated by calling it by typing the URL ?!! it seems will hang because explorer can not handle all of the database date shown in one webpage !!
thanks.
You can call it from the command line also, just pipe the output into results.html for instance, or /dev/null if you dont care about the return codes. the current version isn't a propper CLI version yet.
mgurain
Tue 5th Apr '05, 6:55pm
Hello,
Ok, give me 1 string you want matched and cleaned out.
I gave examples in post #9 , ok take this one :
<span style="filter: glow(color={GLOWCOLOR}); height:20">
which is parsed now in VB as :
some text[/glow:234a498735]
phpBB BBcode was :
[glow=red]some text
thanks for your help Jerry, I appreciated.
Jerry
Tue 5th Apr '05, 8:19pm
[glow=red:234a498735]some text[/glow:234a498735]
To go from that to this :
some text
You'd need this :
$text = preg_replace('#\[glow=([^:]*):([a-z0-9]+)\](.*)\[/glow:\\2\]#siU', '$3', $text);
Then put that on line 77 of cleaner.php
Powered by vBulletin™ Version 4.0.0 Beta 4 Copyright © 2009 vBulletin Solutions, Inc. All rights