News:

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

Main Menu

Increasing topic title length

Started by spiros, December 17, 2009, 07:19:52 PM

Previous topic - Next topic

spiros

Which is the way to do that in RC2? I need pretty long titles as I use (monotonic and polytonic) Greek.

Arantor

How long do you need?

And are you using UTF-8 or not?
Holder of controversial views, all of which my own.


spiros

I need at least 200 Unicode characters and yes, UTF-8.

Arantor

Holder of controversial views, all of which my own.


spiros

Yes - see here
www.nonsmokersclub.com/forum/

Arantor

That doesn't tell me it's MySQL 5 or up.
Holder of controversial views, all of which my own.


spiros

#6
But I tell you ;)

Antechinus

Just noting that I checked your site and the topic titles don't seem to be any longer on average than on an English site. So I'm not sure why you would need 200 characters for titles.

The problem with making them that long is the header bars at the top of each page of a thread. Unless you have a wide screen monitor (very wide) those bars will break with a title that long.

spiros

This is not the main forum that I want them for, but a test one. I will be upgrading this one and it already has pretty long titles and I do not want them to break when I go ahead with the upgrade:

http://www.translatum.gr/forum/index.php?topic=35040.0
http://www.translatum.gr/forum/index.php?topic=46143.0
http://www.translatum.gr/forum/index.php?topic=51730.0
http://www.translatum.gr/forum/index.php?topic=48992.0

Arantor

That first one is even longer than 200 characters.

As for doing it, you'll need to modify three things:
* the subject column in the messages table; varchar(300) should be fine if you're using MySQL 5+.
* the Post.template.php for the subject, changing from maxlength="80" to maxlength="300" (or more)
* Post.php which does a check in Post2() (and possibly a few other places) to check for length of 80. Just up that to 300 or whatever.

But layout is another beast altogether and one I'm not equipped to help with though...
Holder of controversial views, all of which my own.


Antechinus

Ok, those first two are going to break Curve even on a 1680 screen. Or more particularly, since we used hidden overflow to stop the header bars breaking what happens with overlength titles is that they just vanish, since the hidden overflow wipes the entire span as soon as part of it extends beyond the limit.

There has been some discussion about this and we may need to start regarding it as a blocker bug if titles this long are common in languages other than English (although frankly I'm dubious about how useful the title bar actually is).

spiros

I changed

the Post.template.php to maxlength="300" (or more)
and  Post.php (no change in subject column in the messages table)

See the results here with 300 characters (it can only contain 254 chars):
http://www.nonsmokersclub.com/forum/index.php?topic=558.0

The point is, I have a language forum, and often we add the translation on the topic title, and if they are Unicode polytonic Greek characters, it tends to get big...

Arantor

* Arantor was sure subject was a varchar(80) field in RC2, but it is varchar(255) - so without changes that is your physical limit, 255 Unicode characters.
Holder of controversial views, all of which my own.


spiros

Changed the subject column in the messages table and now fits 300 nicely.

Antechinus

Notice the h3.catbg header bar above that test post. See how the topic title has vanished? That is what I was referring to. 

spiros

I am not sure what has vanished. Can you please explain?

Arantor

There's only one word in the header above the thread, under the thread options buttons, which is what Antechinus is referring to.
Holder of controversial views, all of which my own.


Antechinus

You have the icon in the left corner of the dark blue header bar, followed by the text that (in English) says "Author". After that comes (again, in English) "Topic:" followed by the topic title, followed by the number of times it has been read.

Notice that in your test topic only the icon and the "Author" text are displayed. The title itself and the number of times it has been read have vanished.

spiros

Thanks, I do get it now. Surely, there must be an easy way to have the bar expand...

Antechinus

Quote from: spiros on December 17, 2009, 08:08:18 PM
Thanks, I do get it now. Surely, there must be an easy way to have the bar expand...

It can be done, but unfortunately it is messier markup than the way we are doing it now so we have been hoping we wouldn't have to. I can think of several solutions, and those bars were going to be recoded slightly anyway. We may have to just bite the bullet and do it.

Advertisement: