Hello, Does anyone know how to change the description field of an uploaded file as formatted/HTMl input instead of the normal text?
I'd like to insert screenshots and format the view of in the descriptions.
Thanks!
Angelo
Hello, Does anyone know how to change the description field of an uploaded file as formatted/HTMl input instead of the normal text?
I'd like to insert screenshots and format the view of in the descriptions.
Thanks! Angelo |
Find inc/classes/BXDolFilesDb.php
Around line 193, you'll see: $sqlQuery .= "`{$this->aFileFields[$sKey]}`='" . process_db_input($sValue, BX_TAGS_STRIP) . "', ";
Change: BX_TAGS_STRIP To: BX_TAGS_VALIDATE
Clear cache.
Keep in mind that this will also allow you to post descriptions in video, sound, photo, etc. description boxes too. It'll no longer strip away the html. It'll also allow your members to post html too (for better or worse).
I find the formatted text and the ability to post related affiliate links in that description box very beneficial. |
You will find it useful until your members realize they can use html and start abusing it. Before facebook became as popular as it was, myspace was on top. The ability for members to use html caused a lot of problems for them. Eventually they had to start filtering it out. Hence the reason most social network sites no longer allow it. $sqlQuery .= "`{$this->aFileFields[$sKey]}`='" . process_db_input($sValue, BX_TAGS_VALIDATE) . "', "; $sqlQuery .= "`{$this->aFileFields[$sKey]}`='" . process_db_input($sValue, BX_TAGS_STRIP) . "', "; } https://www.deanbassett.com |
dean, that's even better! Making the change on all my sites. |
or if I have to put the code ( isAdmin ()) because I have an error ( Parse error: syntax error, unexpected 'if' (T_IF), expecting function (T_FUNCTION) in)
} $sqlQuery .= "`{$this->sFileTable}` SET "; foreach ($aData as $sKey => $sValue) { if (array_key_exists($sKey, $this->aFileFields)) $sqlQuery .= "`{$this->aFileFields[$sKey]}`='" . process_db_input($sValue, BX_TAGS_STRIP) . "', "; } return $this->query(trim($sqlQuery, ', ') . $sqlCond); } Thank You |
you have an idea? |
The above solution from deano92964 still works perfect for me in v7.3. |
The above solution from deano92964 still works perfect for me in v7.3.
no change on the description, or is the error? ------------------ $aData['Hash'] = md5(microtime()); } $sqlQuery .= "`{$this->sFileTable}` SET "; foreach ($aData as $sKey => $sValue) { if(isAdmin()) $sqlQuery .= "`{$this->aFileFields[$sKey]}`='" . process_db_input($sValue, BX_TAGS_VALIDATE) . "', "; $sqlQuery .= "`{$this->aFileFields[$sKey]}`='" . process_db_input($sValue, BX_TAGS_STRIP) . "', "; } return $this->query(trim($sqlQuery, ', ') . $sqlCond); }
function deleteData ($iFile) |
Where is your else statement in the above? If admin, accept html description; else strip html from all others.
if(isAdmin()) { $sqlQuery .= "`{$this->aFileFields[$sKey]}`='" . process_db_input($sValue, BX_TAGS_VALIDATE) . "', "; $sqlQuery .= "`{$this->aFileFields[$sKey]}`='" . process_db_input($sValue, BX_TAGS_STRIP) . "', "; } |
Okay, change error Parse error: syntax error, unexpected 'else' (T_ELSE) in /var/www/vhosts/msite/inc/classes/BxDolFilesDb.php on line 194 |
Your missing a opening bracket { after if(isAdmin()) https://www.deanbassett.com |
Very good Deano |