The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Parse BBCode in new messages forum block ?
Hello,
I'm using the sidebar on my forum, that uses forum blocks to show last threads, random image from members albums, and so on. We have a little problem with BBCode, which is not parsed in the sidebar blocks. For example, if I write this text in red and italic, it will be displayed like this in the sidebar : if I write this text in red and italic According to that message, it isn't possible to parse BBCode in sidebar without modification, so, that's why I ask this here... I hope I'm clear enough Many thanks for your answers ! |
#2
|
||||
|
||||
Are you using a custom "Forum Block" to display the content of recent posts in the sidebar?
Is the post content actually displayed, or is it available as a tooltip? Are you showing the entire post, or a truncated preview? If it is truncated, then you run into the issue of "orphaned" BBCode/HTML tags. Can you post a screenshot of your forum block displaying post content? |
#3
|
|||
|
|||
Hi Mark, and thank you for your answer !
The forum block is by default, the one that shows new messages. The post content is showing, but truncated (as shown in the attached image). As far as I understand, because of this truncation, the BBCode end tags aren't considered so the tags aren't parsed ? In the attachment, the text "Qu?te les dessous de Port-Couchant" and so on... is supposed to be in italic. Is there a fix ? Please consider that we introduced some custom tags, and I don't know if we could fix this for those custom tags... Thank you ! |
#4
|
||||
|
||||
I think that to get the default "New Forum Posts" block to parse BBCodes, a core file would have to be edited. I try to avoid this whenever possible. If you set about editing your core files, then these edits have to be made each time you upgrade vBulletin.
The other alternative would be to create a custom forum block that roughly duplicates the default block's function, and then you could manipulate the post text however you want, including calling the BBCode parsing function and handling potentially orphaned tags if you choose to truncate the content. Another alternative for long posts would be to put the post content in an element with a maximum height, and a vertical scrollbar is introduced as needed. Let me know your thoughts on these issues, and I will see what I can do with it. |
#5
|
|||
|
|||
I wouldn't want to edit core files as I'm not sure to avoid damages on my forum...
So maybe the custom forum block is the best way. Anyway, I would like very much to truncate too long messages, as some members send veeeery long posts (as there is a roleplay part on our forum). If this is possible to keep the truncation and close orphan tags, this would be the best for our use ! Again, many thanks, Mark |
#6
|
||||
|
||||
Here is how I configured the custom block:
And this is the "Content": PHP Code:
PHP Code:
Note: You must have PHP version 5.3 or higher in order for this to work. |
#7
|
|||
|
|||
Hello Mark, and thank you for your help !
It seems to work properly, except for the character encoding. I'm not accustomed with this but I guess this is a conflict between UTF-8 and ISO-8859. Here are some examples of those errors : - Débat autour de suppression [...] - J'ai reçu un mp d'un nouveau [...] - L?’homme tomba [...] Any idea ? Thank you again ! |
#8
|
||||
|
||||
Okay, try changing:
PHP Code:
PHP Code:
Here's a version that will show complete posts within a scrollable element, and if you have my acronym and username markup products installed, it will parse those as well: PHP Code:
|
#9
|
|||
|
|||
Hello Mark,
I tried but this changed nothing. Out of curiosity, I tried with 'UTF-8' instead and the message preview doesn't appear, only the link to the post and the name of the member who posted. I forgot to mention that our server runs on Ubuntu, so the encoding may be UTF-8 ? Thank you again ! |
#10
|
||||
|
||||
Quote:
Send the credentials for a temporary admin account to me by PM, and I can take a look within the next several days at the latest. |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|