About color: do you mean that phpBB will interpretate "SandyBrown"??


Test it: this should be SandyBrownTom1884 wrote:About color: do you mean that phpBB will interpretate "SandyBrown"??![]()
Code: Select all
[color="SandyBrown"]this will NOT work[/color]
Code: Select all
[color=SandyBrown]this will work[/color]
Code: Select all
[color="#0000FF"]this will NOT work[/color]
Code: Select all
[color=#0000FF]this will work[/color]
Code: Select all
function vb3_replace_size($matches) {
$new_size = array(
1 => "75",
2 => "100",
3 => "110",
4 => "130",
5 => "150",
6 => "180",
7 => "200"
);
return '[size=' . $new_size[$matches[1]] . ']';
}
while ($row = mysql_fetch_array($result)) {
$oldid = $row['post_id'];
$message = $row['post_text'];
if (stripos($message, '[size=') !== false) {
$message = preg_replace_callback('/\[size=\"(\d*)\"\]/i', 'vb3_replace_size', $message);
$message = str_replace("[/SIZE]", "[/size]", $message);
}
if (stripos($message, '[color=') !== false) {
$message = preg_replace('/\[color=\"(\w*)\"\]/i', '[color=$1]', $message);
$message = str_replace("[/COLOR]", "[/color]", $message);
}
// UPDATE
$queryupdate = "UPDATE forumfanta_posts SET post_text = '$message' WHERE post_id = '$oldid'";
mysql_query($queryupdate, $db);
$i++;
}
Tom1884 wrote: After the php run correctly, we still have 3 problem:
the code is correctly modified, but the post doesn't "interpretate".
I have to edit the post, without modifying anything, and save: then it looks ok!
This is the first time I have heard of this happening with the STK. Are you sure the edited marker was not there before running the STK?Tom1884 wrote:I can fix it reparsing BBcode with stk tool, but then all the posts on the forum result edited by me!
Code: Select all
UPDATE phpbb_posts SET post_edit_time='', post_edit_reason='', post_edit_user='', post_edit_count=''
Code: Select all
UPDATE phpbb_posts SET post_edit_time='', post_edit_reason='', post_edit_user='', post_edit_count= WHERE post_edit_user = xx
Does this affect whole posts or only parts of them?Tom1884 wrote:1- some post aren't affected from any modification. Ex:
(...)
3- the script doesn't modified some "caped" tags as, for ex.: [SIZE=""], it remains the same. Look:
I've solved this part of the problem. MySql had problem with ' when updating, so it died.mario_7 wrote:Does this affect whole posts or only parts of them?Tom1884 wrote:1- some post aren't affected from any modification. Ex:
(...)
3- the script doesn't modified some "caped" tags as, for ex.: [SIZE=""], it remains the same. Look:
Are you sure that your while loop covers all posts?
Does the script finish it's work without errors (like timeout or out of memory or anything else)?
Code: Select all
query="UPDATE forum_posts SET post_text = '".addslashes($message)."' WHERE post_id = $id_post";
Do you mean that the option in STK to reparse BBCodes does not work at all?Tom1884 wrote:Anyway, ok, I've modified all the posts correctly but I still have the "parsing problem": new (and correct) code isn't interpretate and it's visualizated as it is in every edited post.
No no, STK works perfectly, it solves the problem! But it makes appear in every post the line "Edited by ... on ...", like it was the author of the post to edit the post (probably editing only post_edit_* column...?].mario_7 wrote:Do you mean that the option in STK to reparse BBCodes does not work at all?
Yes, it makes problems for me because in my forum we manage a game in which post time is part of the rules...mario_7 wrote:Does it make any problems? As far as I remember those informations are not visible for users without privileges to modify posts.
Code: Select all
UPDATE phpbb_posts SET post_edit_time='0', post_edit_reason='', post_edit_user='0', post_edit_count='0'