PHP Fusion StudentID tracking

Script last updated on December 23, 2006 2:08am by !nucleo.

One of my projects is implementing a php-fusion CMS on a website that will be full of kids. The admins will be people working for the organization while the kids will just be users interacting with each other.

Now, we can't very well have weird pedophiles registering on the site, and we must know which student each account is tied too. Solution, each student physically walks up to a volunteer, hands them a form with their requested username and password, and within a few days (or hours) that student will be able to log on.

PHP-fusion allows users to change their email, password, and (shockingly) even their username. How would we ever know who is who? That's what this mod is for.

When the admin enters in the data for the student, they also enter in a unique ID for that student. This organization has a database of every kid who frequents the establishment, and all (good) databases will use a unique number for each student.

This number will not be visible to any students; as far as they are concerned it does not exist. This number cannot be changed (much like the incremental user_id). If you are an admin and look at the profile page, it will be visible.

With this in place, if a student posts something vulgar, or does anything inappropriate, the organization will know exactly who did what. Changing username will never matter as changing the username (in effect) affects every entry created by that user. So, all shouts and forum posts can be tracked back to the individual user.

First change is to the `users` table. Simply add an integer field called StudentID on the end:

ALTER TABLE `fusion_users` ADD `StudentID` INT NOT NULL ;

Secondly, you'll want to modify /profile.php. Find the text around line 100:



style='white-space:nowrap'>".$locale['u043']."
".number_format(dbcount("(post_id)", "posts",
"post_author='".$data['user_id']."'"))."
\n";

And change it into:



style='white-space:nowrap'>".$locale['u043']."
".number_format(dbcount("(post_id)", "posts",
"post_author='".$data['user_id']."'"))."
";
if (iADMIN) {
echo "
StudentID
".$data['StudentID']."
";
}
echo "\n";

Finally, you'll need to edit /administration/members.php. Around line 90, insert this row between the email row and the email visible row:


Rock StudentID
style='color:#ff0000'>***

class='textbox' style='width:200px;'>

Also in this file, around line 44, add this:

$StudentID = ereg_replace("[^0-9]", "", $_POST['StudentID']);

While still in the same line, on about line 53, modify the long line that starts with $result so that it becomes this (all your doing is adding the StudentID parts):

$result = dbquery("INSERT INTO ".$db_prefix."users (user_name,
user_password, user_email, user_hide_email, user_location,
user_birthdate, user_aim, user_icq, user_msn, user_yahoo, user_web,
user_theme, user_offset, user_avatar, user_sig, user_posts, user_joined,
user_lastvisit, user_ip, user_rights, user_groups, user_level, user_status,
StudentID) VALUES ('$username', md5('$password1'), '$email',
'$hide_email', '', '0000-00-00', '', '', '', '', '', 'Default', '0', '', '', '0',
'".time()."', '0', '".USER_IP."', '', '', '101', '0', '$StudentID')");

After doing all this you should be set. If you have the site set up so users can't openly register but admins can add users this will work fine.

I was going to add this to the official php-fusion mods website, but there is too many guidelines involved with uploading the mod. If I was getting paid I'd take the time to do it :). 

Login

Username:
Password:

Shoutbox

By !nucleo
Jun 12, 2008 7:56pm
About time you're back... Shoot me an email with your 88x31.
By ?Lee
Jun 12, 2008 3:27pm
vimixx.net has moved to lee-stewart.co.uk!!!
By ?Medvedko
May 4, 2008 7:04am
That's right. Sorry, I am not making much sense, am I? Basically, I created the DB myself instead of using your install script. All necessary tables are there, I added few more based on plugin POST options and added those to the update.php also. At the beginning I added mysql.ssi.php function to both update and winamp_playing scripts as I had some troubles before with include_once.
By !nucleo
May 2, 2008 9:56am
Now I'm really confused, are you modifying my shoutbox script?
By ?Medvedko
Apr 30, 2008 1:08am
another thing is that update script terminates with invalid password (I added the pass in the Additional Options in the plugin and set the pass in the update script.
By ?Medvedko
Apr 30, 2008 1:06am
my fault really. I modded the scripts and added more tables to the DB such as "TIMESTAMP". I think include_once doesn't fetch the mysql function. Or atleast this is what seems to me is the problem.
Name: Shout: This Number: [View All]

Partners

Rand Affiliates

Cryostir Franscape Andrew Christensen KoRnDragon