2009-10-11, 08:06 PM
Hello there,
A couple of months ago I converted our forum from SMF 1.x to MyBB. I ran the merge tool and had a couple of problems which have mostly been fixed since.
My remaining problem is with quotes. Basically, simple quotes were converted fine, such as:
However, quotes with further arguments -- which were usually generated when clicking the quote button -- were not, so I'm stuck with many posts like this:
This bug report was around and unresolved back then, but it has since been resolved. The question is: how do I fix these quotes now? I had a knowledgeable member of the forum try to help me with some fairly advanced MySQL queries, but they weren't working presumably because his expertise is in MSSQL. As for me, I have no expertise in MySQL and I don't even know where to begin to write PHP code to run through every post & PM on the forum.
Anyway, here is the relevant code from bbcode_parser.php in the fixed version. Would be wonderful if someone could help convert to a working MySQL query or something.
Thank you.
A couple of months ago I converted our forum from SMF 1.x to MyBB. I ran the merge tool and had a couple of problems which have mostly been fixed since.
My remaining problem is with quotes. Basically, simple quotes were converted fine, such as:
[quote]
Blah blah
[/quote]
However, quotes with further arguments -- which were usually generated when clicking the quote button -- were not, so I'm stuck with many posts like this:
[quote author=Member link=topic=1.msg1#msg1 date=1237336287]
Blah blah
[/quote]
This bug report was around and unresolved back then, but it has since been resolved. The question is: how do I fix these quotes now? I had a knowledgeable member of the forum try to help me with some fairly advanced MySQL queries, but they weren't working presumably because his expertise is in MSSQL. As for me, I have no expertise in MySQL and I don't even know where to begin to write PHP code to run through every post & PM on the forum.
Anyway, here is the relevant code from bbcode_parser.php in the fixed version. Would be wonderful if someone could help convert to a working MySQL query or something.
/**
* Parses SMF quotes with author, post id and/or dateline.
*
* @param string The message to be parsed
* @param string The information to be parsed
* @return string The parsed message.
*/
function mycode_parse_post_quotes($message, $info)
{
$info = trim($info);
preg_match("#author=(.*?)=#i", $info, $match);
if($match[1])
{
$username = $match[1];
}
/*preg_match("#link=topic=([0-9]+).msg?([0-9]+)\#msg([0-9]+)?#i", $info, $match);
if($match[1])
{
$pid = $match[1];
}*/
preg_match("#date=?([0-9]+)#i", $info, $match);
if($match[1])
{
$dateline = $match[1];
}
return "[quote='{$username}' dateline='{$dateline}']{$message}[/quote]";
}
Thank you.