vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   $thread[title] (https://vborg.vbsupport.ru/showthread.php?t=63979)

Meltdown 04-20-2004 01:50 PM

Why dont you just open the 'newthread' template and change the 'maxlength="85" value of the title input to maxlength="45".

filburt1 04-20-2004 02:02 PM

Quote:

Originally Posted by Meltdown
Why dont you just open the 'newthread' template and change the 'maxlength="85" value of the title input to maxlength="45".

A user interface hack (hack in the negative sense) is never preferable to a cleaner system.

You can simply change the VARCHAR size of the title column in the thread table to the maximum size you want, which will definitely restrict character length. Combined with a maxlength attribute, it will work perfectly.

K33nny 04-20-2004 08:50 PM

Meltdown: Because I only want to cut the title off the thread title off during threadlist process. Also, my forums have been online for 3 years, with 270000 posts... so setting the cap now does very little. I have a certain cell width I want the titles to fit into so by cutting it off, it helps keep it within the cell.

filburt1: If I limit the VARCHAR size of the title column is it just going to randomly cut it off?

K33nny 04-23-2004 05:10 PM

Will someone please help me? I have not been able to port the vb3 stuff over to vb2.

TECK 04-23-2004 08:33 PM

Ok. But keep in mind that I don't use anymore VB2... :)
However, the code posted below will work perfectly for you.

Find the $thread['title'] (I don't remember the function name, sorry) and below, add:
Code:

if (strlen($thread['title']) > 45)
{
 $thread['title'] = substr($thread['title'], 0, 42) . '...';
}

That will replace the hole title, for example:
"The white dog jumps over the red deer to catch the yellow ball!"
with:
"The white dog jumps over the red deer to catch the yello..." (45 chars limit).

Sorry, but if other VB2 users know what is the function I talk about, they will tell you exacly where to place the code mentioned above.

As you see, is pretty easy.
No need to complicate your life with complex code, simple will do just great. :)

Regards,
Floren.


All times are GMT. The time now is 12:20 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01053 seconds
  • Memory Usage 1,726KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete