XF 1.1 HTML Thread

  • Thread starter Thread starter Deleted member 10469
  • Start date Start date
D

Deleted member 10469

Guest
Hello, i'm having a trouble with my forum.
I did a convertion from "Ipboard" to "xenforo".
Ipboard's got a fonctionality that allows Htlm inside some messages for a group of users.

The matter is that this fonctionality doesn't exist on Xenforo, so in the messages, some Html is visible.

1bjPY.jpg


I only found this addon :
http://xenforo.com/community/resources/html-bbcode-permission-protected.731/update?update=1697

But this addon doesn't fit with Xenportal.
Moreover, it is impossible to use bbcode inside Html, that is to say that i'd have to edit more than 250 news on my own in order to add the tags [parsebbcode]...

Do you know how to help me please ?
Thank you.
 
As stated in my other thread, your only options are:

1) Speak to the creator of the ParseHTML add-on to see if it can work with XenPorta
2) Use the Find and Replace content add-on I mentioned to find the tags and replace them with bbcode.
 
I managed to replace 90% of tags with notepad++.

Do you have a regex to replace images please? :)
<img style="margin: 10px; float: left;" src="http://www.gamalive.com/images/screen/prev-18587-enderal.jpg" alt="" width="150" height="84" />

I assume the src doesn't really contain [url] tags?

Using this addon:

http://xenforo.com/community/threads/post-content-find-replace.6548/

Quick Find: <img

Regular expression: #<img.*src="([^"]+)".*/>#siU

Replacement String: [IMG]\1[/IMG]
 
I assume the src doesn't really contain [url] tags?

Using this addon:

http://xenforo.com/community/threads/post-content-find-replace.6548/

Quick Find: <img

Regular expression: #<img.*src="([^"]+)".*/>#siU

Replacement String: [IMG]\1[/IMG]


I think that regex is too "greedy". You can test with those examples:
Code:
<img style="margin: 10px; float: left;" src="http://www.gamalive.com/images/screen/prev-18587-enderal.jpg" alt="" width="150" height="84" />Heyyyyyyyy don't catch me please !!!<br />
or with that code:
Code:
<img style="margin: 10px; float: left;" src="http://www.gamalive.com/images/screen/prev-18587-enderal.jpg" alt="" width="150" height="84" />Heyyyyyyyy don't catch me please !!!<br />
[I]You Go[/I], [I]We Go[/I] ! <br />

I would use this regex instead:
Regular expression: #<img.*?src="([^"]+?)"[^<]+?/>#iU

P.S: the 'single line' mode (#s) is confusing. It makes in fact the text your search inside as a BIG one single line. So the dot will match any new lines. See here for more info.
 
ok thank you, are there any tools for beginners to create these things without knowledge in regular expression? :)
 
ok thank you, are there any tools for beginners to create these things without knowledge in regular expression? :)
The Editor I use is Editpad. It's the honestly the best to test regex. But remember: Regex are evil ^^ You can spend hours on a single line of code. If you want to create regex, there is a tool from the same editor: RegexBuddy, but I don't use it (it looks too complex). Oh, and you will have to update your code to the regex engine (the one used by php is not the same than the one used by Javascript for example).


Edit: this editor has a website (probably one of the most famous) to "help" to use Regex : http://www.regular-expressions.info
Other great resources:
http://blog.stevenlevithan.com/
http://www.asiteaboutnothing.net/regex/
 
Top Bottom