Re: Re: How to have GMap Usermap show real name?
Change the first $query = to:
Copy to clipboard
$query = "SELECT `login`, `avatarType`, `avatarLibName`, p1.`value` as lon, p2.`value` as lat, p3.`value` as realName FROM `users_users` as u ";
Add a new "left join" to the bottom of the select:
Copy to clipboard
$query.= "left join `tiki_user_preferences` as p3 on p3.`user`=u.`login` and p3.`prefName`=? ";
Add realName to the $tikilib array values:
Copy to clipboard
$result = $tikilib->query($query, array('lon','lat','realName'));
Then add the name to the displayed data (note, this does not check to see if a realName exists, you should probably add code to check for that and change the display to handle it if the user did not enter one):
Copy to clipboard
$out[] = array($res['lat'],$res['lon'],addslashes($image).'Name:'.$res['realName'].'Login:'.$res['login'].'Lat: '.$res['lon'].'° Long: '.$res['lat'].'°');