How can I adjust the character limit that shows on index for recent posts?

Started by OBAMLabs, June 06, 2024, 05:41:43 PM

Previous topic - Next topic

OBAMLabs

On the right side of the boards, it has a limit of the letters and then does the '...'. How can I make that section fill to the end of the box and/or allow more letters to show before the '...' cut off.

Thanks!


dodos26

This is definitely truncated on the php side.
But when you hover your cursor it should show the back fully. At least most styles.
Now there are two options. Or do it in javascript, copying the title from link a and inserting a inside it, example:
Code (from) Select
<a href="https://xxx.org/index.php?topic=163.msg172#new" title="Wojownicze Żółwie Ninja Trylogia / Teenage Mutant Ninja Turtles Trilogy (1990 - 1993) [52,87 GiB] [DA/LP/NA/NM/NP] [VC-1 24.2 Mb/s - 25.5 Mb/s] [MLP FBA 1 700 kb/s - 3 168 kb/s] [AAC LC 304 kb/s] [AC-">Wojownicze Żółwie Ninja ...</a>
Code (to) Select
<a href="https://xxx.org/index.php?topic=163.msg172#new" title="Wojownicze Żółwie Ninja Trylogia / Teenage Mutant Ninja Turtles Trilogy (1990 - 1993) [52,87 GiB] [DA/LP/NA/NM/NP] [VC-1 24.2 Mb/s - 25.5 Mb/s] [MLP FBA 1 700 kb/s - 3 168 kb/s] [AAC LC 304 kb/s] [AC-">Wojownicze Żółwie Ninja Trylogia / Teenage Mutant Ninja Turtles Trilogy (1990 - 1993) [52,87 GiB] [DA/LP/NA/NM/NP] [VC-1 24.2 Mb/s - 25.5 Mb/s] [MLP FBA 1 700 kb/s - 3 168 kb/s] [AAC LC 304 kb/s] [AC-</a>To make this script I need information about the name of your style if it is free.

The second option is to modify the php. Go to forum dir and folder Soucres have file Subs-BoardIndex.php open and function getBoardIndex.
This is the part you are interested in:
        // Provide the href and link.
        if ($row_board['subject'] != '')
        {
            $this_last_post['href'] = $scripturl . '?topic=' . $row_board['id_topic'] . '.msg' . ($user_info['is_guest'] ? $row_board['id_msg'] : $row_board['new_from']) . (empty($row_board['is_read']) ? ';boardseen' : '') . '#new';
            $this_last_post['link'] = '<a href="' . $this_last_post['href'] . '" title="' . $row_board['subject'] . '">' . $row_board['short_subject'] . '</a>';
        }
        else
        {
            $this_last_post['href'] = '';
            $this_last_post['link'] = $txt['not_applicable'];
        }

I think u know $row_board['subject'] . '">' . $row_board['short_subject'] ---> $row_board['subject'] . '">' . $row_board['subject']

THIS will probably spoil the appearance of your forum if the titles are long so you have to add shortening manually or add css styling after editing. U can do it in themes/yourALLthemes/ and MessageIndex.template.
To found try search $board['last_post']['link']
Add max-width example 10vh. And back to ur subs and in link <a... add style word-wrap: break-word;


Sir Osis of Liver

Subs-BoardIndex.php


$row_board['short_subject'] = shorten_subject($row_board['subject'], 24);


Change '24' to larger value.  Be careful it doesn't screw up mobile formatting.
When in Emor, do as the Snamors.
                              - D. Lister

Advertisement: