Register Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools
  #1  
Old 14 Jan 2016, 10:44
Mornagest Mornagest is offline
 
Join Date: Sep 2009
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 !
Reply With Quote
  #2  
Old 14 Jan 2016, 16:20
MarkFL's Avatar
MarkFL MarkFL is offline
 
Join Date: Feb 2014
Real name: Mark
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?
__________________
Former vBulletin.org Staff Member



Support for my products (as well as updates/new product publishing) has been moved to MHB - vBulletin Products and TAZ - Add-ons
Reply With Quote
  #3  
Old 14 Jan 2016, 18:04
Mornagest Mornagest is offline
 
Join Date: Sep 2009
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 "Qute 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 !
Attached Images
File Type: jpg newposts.jpg (59.3 KB, 7 views)
Reply With Quote
  #4  
Old 14 Jan 2016, 19:10
MarkFL's Avatar
MarkFL MarkFL is offline
 
Join Date: Feb 2014
Real name: Mark
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.
__________________
Former vBulletin.org Staff Member



Support for my products (as well as updates/new product publishing) has been moved to MHB - vBulletin Products and TAZ - Add-ons
Reply With Quote
  #5  
Old 14 Jan 2016, 19:57
Mornagest Mornagest is offline
 
Join Date: Sep 2009
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
Reply With Quote
  #6  
Old 16 Jan 2016, 05:37
MarkFL's Avatar
MarkFL MarkFL is offline
 
Join Date: Feb 2014
Real name: Mark
Here is how I configured the custom block:



And this is the "Content":


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Near the top, you can control how many posts a user will see, and how many characters of the post will be displayed, by altering these two lines:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Users will only see posts they have permission to see. Give this a try and let me know how it works for you.

Note: You must have PHP version 5.3 or higher in order for this to work.
Attached Images
File Type: png recent_post_custom.png (44.3 KB, 74 views)
__________________
Former vBulletin.org Staff Member



Support for my products (as well as updates/new product publishing) has been moved to MHB - vBulletin Products and TAZ - Add-ons

Last edited by MarkFL; 16 Jan 2016 at 06:05.
Reply With Quote
  #7  
Old 16 Jan 2016, 11:24
Mornagest Mornagest is offline
 
Join Date: Sep 2009
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 !
Reply With Quote
  #8  
Old 16 Jan 2016, 13:24
MarkFL's Avatar
MarkFL MarkFL is offline
 
Join Date: Feb 2014
Real name: Mark
Okay, try changing:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

to:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

--------------- Added 16 Jan 2016 at 15:46 ---------------

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:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

__________________
Former vBulletin.org Staff Member



Support for my products (as well as updates/new product publishing) has been moved to MHB - vBulletin Products and TAZ - Add-ons
Reply With Quote
  #9  
Old 16 Jan 2016, 20:29
Mornagest Mornagest is offline
 
Join Date: Sep 2009
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 !
Reply With Quote
  #10  
Old 16 Jan 2016, 20:40
MarkFL's Avatar
MarkFL MarkFL is offline
 
Join Date: Feb 2014
Real name: Mark
Originally Posted by Mornagest View Post
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 !
I have access to both a Windows and a Linux server, and it parses special characters with no problem on both. Since I cannot duplicate the issue you are having, I would have to come to your site to see what I have to do to get it running for you.

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.
__________________
Former vBulletin.org Staff Member



Support for my products (as well as updates/new product publishing) has been moved to MHB - vBulletin Products and TAZ - Add-ons
Reply With Quote
  #11  
Old 16 Jan 2016, 20:55
Mornagest Mornagest is offline
 
Join Date: Sep 2009
I sent you this PM thanks !
Reply With Quote
  #12  
Old 18 Jan 2016, 16:47
MarkFL's Avatar
MarkFL MarkFL is offline
 
Join Date: Feb 2014
Real name: Mark
Just to follow up, I had to use the "scrollable" code in post #8 on the OP's site (minus the background color) because the code to truncate the post content would not work with UTF-8 encoding.
__________________
Former vBulletin.org Staff Member



Support for my products (as well as updates/new product publishing) has been moved to MHB - vBulletin Products and TAZ - Add-ons
Reply With Quote
  #13  
Old 18 Jan 2016, 20:04
Mornagest Mornagest is offline
 
Join Date: Sep 2009
Aow, I wanted to like that post but I cannot like two posts from one member in a row... it's the thought that counts !
Reply With Quote
  #14  
Old 24 Feb 2016, 05:15
MarkFL's Avatar
MarkFL MarkFL is offline
 
Join Date: Feb 2014
Real name: Mark
Originally Posted by Mornagest View Post
Aow, I wanted to like that post but I cannot like two posts from one member in a row... it's the thought that counts !
I have finally turned this into a product, found here:

Forum Sideblock - Recent Posts (with BBCodes parsed)

I listed you as a co-author as promised.
__________________
Former vBulletin.org Staff Member



Support for my products (as well as updates/new product publishing) has been moved to MHB - vBulletin Products and TAZ - Add-ons
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


New To Site? Need Help?

All times are GMT. The time now is 09:49.

Layout Options | Width: Wide Color: