PDA

View Full Version : No PM character limit for admins?


DaveG
05-18-2003, 02:45 PM
I searched around but cannot find a hack like this. Any way to make a hack so that administrators aren't limited to a max character amount when sending PMs?

Thanks!

Logician
05-19-2003, 03:02 PM
should be already so. At least it is in ver 2.2.6 and above..

DaveG
05-19-2003, 03:11 PM
Thanks for the response. I am currently running v2.2.7 and ran into this problem yesterday when sending a PM. The system informed me that I exceeded the 1000 character limit. Any suggestions?

Thanks!

Boofo
05-19-2003, 03:27 PM
Today at 11:02 AM Logician said this in Post #2 (https://vborg.vbsupport.ru/showthread.php?postid=397162#post397162)
should be already so. At least it is in ver 2.2.6 and above..

Are you sure? I don't think it is standard. I have also run into this problem in the past.

BTW: Sinan, did you get my pm?

Logician
05-19-2003, 04:09 PM
ok you guys caught a minor vb bug congratulations hehe..

private.php has this line:
if (strlen($message)>$pmmaxchars and $pmmaxchars!=0 and $bbuserinfo[usergroupid] != 6) {
eval("standarderror(\"".gettemplate("error_pmtoolong")."\");");
}
which tells the vb to ignore "pmmaxchars" restriction if sender is an admin.

However you get this error because the javascript does not let you click submit if your post is too long. So either disable javascript, or apply this small fix:

find:

eval("dooutput(\"".gettemplate("priv_sendprivmsg")."\");");


before that add:

if ($bbuserinfo['usergroupid']==6) {$pmmaxchars=1000000;}

Not tested but should work

BTW: Sinan, did you get my pm?
yeah and just replied. Sorry I was out of town in the weekend..

filburt1
05-19-2003, 04:17 PM
It's not a good idea to overwrite an options variable. I suggest:

if ($pmmaxchars != 0 and $bbuserinfo['usergroupid'] == 6)
{
$maxcharsjs = 0;
}
else
{
$maxcharsjs = &$pmmaxchars;
}

...then use $maxcharsjs in the template instead of $pmmaxchars.

edit: no offense, just my opinion ;)

Boofo
05-19-2003, 04:20 PM
Is this is a bug, then it probably does the same thing in the newthread, newreply and editpost, right? Same fix for that?

DaveG
05-19-2003, 04:26 PM
Adding this text:
if ($bbuserinfo['usergroupid']==6) {$pmmaxchars=1000000;}

right before this text:
eval("dooutput(\"".gettemplate("privmsg")."\");");

still causes me to get an JavaScript error box when I click SUBMIT if the text is over 1,000 characters.

Boofo
05-19-2003, 04:35 PM
Try putting it before this:

eval("dooutput(\"".gettemplate("priv_sendprivmsg")."\");");

Boofo
05-19-2003, 04:37 PM
Today at 12:17 PM filburt1 said this in Post #6 (https://vborg.vbsupport.ru/showthread.php?postid=397192#post397192)
It's not a good idea to overwrite an options variable. I suggest:

if ($pmmaxchars != 0 and $bbuserinfo['usergroupid'] == 6)
{
$maxcharsjs = 0;
}
else
{
$maxcharsjs = &$pmmaxchars;
}

...then use $maxcharsjs in the template instead of $pmmaxchars.

edit: no offense, just my opinion ;)

Which templates do we put this in? I have 4 of them with it. Can they all be done? Or do we need to put the code in other places, too?

Logician
05-19-2003, 04:37 PM
Today at 08:17 PM filburt1 said this in Post #6 (https://vborg.vbsupport.ru/showthread.php?postid=397192#post397192)
It's not a good idea to overwrite an options variable.

I agree with you as a principal but my code is ok here because as you can see, it is just inserted right before "dooutput" function which terminates the script when it runs. In other words overwriting a system variable can not make any harm here as the script ends right after it anyway.. ;)

still causes me to get an JavaScript error box when I click SUBMIT if the text is over 1,000 characters.
yeah sorry wrong template name.. my code edited, plz apply again..

Is this is a bug, then it probably does the same thing in the newthread, newreply and editpost, right? Same fix for that?
Right but var name different for regular posts which is "$postmaxchars".

Boofo
05-19-2003, 04:44 PM
Would you need to add the code for the priv_forwardmultiple and priv_sendtobuddies, too?

Logician
05-19-2003, 04:46 PM
right Bob

Boofo
05-19-2003, 05:04 PM
I just wanted to make sure. ;)

What is a good length to allow for private messages as well as non-private messages?

DaveG
05-19-2003, 05:20 PM
That did the trick, thanks VERY much!

... now if only I coudl figure out how to get the php code for the inclusion of my phpads, I'd be out of questions!

DaveG


Today at 01:35 PM Boofo said this in Post #9 (https://vborg.vbsupport.ru/showthread.php?postid=397195#post397195)
Try putting it before this:

eval("dooutput(\"".gettemplate("priv_sendprivmsg")."\");");

filburt1
05-19-2003, 05:26 PM
Today at 01:37 PM Logician said this in Post #11 (https://vborg.vbsupport.ru/showthread.php?postid=397198#post397198)
I agree with you as a principal but my code is ok here because as you can see, it is just inserted right before "dooutput" function which terminates the script when it runs. In other words overwriting a system variable can not make any harm here as the script ends right after it anyway.. ;)

I thought of that, too, but what if you want to use that variable in a template?

You may use up to $pmmaxchars characters in this message.

Just saying.

Boofo
05-19-2003, 05:28 PM
That is used in the template to check the length of the message. Couldn't you just make that a global variable and that would take care of using it in another template?