Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
use mycode to replace bad <img tag after migration
Ok, I just migrated over from IPB 3.4.x. I've use MyCodes to replace a few things that didn't quite work as planned in the migration, but I can't figure this out...because it works in the AdminCP 

here's my regular expression...I know it seems very specific, but that's because ever instance is consistent:

\<img src='http:\/\/www\.titanspot\.com\/Titan\/public\/style_emoticons\/<(.*?)>\/(.*?)\.(.*?)' class='bbc_emoticon' alt='(.*?)' />

My replacement is simply this:

<img src='/mybb/uploads/style_emoticons/default/$2.$3' />

In the MyBB Sandbox test value, I enter this:
<img src='<#EMO_DIR#>/002.gif' class='bbc_emoticon' alt=':smt002' />
and get this as expected: 
<img src='/mybb/uploads/style_emoticons/default/002.gif' />

But nothing happens in the actual forum.  Any idea what I'm missing here?

I am not saying that I am 100% correct on this, but the format for the regular expression should be:
BBcodes use brackets "[ ] [/]" to convert HTML code. I am not sure if your method will work if the regular expression is not like that. If you are hoping that MyCode will convert messed up html when it's not in bbcode format will not do anything and you have to manually use what you want to bbcode format. The merge system needs to be updated with the HTML conversion problem. Have a staff member confirm this, but that is what my view on why this is not working.
Best Regards,

[Image: Y1db4R6.gif]
This might be a situation where you want to run an sql query to update the database table instead of reparsing it everytime the post is shown.

Forum Jump:

Users browsing this thread: 1 Guest(s)