well.. i was told to remind him later to do the whisper migration, and i believe thats one of the last things he has to do with the phpbb - vanilla migration. ive seen one of the migration tests hes done on some database, and it looks pretty sweet, all seems to work really well. gwan mini..
Right. I've done a bit more testing with outbreak and we both seem quite convinced its pulling as much information through as possible - i've even added the option of keeping or resetting existing passwords now marks changed from password to md5.
I just need to think through bbcode translations which I'll probably have to ignore unless anyone can think of a method to convert them easily?
I imagine many people who would be using the phpBB converter may also desire to use a bbcode extension...whoevers willing to create one!
Yeah - I looked into getting something that is already written and plopping it into vanilla (like I did with Markdown), but the bbcode code is really frickin convoluted and all over the place. There's no central "BBCodify" function anywhere that I could see.
If someone would write one, I'd be super happy. It would make a snazzy extension.
is convoluted word of the day or something? How many 'bbcode's are there? And what do they actually do? I've never really played with it. Doesnt it just require for pseudo html to be converted to hardcore stuff when people add the comment?
Um. Well if its just whats on that page then it looks to me like the migration will simply be a matter of a few replacements of eg [b] to when translating the post data..i just need to work out doing that in php, regexp i assume? The main issue is the overhead it will add...but we'll see.
As for an extension, i also dont see why it should be particularly difficult to implement?
Um. I'm sure i havent seen that post and this thread was showing as read...meh i'm probably being a fool. If i write the stuff to convert bbcode in existing threads i'll pass it your way mark so you can add it to the formatter ok?
So...is it cheating for me to just take this: <?php function replaceMessage($message) { $message = strip_tags($message, '<b>');
$message = str_replace ("\n", " ", "$message"); // When you store the $message in a database you might get errors cause of the quotes $message = str_replace("[singleQuote]", "'", $message); $message = str_replace("[doubleQuote]", "\"", $message);
Hmm. Either somethings fucked up or just the process of checking each comment is pushing execution times over the edge... I'll have another look but i'm thinking the bbcode translation will have to be an addon if anything.
Quite fortunate though; i'd kinda forgotten about execution time limits. How can i get round them since in cases of over 25000 posts it will take more than the (presumably default) 30 seconds?
why don't you try something like mark did with the file browsers thumbnailer. run through x number of records, then display a status screen, and meta-refresh the page and move on to the next set of records.
make sure that it says not to close the browser until the entire process is done, or something to that effect.
i don't think you're going to be able to set the max_execution_time without having access to the php.ini and that's not feasible on shared hosting servers.
Well as i say, i'll probably leave that bit to you, i've never used javascript and as you've done so nicely with the vanilla installer i think it'd be cool if they went hand in hand.
Comments
ive seen one of the migration tests hes done on some database, and it looks pretty sweet, all seems to work really well.
gwan mini..
I just need to think through bbcode translations which I'll probably have to ignore unless anyone can think of a method to convert them easily?
I imagine many people who would be using the phpBB converter may also desire to use a bbcode extension...whoevers willing to create one!
Yeah - I looked into getting something that is already written and plopping it into vanilla (like I did with Markdown), but the bbcode code is really frickin convoluted and all over the place. There's no central "BBCodify" function anywhere that I could see.
If someone would write one, I'd be super happy. It would make a snazzy extension.
How many 'bbcode's are there? And what do they actually do? I've never really played with it. Doesnt it just require for pseudo html to be converted to hardcore stuff when people add the comment?
As for an extension, i also dont see why it should be particularly difficult to implement?
You can implement a string formatter and it will be one of the options at the bottom of the comment input.
If i write the stuff to convert bbcode in existing threads i'll pass it your way mark so you can add it to the formatter ok?
That sounds swell. Just do it all in a single function and my job will be easy peezy
Outbreak - as far as you know, are all the optional bbcode's on that page you linked me to?
<?php
function replaceMessage($message) {
$message = strip_tags($message, '<b>');
$message = str_replace ("\n", "
", "$message");
// When you store the $message in a database you might get errors cause of the quotes
$message = str_replace("[singleQuote]", "'", $message);
$message = str_replace("[doubleQuote]", "\"", $message);
$message = str_replace ("[U]", "", "$message");
$message = str_replace ("[/U]", "", "$message");
$message = str_replace ("[I]", "", "$message");
$message = str_replace ("[/I]", "", "$message");
$message = str_replace ("[B]", "", "$message");
$message = str_replace ("[/B]", "", "$message");
$message = replaceUrl($message);
$message = replaceImg($message);
return $message;
}
function replaceImg($message) {
// Make image from [img]htp://.... [/img]
while(strpos($message, "[img]")!==false){
$begImg = strpos($message, "[img]");
$endImg = strpos($message, "[/img]");
$img = substr($message, $begImg, $endImg-$begImg+6);
$link = substr($img, 5, $endImg - $begImg -5);
$htmlImg = "";
$message = str_replace($img, $htmlImg, $message);
// searches for other [img]-nodes
}
return $message;
}
function replaceUrl($message) {
// Make link from [url]htp://.... [/url] or [url=http://.... ]text[/url]
while(strpos($message, "[url")!==false){
$begUrl = strpos($message, "[url");
$endUrl = strpos($message, "[/url]");
$url = substr($message, $begUrl, $endUrl-$begUrl+6);
$posBracket = strpos($url, "]");
if ($posBracket != null){
if ($posBracket == 4){
// [url]http://.... [/url]
$link = substr($url, 5, $endUrl - $begUrl -5);
$htmlUrl = "$link";
} else {
// [url=http://....]text[/url]
$link = substr($url, 5, $posBracket-5);
$text = substr($url, $posBracket+1, strpos($url, "[/url]") - $posBracket-1);
$htmlUrl = "$text"; } } $message = str_replace($url, $htmlUrl, $message); // searches for other [url]-nodes } return $message; } ?>
off php.net and edit it ever so slightly?
It seems silly to rewrite an identical function...
Cheat!
Cheat until your testicles fall off.
Quite fortunate though; i'd kinda forgotten about execution time limits. How can i get round them since in cases of over 25000 posts it will take more than the (presumably default) 30 seconds?
make sure that it says not to close the browser until the entire process is done, or something to that effect.
i don't think you're going to be able to set the max_execution_time without having access to the php.ini and that's not feasible on shared hosting servers.
Maybe i'll leave that bit to mark as i imagine he's best making the gui anyway..my design abilities are even worse than my coding ones
You could also use ajax to do it table by table and just add comments to the page as things finish.
If I were to start the thumbnailer all over again, that's how I'd do it.