Cronwerks MCCode/MCCodes Forums

Please login or register.

Login with username, password and session length

News:

After purchasing with us the download link will be delivered to your forum message box.


This forum is now closed and has moved to a new location! Click here to find out why.

AuthorTopic: Bug Report - Updated copy  (Read 606 times)

Jordan

  • Active Member
  • **
  • Reputation Power: 55
  • Jordan has no influence.
  • Offline Offline
  • Posts: 102
  • Website Developer for hire;
    • MSN Messenger - Pudda2008@hotmail.co.uk
    • View Profile
    • WWW
    • Email
Bug Report - Updated copy
« on: December 12, 2009, 02:55:14 PM »
Hey all.

I've been updating SeanyBobs Bug report system. I'm sick of seeing these one's around the forums with all this crap like urgency ect. I think it's un-needed and basically is just useless info...

All copyrights go to SeanyBob. I've simply updated the code :) - Anyway here it is

Code: [Select]
CREATE TABLE IF NOT EXISTS `bugports` (
  `brID` int(11) NOT NULL auto_increment,
  `brREPORTER` int(11) NOT NULL default '0',
  `brTEXT` longtext NOT NULL,
  `active` int(11) NOT NULL default '0',
  `time` varchar(40) NOT NULL default '0',
  PRIMARY KEY  (`brID`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=7 ;

Create a file called Bugports.php
Code: [Select]
<?php
include_once DIRNAME(__FILE__) . '/globals.php';
$bugtxt="Report a bug dont exploit it - Please be sure its a bug and not spelling mistake";
$bugadded="Your bug has been processed. Our admins have been alerted. Thank you";
if(
$_POST['report'])
{
event_add(1,"New Bug Report ",$c);
$insertbug sprintf("INSERT INTO bugports VALUES ('', %u, '%s', '1',%u)"$userid$db->escape($_POST['report']),time());
$db->query($insertbug);
echo 
$bugadded;
$h->endpage();
}
else
{
print 
"<h3>Bug Report</h3>
$bugtxt<br />
<form action='bugport.php' method='post'>
What the bug is: <br />
<textarea rows='20' cols='60' name='report'>{$_GET['report']}</textarea><br />
<input type='submit' value='Send Report' /></form>"
;
}
$h->endpage();
?>

In staff_users.php

Cases
case 'breportsview': breports_view(); break;
case 'brepclear': breport_clear(); break;

add at the bottom

Code: [Select]
function breports_view()
{
global $db,$ir,$c,$h,$userid;
$time=date('F j Y, g:i:s a',$r['time']);
print "<h3>Bug Reports</h3>";
echo "<table class='table' width='80%' border='1'>";

echo "<tr>";
echo "<th width='25%'>Reporter</th>";
echo "<th width='25%'>bug</th>";
echo "<th width='25%'>clear</th>";
echo "<th width='25%'>time reported</th>";
echo "</tr>";
$q=$db->query("SELECT br.*,u1.username as reporter FROM bugports br LEFT JOIN users u1 ON u1.userid=br.brREPORTER WHERE active=1 ORDER BY br.brID DESC",$c) or die(mysql_error());
while($r=mysql_fetch_array($q))
{
print "\n<tr> <td><a href='viewuser.php?u={$r['brREPORTER']}'>{$r['reporter']}</a> [{$r['brREPORTER']}]</td>";
echo "<td>".stripslashes(htmlspecialchars($r['brTEXT']))."</td>
<td><a href='staff_users.php?action=brepclear&ID={$r['brID']}'>Clear</a></td>
<td>$time</td> </tr>";
}
//".time_format(time() - $r['time'])."
print "</table>";
}
function breport_clear()
{
global $db,$ir,$c,$h,$userid;
$_GET['ID'] = abs((int) $_GET['ID']);
$db->query("UPDATE bugports SET active=0 WHERE brID={$_GET['ID']}");
echo "Cleared<br /><a href='staff_users.php?action=breportsview'>&gt; Back</a>";
}


This'll never delete any bugs from the database, It'll simple set it to NOT active bug and it wont appear in the bugs list

I may once again update the code later this month ;]
Logged
Contact me
MakeWebGames.com

Cronus

  • Administrator
  • Senior Member
  • *****
  • Reputation Power: 2901
  • Cronus is awe-inspiring!Cronus is awe-inspiring!Cronus is awe-inspiring!Cronus is awe-inspiring!Cronus is awe-inspiring!Cronus is awe-inspiring!Cronus is awe-inspiring!Cronus is awe-inspiring!Cronus is awe-inspiring!Cronus is awe-inspiring!Cronus is awe-inspiring!Cronus is awe-inspiring!
  • Offline Offline
  • Posts: 550
    • MSN Messenger - preston__08@hotmail.com
    • View Profile
    • WWW
Re: Bug Report - Updated copy
« Reply #1 on: December 12, 2009, 11:58:34 PM »
Very nice work
Logged
My msn is preston__08@hotmail.com if anyone is interested, I am online frequently.

Danny696

  • Senior Member
  • ****
  • Reputation Power: 317
  • Danny696 is a force to reckon with.Danny696 is a force to reckon with.Danny696 is a force to reckon with.Danny696 is a force to reckon with.Danny696 is a force to reckon with.Danny696 is a force to reckon with.Danny696 is a force to reckon with.Danny696 is a force to reckon with.
  • Offline Offline
  • Posts: 540
    • View Profile
    • WWW
Re: Bug Report - Updated copy
« Reply #2 on: December 13, 2009, 04:57:59 AM »
Very nice work
Nice work indead, seanybob
Logged
Project Choosen - 10%
Daniel - Hanson . Com

Jordan

  • Active Member
  • **
  • Reputation Power: 55
  • Jordan has no influence.
  • Offline Offline
  • Posts: 102
  • Website Developer for hire;
    • MSN Messenger - Pudda2008@hotmail.co.uk
    • View Profile
    • WWW
    • Email
Re: Bug Report - Updated copy
« Reply #3 on: December 16, 2009, 08:31:54 PM »
If anyone wishe's to compare the coding.

SeanyBobs version
Logged
Contact me
MakeWebGames.com
 


This forum is now closed and has moved to a new location! Click here to find out why.