MaxSubjectLength

Started by snork13, April 25, 2006, 04:18:15 PM

Previous topic - Next topic

snork13

Link to Mod

Max Subject Length
Version: 1.1
by Snork13

Tired of long subjects, care to limit the length of a subject while a member is posting?

Max Subject Length mod adds a feature to admin panel under posts & topics -> topic settings, with this feature you may add the length of subject by number of characters. Enter (0) to disable the feature.

Works for 1.1 RC1 and 1.1 RC2. Not tested on others yet.

TIRED OF THIS:


ADMIN SECTION:
Mods
Please DO NOT PM me with requests for individual support, but post your questions and concerns in the appropriate section of the forum where other users can benefit from them as well. Thank you.
I have been super busy as of late. Working on updates to all my modifications for 2.0.1

Skipdawg

Oh now this is a great idea! I will give this mod a try for sure later tonight.  ;D ;)
Skipdawg's Community

Powered by SMF 1.1.3

snork13

Quote from: Skipdawg on April 25, 2006, 10:06:27 PM
Oh now this is a great idea! I will give this mod a try for sure later tonight.  ;D ;)

thanks, let me know how it works for ya. i tested on a fresh 1.1rc2 install, and an old 1.1rc1 install...which is now updated to 1.1rc2 :)

-snork13
Mods
Please DO NOT PM me with requests for individual support, but post your questions and concerns in the appropriate section of the forum where other users can benefit from them as well. Thank you.
I have been super busy as of late. Working on updates to all my modifications for 2.0.1

Skipdawg

Yea sure will. Now I just need to gage how many characters I want to set it too.  ;)
Skipdawg's Community

Powered by SMF 1.1.3

Skipdawg

OK just took some time and went in and tested this out. I love this Mod!  :)
Folks this can help out if you have folks trying to put full on sentences in the subject line and that blows out the margins on smaller resolutions but if to long can even blow out the larger ones.

When they do up SMF 1.2 or what ever it will be it should be in by default. This is very useful!  ;)
Skipdawg's Community

Powered by SMF 1.1.3

daragor

Webscom: Wordpress + SMF
Software Libre, Noticias y Entretenimiento.-

Niteblade

affiliate blog

davidhinds1

#7
just tried installing this and got this error message

At least one error was encountered during a test installation of this package. It is strongly recommended that you do not continue with installation unless you know what you are doing, and have made a backup very recently. This error may be caused by a conflict between the package you're trying to install and another package you have already installed, an error in the package, a package which requires another package that you don't have installed yet, or a package designed for another version of SMF.

1.     Execute Modification     ./Sources/Post.php     Test failed

all others are fine, checked the permissions for this file and they are set to 777.
using on 1.1 rc3 as it says it works on the download page.

also i have no other mods installed.

any ideas??

davidhinds1

sorted now, a mate edited the file that failed and works now  ;)

shapeshifter

Quote from: davidhinds1 on August 31, 2006, 05:23:27 AM
sorted now, a mate edited the file that failed and works now  ;)

Mind sharing? Cause I'm getting the same error....

crappyday

I love this package, but I've ran into one small problem. SMF automatically makes a reply to a topic with "Re: " so many of my members are getting errors.  Is there a way to possibly make a change so that the original topic can't be more than xx characters but replies may have xx+5 characters?

Example:

I make a topic with the subject "Max Subject Problems and Issues"

That is 31 characters.  I know this would be a silly number to have but this is only an example...I have my max subject set to 31, now someone goes to make a reply to this topic and their subject is now "Re: Max Subject Problems and Issues" and they will receive the warning saying their subject exceeds the maximum.

Aside from this I really like this Package a lot so if I or someone else can help out on this I'd appreciate it.
 


fussyman

Forgive me if this is wrong place to ask my question. My problem is too short topic title text. As I use cyrillic font, I get only 15-16 letter text, the rest being cut out.  Can this mod help increasing the length of topic title text? or is there any hack that i should employ. I searched on the forum quite some time for last several days but could not find info how to increase the topic title size.
Mongolia horse tours, cultural tours, & more
http://www.mongoliatraveltips.com
http://www.mongolianshop.com

daragor

please update to 1.1.1 version, i need vary much! thanks
Webscom: Wordpress + SMF
Software Libre, Noticias y Entretenimiento.-

blameproof

Hi all,

For anyone else looking for a fix to get this working with 1.1.1, I just finished looking into it. The fix is really straightforward. Extract the zip, open up the file MaxSubjectLength11RCx.xml, and replace both instances of:

// Check the subject and message.
if (!isset($_POST['subject']) || htmltrim__recursive($_POST['subject']) == '')
$post_errors[] = 'no_subject';


With:

if (!isset($_POST['subject']) || $func['htmltrim']($_POST['subject']) === '')
$post_errors[] = 'no_subject';


Save the file, re-zip it all, and upload.

Andy

James Z.

#14
this mod is great,
but the english warning doesn't show in other forum languages,
my forum uses right-to-left language,
how can I solve this so users CAN see the warning,
and maybe write the warning in my own language?  :-\

Coldfx

Love it, now all we need is a "MinSubjectLength" mod :)

To Andy: Thanks for the fix!

Lemming

Hi,

is it possible that you add MaxNameLength feature? This would be great! In the past there were some newbies who registered to our forum and edited the name that is shown so that it was really long - design problems (the newest users are shown on my forum index). I limited the max length in the forum code (not the database) but maybe it's useful for others. 

darthi8nt

This is a great mod! Attention crappyday or anyone else that wants to fix the bug error that crappyday reported above. Example if you set the default value to 30 characters in the admin area and you post a subject that is 30 characters long it will post no problem,however when someone tries to respond to it the subject is now generated with a prefix of "RE: " before the new posted subject this will now put the reply over the default amount so here is what we do to fix this. Goto your Sources folder and open up POST.php in a txt editor like wordpad and find this code.
elseif (!empty($modSettings['defaultMaxSubjectLength']) && strlen($_POST['subject']) > $modSettings['defaultMaxSubjectLength'])

Replace that line with this line
elseif (!empty($modSettings['defaultMaxSubjectLength']) && strlen($_POST['subject']) > $modSettings['defaultMaxSubjectLength'] + strlen($txt['response_prefix']))


Hope this helps.
"You don't know the power of the Dark Side of the Force!!!!"

snork13

Quote from: darthi8nt on August 20, 2007, 10:49:53 PM
This is a great mod! Attention crappyday or anyone else that wants to fix the bug error that crappyday reported above. Example if you set the default value to 30 characters in the admin area and you post a subject that is 30 characters long it will post no problem,however when someone tries to respond to it the subject is now generated with a prefix of "RE: " before the new posted subject this will now put the reply over the default amount so here is what we do to fix this. Goto your Sources folder and open up POST.php in a txt editor like wordpad and find this code.
elseif (!empty($modSettings['defaultMaxSubjectLength']) && strlen($_POST['subject']) > $modSettings['defaultMaxSubjectLength'])

Replace that line with this line
elseif (!empty($modSettings['defaultMaxSubjectLength']) && strlen($_POST['subject']) > $modSettings['defaultMaxSubjectLength'] + strlen($txt['response_prefix']))


Hope this helps.

have you tried this? it's not going to work. the string length is actually 3 characters, and not 2. the strlen doesn't account for the   space when counting.

-snork13
Mods
Please DO NOT PM me with requests for individual support, but post your questions and concerns in the appropriate section of the forum where other users can benefit from them as well. Thank you.
I have been super busy as of late. Working on updates to all my modifications for 2.0.1

darthi8nt

I have tried it and tested it into my forums works like a charm the space is added into the 'response_prefix' in the index.english.php file, it is  read like this $txt['response_prefix'] = 'Re: '; which does inclued the space. So when it prints out into the subject header it prints it to screen like this as an example. Re: This is the subject here.
I have tested it before I posted this, anyway excellent mod from you as always. :D
"You don't know the power of the Dark Side of the Force!!!!"

Diven

I can also confirm it works. Thanks!
No more anoying people with a lot of chars in their title :)
Sorry for my bad English, I'm from Belgium

Tony Reid

I dont use this mod - but its a good idea :)

Also, It seems like an appropriate mod to drop everything to lowers - to stop shouting in titles.

Tony Reid

Coldfx

IMO, you should make a "Minimum Subject Length" mod.   It tires me having to close topics with the title "."

snork13

Quote from: darthi8nt on August 22, 2007, 08:06:52 AM
I have tried it and tested it into my forums works like a charm the space is added into the 'response_prefix' in the index.english.php file, it is  read like this $txt['response_prefix'] = 'Re: '; which does inclued the space. So when it prints out into the subject header it prints it to screen like this as an example. Re: This is the subject here.
I have tested it before I posted this, anyway excellent mod from you as always. :D

strange, because when i tested it, it did not work.
Mods
Please DO NOT PM me with requests for individual support, but post your questions and concerns in the appropriate section of the forum where other users can benefit from them as well. Thank you.
I have been super busy as of late. Working on updates to all my modifications for 2.0.1

darthi8nt

@ snork13
you are right I retested it and it doesn't work properly. It seems to add the Re: so I'll look into it some more to see where i would have to rewrite the code, but I never like that Re: it always to me looked unprofessional so anyone who wants a quick fix just edit the index.english.php file where you find $txt['response_prefix'] = 'Re: '; and make it read this $txt['response_prefix'] = ''; and this mod will def work then. make sure if you edited and added my code from previous to edit it back to original code line from my previous reply.
"You don't know the power of the Dark Side of the Force!!!!"

kamili34


qubbah

i have a problem to ask here..

when install this mod and get it running properly the problem is,

the older topic that posted before install this mod cannot be reply if that topic is longger than max subject length setup with this mod.

InternetMafia

Any chance of this mod being compatible with 1.1.6
Its better to be dead and cool than alive and uncool.

MaKoUr

Please upgrade this mod for SMF 2.0.3!

Toni8

Quote from: MaKoUr on January 02, 2013, 10:10:47 AM
Please upgrade this mod for SMF 2.0.3!

Hello, do you know if there's another mod to do this?

I've been searching how to change limit to subject lenght but find nothing.

Thanks!

Advertisement: