/includes/functions_display.php
:Code: Select all
'FORUM_DESC' => generate_text_for_display($row['forum_desc'], $row['forum_desc_uid'], $row['forum_desc_bitfield'], $row['forum_desc_options']),
Is this 50 characters in one fluent sentence, or perhaps 3 lines of 17/18 characters?dansmith018f wrote: ↑Wed Mar 14, 2018 4:57 pm ...
Is there any way I can limit the descriptions on the index to let's say 50 characters?
Code: Select all
'FORUM_DESC' => generate_text_for_display(truncate_string($row['forum_desc'], 50), $row['forum_desc_uid'], $row['forum_desc_bitfield'], $row['forum_desc_options']),
* Truncates string while retaining special characters if going over the max length
* The default max length is 60 at the moment
* The maximum storage length is there to fit the string within the given length. The string may be further truncated due to html entities.
* For example: string given is 'a "quote"' (length: 9), would be a stored as 'a "quote"' (length: 19)
*
FORUM_DESC
within that file. Did you edit the correct one?Code: Select all
/**
* Truncates string while retaining special characters if going over the max length
* The default max length is 60 at the moment
* The maximum storage length is there to fit the string within the given length. The string may be further truncated due to html entities.
* For example: string given is 'a "quote"' (length: 9), would be a stored as 'a "quote"' (length: 19)
*
* @param string $string The text to truncate to the given length. String is specialchared.
* @param int $max_length Maximum length of string (multibyte character count as 1 char / Html entity count as 1 char)
* @param int $max_store_length Maximum character length of string (multibyte character count as 1 char / Html entity count as entity chars).
* @param bool $allow_reply Allow Re: in front of string
* NOTE: This parameter can cause undesired behavior (returning strings longer than $max_store_length) and is deprecated.
* @param string $append String to be appended
*/
function truncate_string($string, $max_length = 60, $max_store_length = 255, $allow_reply = false, $append = '')
truncate_string($row['forum_desc'], 50, 255, false, '...')
not tested.Yes, but as I said making an extension around of this it is not really worth the effort, by my side at least.dansmith018f wrote: ↑Thu Mar 22, 2018 1:49 pm <t> is still present however at the start, any idea how to remove this?