Custom Title Character Length

Started by Henzo, June 06, 2011, 06:26:49 PM

Previous topic - Next topic

Henzo

I was wondering if anyone knew which file I need to edit in order to increase the character limit for custom titles.

Currently the limit is 255, but I use BBC code in my custom titles to integrate imagery, so an unlimited amount would be preferable.

Edit: using SMF 1.1.13

Henzo

Found some information in the following post, but it doesn't seem to affect the field at all:

http://www.simplemachines.org/community/index.php?topic=381296.msg2626295#msg2626295

Antechinus

That should work. It wont affect existing ones but should limit new entries.

ETA: It wont change the visible size. It just limits the number of characters that can be entered. If you want to change the visible size, edit the size attribute for the input.

Henzo

It works if you put in something lower than 255, but any value higher that 255 has no effect. The title is truncated to a maximum of 255 characters. Any work-around?

Antechinus

Ah. Sorry. Got mixed up. The other thread was talking about making it shorter (and that's something I've been meaning to do for the site I run).

Not sure offhand if there is a workaround for that. Haven't looked into it. I'll take a look at it later if somebody doesn't beat me to it.

Henzo


Antechinus

Ah. That field is tinytext in the database, which places a limit on how many bytes it can contain.

http://www.w3schools.com/SQL/sql_datatypes.asp

If it was changed it to longtext that would allow 232 bytes instead of 28, which would effectively give you unlimited scope. That would be overkill though. I think using text would allow enough characters for any sane person, but if you want to use mediumtext or longtext that's up to you.

Just open phpMyAdmin, hit the structure icon for your members table, and change the field type to suit.

PS: Just as a safeguard, it would be a good idea to back up your db first.

Arantor

There is a reason it was turned into varchar(255) in 2.0 RC2 and not into a mediumtext and is one of the items on the list of 24 things to do to keep performance lean, though I guess the performance is still going to suck because it was a *text field before, and invoking the 1500-line monster that is the bbc parser another 15+ times per message index and topic listing isn't going to help in that department either...
Holder of controversial views, all of which my own.


Antechinus

Nope, but if he really wants to do it.........................

Henzo

So I'm  looking at adding 4-8 small images per member. Each image tag and other associated bbc will be roughly 50 characters per image.

This will cause significant degradation?

Arantor

Changing the field itself won't, because it's already inefficient, and it won't suddenly get massively more inefficient.

But throwing another 20+ calls to the single largest part of SMF, on every thread view, every list of threads... that IS going to affect your forum's performance, because bbcode is extremely slow.
Holder of controversial views, all of which my own.


Henzo

Hrmm.

Well I read another post (can't find it now) where I went in and edited it so I could use BBC in custom titles. Is it possible to use HTML?

Arantor

Not without making the forum a lot less secure.
Holder of controversial views, all of which my own.


Henzo

OK. :(

Well I changed the field to longtext.  ::)

We'll see how it goes!

Arantor

You really don't need it that big. Save yourself a little space and use text rather than long text, I mean, 64000 characters is enough, right?
Holder of controversial views, all of which my own.


Henzo

Ok.

Changed to text.  ;D

Thanks for your help guys.

Henzo


Advertisement: