News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Custom subject length

Started by Adrek, January 11, 2013, 01:15:57 AM

Previous topic - Next topic

Adrek

Link to Mod

Mod allows you to change maximum subject length in topics. By default subject can have 80 characters, with this mod you can choose between 1 and 255 characters.

This mod is licensed under a CC BY-NC-ND 3.0
Polskie wsparcie SMF na simplemachines.org

the simplest solution is most likely the right one

Shambles

Looks useful, well done :)

Being a pedantic sod, though, I noticed a small typo in your package-info.xml "readme" line

Code (find) Select
With this mod you can choose subject length is topics.

Code (replace) Select
With this mod you can choose subject length in topics.

Adrek

Thanks, I thought that I fixed it ::)

//and it is fixed, this two lines are the same?
Polskie wsparcie SMF na simplemachines.org

the simplest solution is most likely the right one

Arantor

There are a number of issues with this.

Firstly, if the user uninstalls and reinstalls the mod, any value they will previously have set will be replaced; the installer should bring $modSettings into scope, then check whether $modSettings['max_subject_length_mod'] is emptybefore calling to change it.

The second, and much more serious issue, is that if a user does set this to quite a high value (I'm thinking 200+), there is a very real possibility that the size of the database field will truncate content anyway.

Simple case to replicate: set the limit to 255, type in 255 characters of which only one needs to be a ' or a " and the end of that will be cut off. Just as plenty of instances of multi-byte characters may well be truncated too if they are entity-form.

But you can't just make the column bigger either - MySQL 5.0.3 or higher will be required to make the subject > 255 in size, and you can't make it a text column because of how badly that will damage performance in other places (especially the board and message indexes)

Advertisement: