Jump to content
MakeWebGames

Quackers

Members
  • Posts

    2
  • Joined

  • Last visited

    Never

Quackers's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. It was originally only for me to keep an eye on a mod I'd created, it just stopped people saying "I got lucky and won alot". Then I thought this could of been use for other people, it's not the best, it's just another security measure to keep a eye on things. Easy to add to/optimize to be better. I don't really care whats done with it or if people pass it off as their own, very simple, most people could make it. It's a starting point. However, I like your idea and I will most likely do this. :)
  2. When creating a 'mod' yesterday, it gave the possibility of people claiming to have one something to cover up a huge amount of money they may have. And I needed a simple way to log it, Although I haven't created a staff panel for it yet to view the logs (as I don't think it's deserving) it would be easy, and maybe someone here would like to do it. It is really a very simple modification. And yes, I'm aware it could of been made more efficient, but I'm not really using it for much. However you could make it log alot more stuff with a little know how. So, all it does is update the DB with a userid and what they done. It has the "User" field for ID, "Event" field for what they were doing, E.G crimes and a "Text" field for saying what the user won or did. Run the SQL in phpmyadmin:   -- -- Table structure for table `log` -- CREATE TABLE IF NOT EXISTS `log` ( `ID` int(11) NOT NULL AUTO_INCREMENT, `User` int(11) NOT NULL DEFAULT '0', `Event` varchar(30) NOT NULL, `Text` varchar(255) NOT NULL, PRIMARY KEY (`ID`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=6 ; -- -- Dumping data for table `log` --   And then, wherever you want it to log:   $db->query("INSERT INTO `log` VALUES(' ',".intval($userid).",'Crimes','".mysql_real_escape_string($ir['username'])." done a crime and earned ".intval($value)."')");   That's just an example. Just change "crimes" to what they are actually doing and "name done a crime and earned $value" to whatever they won/achieved. I hope this become of use to some people, if you have any ideas you would like to see added I will do them. If no one creates a staff panel for this, I will happily do it. Added a staff panel (NOT TESTED, Made in like 2 minutes) Name staff_log.php <?php include_once(DIRNAME(__FILE__).'/sglobals.php'); if($ir['user_level'] != 2) { die("Naughty"); } echo "<h3>Select user</h3> <form action='staff_log.php' method='post'> User: ".user_dropdown($c,'ID')." <input type='submit' value='Go' /></form>"; if(isset($_POST['ID'])) { echo "<table width='75%' class='table' border='0' cellspacing='1'> <tr> <th width='30%'>Event</th> <th width='70%'>Text</th> </tr>"; $select = $db->query("SELECT `User`,`Event`, `Text` FROM `log` WHERE (`User` = ".abs(@intval($_POST['ID'])).")"); if(!$db->num_rows($select)) { echo "<tr> <td colspan = 2 class='center'>This user has no log</td> </tr>"; } while($row = $db->fetch_row($select)) { echo "<td>".htmlspecialchars($row['Event'])."</td> <td>".htmlspecialchars($row['Text'])."</td> </tr> </table>"; } } $h->endpage(); ?>
×
×
  • Create New...