News:

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

Main Menu

No admin character per post limitation?

Started by ***Teh GodFather***, August 16, 2007, 06:45:06 PM

Previous topic - Next topic

codenaught

You can edit Sources/Post.php:

elseif (!empty($modSettings['max_messageLength']) && $func['strlen']($_POST['message']) > $modSettings['max_messageLength'])
{
$post_errors[] = 'long_message';
unset($_POST['message']);
}


Change the above to:

elseif (!empty($modSettings['max_messageLength']) && $func['strlen']($_POST['message']) > $modSettings['max_messageLength'] && !$user_info['is_admin'])
{
$post_errors[] = 'long_message';
unset($_POST['message']);
}



However you will still be restricted by whatever the column type maximum size restricts you to. You can make the 'body' column in the 'messages' table bigger, although it already allows quite a lot of characters.
Dev Consultant
Former SMF Doc Coordinator

***Teh GodFather***

This doesnt work...
I have code like this:
elseif (!empty($modSettings['max_messageLength']) && $func['strlen']($_POST['message']) > $modSettings['max_messageLength'])
{
$post_errors[] = 'long_message';
}


I am using SMF 1.1.3

winrules

Does it give you an error message saying your post is too long, or does it just truncate (cut off) your post at a certain length?


winrules
SMF Developer
               
My Mods
Please do not PM me for support.


***Teh GodFather***

It gives me this:
Parse error: syntax error, unexpected T_ELSE in .../Sources/Post.php on line 1582

winrules

Try replacing the code you quoted in your post above with this:

elseif (!empty($modSettings['max_messageLength']) && $func['strlen']($_POST['message']) > $modSettings['max_messageLength'] && !$user_info['is_admin'])
{
$post_errors[] = 'long_message';
}


winrules
SMF Developer
               
My Mods
Please do not PM me for support.



codenaught

Also, was there any reason you removed this -  unset($_POST['message']); ***Teh GodFather***?

If not, I would take winrules code, and change it to:
elseif (!empty($modSettings['max_messageLength']) && $func['strlen']($_POST['message']) > $modSettings['max_messageLength'] && !$user_info['is_admin'])
{
$post_errors[] = 'long_message';
unset($_POST['message']);
}


Which besides the changed spacing and the removed unset, seems to be the same code I posted above. So you want to make sure you find and replace the same code I posted.

Edit: Just got your reply. Make sure you are changing it exactly as I said. If no luck, you can try attaching your file and one of us can try to do it for you.
Dev Consultant
Former SMF Doc Coordinator

***Teh GodFather***

I removed that after i saw that error...
I would attach my file, bu there is no that option...

mohaakilla51


***Teh GodFather***

#10
Heres the link...
[Killed by Tomahawk]


***Teh GodFather***


codenaught

You can't attach it in your post under "Additional Options..."?

Anyways attached is your file with the admin check added. I had no parse errors myself so you may have an error when uploading the file.

If possible, can you remove the rapidshare download as that technically is against our license to host SMF files elsewhere. ;)
Dev Consultant
Former SMF Doc Coordinator

***Teh GodFather***

#14
OK, i will try this file...
I can not remove file from RS, i forgot to copy the kill link...
But i will remove it from post...
And, no i cant upload it as attachment, i dont have that option, as i allready wrote...

Advertisement: