PDA

View Full Version : Subject cutoff?


07-06-2000, 04:47 PM
Most people would probably find this useless, but I wanted to know if there were anyway to set a limit to the number of characters of the subject is displayed in the forumdisplay page. I mean I hate posts that have a huge subject that takes up 8 lines or something.
Something where after XX chars, or even XX lines, the subject is cut off and turned into "..." But when the post is read, the entire subject show's up.

[Edited by thetakerfan on 07-06-2000 at 01:49 PM]

07-06-2000, 04:54 PM
That would not be very hard to do at all. Just test the length of the string and if it is too big, truncate it and at "..." to the end of it. I would do it but I am not sure of PHP's string manipulation functions. I really do need to get a book.

07-06-2000, 05:06 PM
I have absolutely no clue when it comes to PHP, I was just starting to get into CGI/Perl when I decided to dumb UBB and go with vB

07-06-2000, 05:45 PM
You'll have to do something like this:

if(strlen($subject) > 20)
$truncatedSubject = substr($subject, 0, 20) . "...";

and then print $truncatedSubject instead of $subject

(not sure though, didn't looked into the script)

07-06-2000, 05:54 PM
It might be easier if you just manually edit your template (newthread) on the subject line and make the max length for the topic shorter.

-Brian

07-06-2000, 10:08 PM
I want the subject when reading the post to be whatever length, its just on the forumdisplay that I want to limit it.

07-07-2000, 09:25 AM
actually, i was working on hack for urls: long urls tend to break page layout, so I was fooling with having http://www.domain.com/.../last_dir/file.html

Mas*Mind's code is pretty correct, all you need is to hack forumdisplay.php

I'll do this once the poll hack is done

07-10-2000, 02:14 PM
I can't seem to get more than 100 characters into my thread titles even if I want to -- but can't find any limit in the php3 code that's causing it.

Anybody know why? I'd like to have a limit of something more than 100 characters.

Am running 1.1.3. Thanks!

07-10-2000, 02:28 PM
Check the newthread template for that field I think its max charectors allowed might be set to 100.

-Brian

07-10-2000, 03:07 PM
Thanks for the suggestion! I changed the field from an INPUT box to a TEXTAREA -- although the TEXTAREA has no size limit (I don't think HTML allows for one), maybe I need to go back to an INPUT box and put MAXLENGTH=200 or something. Will report back.

07-10-2000, 03:28 PM
Naw, crud, that didn't do it.

Maybe some kind of limitation in the SQL table itself?

07-10-2000, 04:47 PM
Dave, install phpmyadmin in a password protected folder and use it to adjust the title length. there is a preset limit on the column of 100 characters.

07-10-2000, 05:15 PM
You da man, Martin. Worked perfectly. THANKS.

Do you think I should adjust the subjectindex field up from 100 to 250 also, in addition to the title field? (I'm not sure what subjectindex does.)