Can I change the allowed length of topic titles?

Started by JayRoe, June 03, 2008, 07:13:43 AM

Previous topic - Next topic

JayRoe

As the topic says, can I change the allowed length of topic titles?  :)

H

I don't believe you can by default howver you can request this as a mod in Mod Requests
-H
Former Support Team Lead
                              I recommend:
Namecheap (domains)
Fastmail (e-mail)
Linode (VPS)
                             

JayRoe

It seems like such a minor little change, that I don't want to trouble you guys for it. Is there a file where I can change the value manually?

H

You'll have to check for any limits that are defined on the post screen input field and in the post processing. You'll probably also have to check the title length in the database in the smf_messages and smf_topics tables.
-H
Former Support Team Lead
                              I recommend:
Namecheap (domains)
Fastmail (e-mail)
Linode (VPS)
                             

booher

hmm... im pretty sure you can in admin --> forum --> Posts and tops --> post settings :)

Johno69

Quote from: booher on June 04, 2008, 05:55:55 PM
hmm... im pretty sure you can in admin --> forum --> Posts and tops --> post settings :)

No it's not there.

Bulakbol

You can try this. Edit your Sources/Post.php. Find
if (!isset($_POST['subject']) || $func['htmltrim']($_POST['subject']) === '')
$post_errors[] = 'no_subject';


and add after it.
elseif (strlen($_POST['subject']) > 50)
$_POST['subject'] = substr($_POST['subject'], 0, 47).'...';


Change the 50 and 47 to your desired length.
Please do not PM me for support · My Mods and Theme · SMF Coding Guidelines · Modifications Approval Guidelines

Johno69

Perfect thanks.

I wish it could change previously posted topics, but I can live with that.

Awesome  !

metallica48423

it does that to keep the titles from distorting the size of the tables.  on larger resolutions its rarely a problem, but on smaller ones it could cause the odd issue here and there with long topic titles.

Glad you found a solution, though :)
Justin O'Leary
Ex-Project Manager
Ex-Lead Support Specialist

QuoteMicrosoft wants us to "Imagine life without walls"...
I say, "If there are no walls, who needs Windows?"


Useful Links:
Online Manual!
How to Help us Help you
Search
Settings Repair Tool

Johno69

I have a large resolution, but my forum theme is not fluid. So the resolution has no bearing.

It was basically pushing the "Time posted" off the endge of the template.

Johno69

#10
Actually this isn't working as planned.

I use the RSS Feed Poster mod, and the feed poster seems to be allowed to post longer titles.

So not working as I had wanted.


metallica48423

#11
That mod uses another instance of createPost than the one that is used in posting normally...  so it wouldn't be caught by the same restrictions as the post form.

in /Sources/Subs-RSS.php, find

'subject' => $feed['topicprefix'] . $msg_title,

and replace it with:

'subject' => substr(($feed['topicprefix'] . $msg_title), 047) . '...';

where, 47, is, of course, your length
Justin O'Leary
Ex-Project Manager
Ex-Lead Support Specialist

QuoteMicrosoft wants us to "Imagine life without walls"...
I say, "If there are no walls, who needs Windows?"


Useful Links:
Online Manual!
How to Help us Help you
Search
Settings Repair Tool

Johno69

Thanks, i've just posted a pic of the issue above.. will look into the mod and see what I can find.

Johno69

Parse error: syntax error, unexpected ';', expecting ')' in /home/hustler/public_html/***/forum/Sources/Subs-RSS.php on line 280

Gives this error :(

metallica48423

Oops.  Sorry about that.

it should be:

'subject' => substr(($feed['topicprefix'] . $msg_title), 047) . '...',
Justin O'Leary
Ex-Project Manager
Ex-Lead Support Specialist

QuoteMicrosoft wants us to "Imagine life without walls"...
I say, "If there are no walls, who needs Windows?"


Useful Links:
Online Manual!
How to Help us Help you
Search
Settings Repair Tool

Johno69

Thanks.

See how it goes when it posts now, will let you know.

Advertisement: