Jump to content
MakeWebGames

Recommended Posts

Posted

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

 

[mysql]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 ;[/mysql]

Create a file called Bugports.php

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

In staff_users.php

Cases

case 'breportsview': breports_view(); break;

case 'brepclear': breport_clear(); break;

add at the bottom

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>{$r['reporter']} [{$r['brREPORTER']}]</td>";

echo "<td>".stripslashes(htmlspecialchars($r['brTEXT']))."</td>

<td>Clear</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

> Back";

}

 

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 ;]

Posted

database trouble

when i try to add the SQL to the database i keep getting this

Error

SQL-query :

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 DEFAULTCHARSET = latin1 AUTO_INCREMENT = 7

MySQL said:

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DEFAULTCHARSET = latin1 AUTO_INCREMENT = 7' at line 1

i had this prob before and i added them in 1 by 1 i cant do that this time any reason why ?(

Posted

[mysql]

CREATE TABLE `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 AUTO_INCREMENT=7 DEFAULT CHARSET=latin1;

[/mysql]

Should work fine..if not drop me a email and ill check it over.. but worked for me

Posted

nice update mate.

Hi Ho ;]

 

I'm just human! I like to code just like most of us here. If you need

help do not feel the need to aviod asking me. I ask myself a few noobie

questions too!

 

I know a fair deal about PHP so I should be able to help ;]

 

 

 

Oh and... MERRY CHRISTMAS!! :P

i love that by the way ^

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...