The Coder Posted January 2, 2014 Share Posted January 2, 2014 I need a modification made for MCCodes V2, its quite simple...I think. If you don't want to do it, fair enough. I basically need a modification where members can see what other players have been upto. For e.g Last seen: Viewing IDHERE Profile and so on. Thanks in advance. Quote Link to comment Share on other sites More sharing options...
Dave Posted January 2, 2014 Share Posted January 2, 2014 I need a modification made for MCCodes V2, its quite simple...I think. If you don't want to do it, fair enough. I basically need a modification where members can see what other players have been upto. For e.g Last seen: Viewing IDHERE Profile and so on. Thanks in advance. This is really simple. Add a new field into the users table (or you could create another table so you're not clogging up the users table). Then create a function which updates that field when a user completes that action. Then whenever someone is viewing a page/completing an action you want to be viewed by other players called the function with the string you want displayed. Quote Link to comment Share on other sites More sharing options...
Uridium Posted January 2, 2014 Share Posted January 2, 2014 CREATE TABLE IF NOT EXISTS `whos_where` ( `Id` int(5) unsigned NOT NULL AUTO_INCREMENT, `Pagetext` varchar(255) NOT NULL, `Userentry` int(5) unsigned NOT NULL, `Collatenow` tinyint(1) unsigned NOT NULL, PRIMARY KEY (`Id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1; function Gather_Info($Do, $Perm=0) { global $db, $ir, $h, $c; $Select = $db->query("SELECT `Id` FROM `whos_where` WHERE `Userentry`=".$ir['userid']); if (!$db->num_rows($Select)) { return $db->query("INSERT INTO `whos_where` (`Userentry`) VALUES (".$ir['userid'].")"); } else { return $db->query("UPDATE `whos_where` SET `Pagetext`='".$Do."', `Collatenow`=".$Perm." WHERE `Userentry`=".$ir['userid']); } } Then on each page add example for profile page Gather_Info('Viewing. '.{$r['username']}.' Profile Page'); Not tested but should be ok Quote Link to comment Share on other sites More sharing options...
Seker Posted January 3, 2014 Share Posted January 3, 2014 CREATE TABLE IF NOT EXISTS `whos_where` ( `Id` int(5) unsigned NOT NULL AUTO_INCREMENT, `Pagetext` varchar(255) NOT NULL, `Userentry` int(5) unsigned NOT NULL, `Collatenow` tinyint(1) unsigned NOT NULL, PRIMARY KEY (`Id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1; function Gather_Info($Do, $Perm=0) { global $db, $ir, $h, $c; $Select = $db->query("SELECT `Id` FROM `whos_where` WHERE `Userentry`=".$ir['userid']); if (!$db->num_rows($Select)) { return $db->query("INSERT INTO `whos_where` (`Userentry`) VALUES (".$ir['userid'].")"); } else { return $db->query("UPDATE `whos_where` SET `Pagetext`='".$Do."', `Collatenow`=".$Perm." WHERE `Userentry`=".$ir['userid']); } } Then on each page add example for profile page Gather_Info('Viewing. '.{$r['username']}.' Profile Page'); Not tested but should be ok That naming, though. Tsk, tsk. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.