So the scenario is this.
Someone new to Moodle registers on your site and logs in for the first time. You have take the time (or paid me) to customize your Moodle site so that it has a few unique features and add-ons that no other site has. You don’t want them to battle with using Moodle, but you want them to maximize the functionality of the site.
The question now is this – how do you introduce your site to a new, first-time user. Explain the navigation to them and basically help them get up and running before they enroll for their first course.
The way I have done it, is by using a simple script that checks the login and reroutes the user to a page containing some helpful information about the site, the icons and how the navigation works.
To the code, finally:
<?php
$uid = $USER->id;
/*
* The code below is used to display the Getting Started page the first time a new
* User access the site.
*
* How It Works
* Take the UserId and look in the mdl_user table for the lastlogin value
* A new User will have a value of 0
* Check the value. If it’s 0, redirect the User to the Getting Started page
* At the same time, update the Users details, setting the lastlogin value to the current time
*/
$sqlNU = ‘SELECT lastlogin FROM mdl_user ‘
. ‘ WHERE id=\”.$uid.’\”
. ‘ LIMIT 0,1′;
$ResultNU = mysql_query( $sqlNU );
while ($row = mysql_fetch_array($ResultNU)) {
echo ‘lastlogin ‘.date(‘Y M d’,$row[0]);
if($row[0] == 0){
echo ‘<script language=”JavaScript”>’;
// This is the redirect to your Moodle info page
echo ‘window.location=”http://127.0.0.1/moodle/mod/resource/view.php?id=18″;’;
echo ‘</script>’;
// Once we have redirected to the new page, update the lastlogin value
$dateNow = time(); // the current date
$sqlA=”UPDATE mdl_user SET lastlogin = ‘$dateNow’ WHERE id = ‘$uid’”;
$sql_resultA = mysql_query($sqlA) or die (mysql_error());
}
}
?>
Drop the code at the bottom of index.php and you should be all set. REMEMBER – if you are not sure, first make a backup of index.php. If you break it, I don’t want to know about it.










After a long process of development we are finally at a point where we can showcase a demo!