How To Stop People From Breaking Message Limit

Helpdesk for my helpdesk software

Moderator: mkoch227

Post Reply
SupportCenter
Posts: 65
Joined: Sat Aug 15, 2009 9:38 pm

How To Stop People From Breaking Message Limit

Post by SupportCenter »

I used the code that you told me about. When I test the code out, I wasnt able to get passed the 300 word limit. However, I got people that are exceeding the 300 word limit and rambling on in the message field. Is there some how they are bypassing it?

$message=hesk_input($_POST['message']) or $hesk_error_buffer[]=$hesklang['enter_message'];


--After the line above add the following below---

}
if (strlen($message) > 300)
{
$hesk_error_buffer[]='Your message is too long, limit it to 300 chars.';
Klemen
Site Admin
Posts: 10142
Joined: Fri Feb 11, 2005 4:04 pm

Post by Klemen »

That should work for posting a new ticket (customer side only), if you wish to limit reply lenght as well you should add similar code into reply_ticket.php:

Code: Select all

if (strlen($message) > 300) 
{ 
hesk_error('Your message is too long, limit it to 300 chars.');
}
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
SupportCenter
Posts: 65
Joined: Sat Aug 15, 2009 9:38 pm

Post by SupportCenter »

Where does it get submitted in the reply_ticket.php file. I tried to insert it after the first line of code and did a test and it didnt work.
Klemen
Site Admin
Posts: 10142
Joined: Fri Feb 11, 2005 4:04 pm

Post by Klemen »

Below

Code: Select all

$message=hesk_input
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
SupportCenter
Posts: 65
Joined: Sat Aug 15, 2009 9:38 pm

Post by SupportCenter »

I placed the code right after the line statement. It gives me an error that I can only have one ticket submitted at a time. When the code is removed the tickets work fine.
Klemen
Site Admin
Posts: 10142
Joined: Fri Feb 11, 2005 4:04 pm

Post by Klemen »

It gives me an error that I can only have one ticket submitted at a time
There is no such error in Hesk, it must be a customization you did?
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
SupportCenter
Posts: 65
Joined: Sat Aug 15, 2009 9:38 pm

Post by SupportCenter »

I found the error. In the script you gave me a while back ago to only have a person allowed 1 ticket at a time. There was a >=, the variable has to be >=2 not >=1 to not allow a buyer to open up mutliple tickets. The whole time it was set to 1.

Mysteriously it worked all this time until it came to modify the reply characters allowed limit. But I figured it out last night via trial and error. Thanks again.
Post Reply