2009-06-24 15:11:24
Display first name with last initial
Hello. I have 1.6.2 installed and I am working with formatting the link to my Elluminate classroom. I want to pass the username into the URL of the Elluminate link. However, I would like it to be student first name and last initial. I can do that one of two ways....
1. Get ATutor to display the username as the first name and last initial (currently not an option in the System Preferences in admin). Then use something like
[php] echo get_display_name($_SESSION['member_id']);[/php]
2. Manually build the first name, last initial part in the index.php file of the Elluminate module. So far I have
[php]
$sql = "SELECT last_name FROM ".TABLE_PREFIX."members WHERE member_id='$_SESSION[member_id]'";
$result = mysql_query($sql,$db);
if ($row = mysql_fetch_assoc($result)) {
$last_name = $row['last_name'];
}
php echo ($last_name['last_name']);
[/php]
This returns the last initial. Unsure as to why it only returns the last initial instead of the entire last name. If I do something similar for the first name I will only get the first initial.
Any ideas on which would be better/easier?
Thank you.