Trouble Ticket Mod

Forum
Last Post
Threads / Messages

Plague

Member
Member
Joined
Nov 22, 2010
Messages
50
Points
0
Mysidian Dollar
0
This is just something I was tinkering with and thought might be useful to some here, especially those who struggle with the code or find mods difficult to install. This is a modification of the pre-existing message system to create a trouble ticket system for your site. No new tables are needed.

First off create a link somewhere on your site (where you want users to be able to click to make a ticket). It's best to create it somewhere that is only accessible to logged on/registered users. If they aren't registered why would they need to send you a trouble ticket...

The link should look like this: <b><a href='ticket.php'>Trouble Ticket</b></a>

You'll now need to create a new PHP file named ticket.php
Copy and paste the code below into this file, save, and upload it.
Code:
<?php

include("inc/bbcode.php");
include("inc/functions.php");
include("lang/lang.php");

$ugroup = getgroup();
$canpm = cando($ugroup, "canpm");

if($isloggedin == "yes" and $canpm == "yes"){

$act = $_GET["act"];
$act = preg_replace("/[^a-zA-Z0-9\\040.]/", "", $act);
$act = secure($act);

$user = $_GET["user"];
$user = preg_replace("/[^a-zA-Z0-9\\040.]/", "", $user);
$user = secure($user);

$id = $_GET["id"];
$id = preg_replace("/[^a-zA-Z0-9\\040.]/", "", $id);
$id = secure($id);

$mid = $_GET["mid"];
$mid = preg_replace("/[^a-zA-Z0-9\\040.]/", "", $mid);
$mid = secure($mid);

if($act == "" or $act == "list"){


$article_title = $lang_ticket_title;
$article_content = $lang_ticket_content."<br><form name='form1' method='post' action='pmpost.php'>
  <p><b>Admin:</b><br> 
[b]<input type='radio' name='pmto' id='pmto' value='insert username here'>insert username here[/b]
</p>
  <p><b>Issue:</b><br> 
[b]<input type='radio' name='mtitle' id='mtitle' value='TT: General Account Issues'>TT: General Account Issues<br>
<input type='radio' name='mtitle' id='mtitle' value='TT: Log In'>TT: Log In Issues<br>
<input type='radio' name='mtitle' id='mtitle' value='TT: Harrassment'>TT: Harrassment[/b]
</p>  
  <p><b>Message Text:</b><br>
  
   <br><textarea name='mtext' cols='45' id='mtext'></textarea> </p>
  <p><input name='outbox' type='checkbox' id='outbox' value='yes'>
</strong>Save A Copy Of This Trouble Ticket</p>
</p>
  <p>
    <input type='submit' name='Submit' value='Submit'>
</p>
</form>"; 

}

else{

$article_title = $lang_invalidact_title;
$article_content = $lang_invalidact;

}
}


else{

$article_title = $lang_title_pmdenied;
$article_content = $lang_pmdenied;

}


echo showpage($article_title, $article_content, $date);

?>

Remember to modify this...

Code:
<p><b>Admin:</b><br> 
[b]<input type='radio' name='pmto' id='pmto' value='insert username here'>insert username here[/b]
</p>
  <p><b>Issue:</b><br> 
[b]<input type='radio' name='mtitle' id='mtitle' value='TT: General Account Issues'>TT: General Account Issues<br>
<input type='radio' name='mtitle' id='mtitle' value='TT: Log In'>TT: Log In Issues<br>
<input type='radio' name='mtitle' id='mtitle' value='TT: Harrassment'>TT: Harrassment[/b]
</p>

...or this won't work. If you want to add more admin for the user to select from simply copy and paste that section of the code and input the user name accordingly. Same goes for the issue section.


Don't forget to include the new language tags for this page in your lang.php file.
They should appear like the following. Obviously modify the language to suit your needs.

Code:
$lang_ticket_title = "<center>Trouble Ticket</center>";

$lang_ticket_content = "<p>This page allows you to send a trouble ticket .</p>";

I take no credit for this whatsoever. This is simply a quickie edit of pre-existing code. I hope maybe some other users might be able to get some use out of this. I figured it was sort of a cool, quick and easy way for people who aren't knowledgeable of PHP to easily add a ticket system to their site.
 
Last edited:

Similar threads

Users who are viewing this thread

  • Forum Contains New Posts
  • Forum Contains No New Posts

Forum statistics

Threads
4,277
Messages
33,122
Members
1,602
Latest member
BerrieMilk
BETA

Latest Threads

Latest Posts

Top