News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Can I increase topic length?

Started by NXN, September 07, 2005, 10:20:39 AM

Previous topic - Next topic

NXN

I'm using smf 1.05 and set charset to utf-8
at first I didn't notice about the topic length but later I found that when I post a long topic name will cause SMF to change it to a short one

Can I increase the topic length?


So sorry about my English :p

[Unknown]

First, run this query:

ALTER TABLE smf_messages
CHANGE COLUMN subject subject text;

What is phpMyAdmin?

And then, remove the following to sections from Sources/Post.php:

// Make sure the subject isn't too long.
if (strlen($form_subject) > 100)
$form_subject = substr($form_subject, 0, 100);


// At this point, we want to make sure the subject isn't too long.  Stripslashes first to avoid a trailing slash.
if (isset($_POST['subject']) && strlen(stripslashes($_POST['subject'])) > 100)
$_POST['subject'] = addslashes(substr(stripslashes($_POST['subject']), 0, 100));


How do I modify files?

-[Unknown]

Oldiesmann

Don't forget this part too...

Themes/default/Post.template.php

Find
<input type="text" name="subject"', $context['subject'] == '' ? '' : ' value="' . $context['subject'] . '"', ' size="80" maxlength="80" tabindex="1" />

Remove the maxlength="80" part.
Michael Eshom
Christian Metal Fans

au8ust

It seems not working with v1.1.2
I can't make a long topic name but I can later edit it manually to get longer topic name

Any idea on this?

au8ust


SleePy

Is this issue solved or do you still require assistant?

What part is not working?
Jeremy D ~ Site Team / SMF Developer ~ GitHub Profile ~ Join us on IRC @ Libera.chat/#smf ~ Support the SMF Support team!

au8ust

So sorry for my late answer, I just get it working a month ago. It seems to be problem with DB, so I just install to new DB and modify it as [Unknown]'s advice.

Thanks!

ElectricSquid

With more recent versions of SMF, like SMF 1.1.10, do we still need to do a database query?

QuoteFirst, run this query:

ALTER TABLE smf_messages
CHANGE COLUMN subject subject text;

I modified Sources/Post and default/Post like suggested above and everything seems to work without issue. I was wondering if the database query is even needed anymore.


(if you do a site search for "increase topic length", this topic from 2005 is the result)

Advertisement: