MyBB Hacks

Full Version: xThreads Display Item Format Not Parsing {VALUE|htmlspecialchars} for filmgenre Field
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
hello Zingaburga community

I’m having trouble with the XThreads Display Item Format for my filmgenre field. My goal is to display each genre value (e.g., "Drama, Romance, Supernatural, Paranoid") as separate HTML tags with individual CSS styling, like this:  

PHP Code:
<span class="genre-tag">Drama</span>
<span class="genre-tag">Romance</span>
<span class="genre-tag">Supernatural</span>
<span class="genre-tag">Paranoid</span>


here’s my setup:

  • key : input :{$tfinput['filmgenre']}. output : {$GLOBALS['threadfields']['filmgenre']}
  • filmgenre is a text input field in xThreads, with a value like "Drama, Romance, Supernatural, Paranoid".
  • In xThreads settings:  
    Display Item Format: <span class="genre-tag">{VALUE|htmlspecialchars}</span>  
    Display Format: <span class="genre-list">{VALUE}</span>  
    Blank Value: <span class="genre-list"><span class="genre-tag">No genre available</span></span>
  • css

    Code:
    .genre-list { display: inline; }
    .genre-tag { display: inline-block; color: #ff69b4; font-size: 12px; margin-right: 5px; }


However, the output in the thread is not parsed correctly. Instead of the expected HTML, I get:  

PHP Code:
{VALUE|htmlspecialchars}, {VALUE|htmlspecialchars}, {VALUE|htmlspecialchars}, {VALUE|htmlspecialchars}


It seems the {VALUE|htmlspecialchars} syntax isn’t being processed by XThreads. I’m using MyBB 1.8.x (please let me know if you need the exact version or XThreads version).  

How can I achieve the desired output where each genre is wrapped in its own <span class="genre-tag"> with proper styling? Is there a better way to split and style each genre value in xThreads?  

thank you for your help!  

demo: Indolokal

solved! Jap

Display Item Format
Like the "Display Format" field, but this one will be applied to every single value for this field as opposed to being applied to the concatenated list of values.

PHP Code:
<div class="info-value"><span class="genre-tag">{VALUE}</span></div>


still need to rearrange the css style because the layout is not what I want.
[attachment=2594]

I want it to look like this
[attachment=2595]

Reference URL's