diff --git a/main/wiki/index.php b/main/wiki/index.php index d24991a564..59c2988bef 100644 --- a/main/wiki/index.php +++ b/main/wiki/index.php @@ -364,7 +364,7 @@ if ($_GET['view']) $userinfo=Database::get_user_info_from_id($last_row['is_editing']); - $is_being_edited= get_lang('ThisPageisBeginEditedBy').' '.$userinfo['firstname'].', '.$userinfo['lastname'].'. '.get_lang('ThisPageisBeginEditedTryLater').' '.date( "i",$rest_time).' '.get_lang('MinMinutes').''; + $is_being_edited= get_lang('ThisPageisBeginEditedBy').' '.api_get_person_name($userinfo['firstname'], $userinfo['lastname']).'. '.get_lang('ThisPageisBeginEditedTryLater').' '.date( "i",$rest_time).' '.get_lang('MinMinutes').''; Display::display_normal_message($is_being_edited, false); } @@ -585,7 +585,7 @@ if ($_GET['action']=='mactiveusers') $userinfo=Database::get_user_info_from_id($obj->user_id); $row = array (); - $row[] = $obj->user_id <>0 ? ''.$userinfo['lastname'].', '.$userinfo['firstname'].'' : get_lang('Anonymous').' ('.$obj->user_ip.')'; + $row[] = $obj->user_id <>0 ? ''.api_get_person_name($userinfo['firstname'], $userinfo['lastname']).'' : get_lang('Anonymous').' ('.$obj->user_ip.')'; $row[] =''.$obj->NUM_EDIT.''; $rows[] = $row; } @@ -605,7 +605,7 @@ if ($_GET['action']=='usercontrib') { $userinfo=Database::get_user_info_from_id(Security::remove_XSS($_GET['user_id'])); - echo '
| '.$author_photo.' | '; - echo ''.$userinfo['lastname'].', '.$userinfo['firstname'].' ('.$author_status.') '.$row['dtime'].' - '.get_lang('Rating').': '.$row['p_score'].' '.$imagerating.' | '; + echo ''.api_get_person_name($userinfo['firstname'], $userinfo['lastname']).' ('.$author_status.') '.$row['dtime'].' - '.get_lang('Rating').': '.$row['p_score'].' '.$imagerating.' | '; echo '
| '.$row['comment'].' | '; diff --git a/main/wiki/wiki.inc.php b/main/wiki/wiki.inc.php index 6c877558f4..7dbcbc4d14 100644 --- a/main/wiki/wiki.inc.php +++ b/main/wiki/wiki.inc.php @@ -766,7 +766,7 @@ function display_wiki_entry() $KeyVisibility=$row['visibility']; // second, show the last version - $sql='SELECT * FROM '.$tbl_wiki.', '.$tbl_wiki_conf.' WHERE '.$tbl_wiki_conf.'.page_id='.$tbl_wiki.'.page_id AND '.$tbl_wiki.'.reflink="'.html_entity_decode(Database::escape_string(stripslashes(urldecode($page)))).'" AND '.$tbl_wiki.'.'.$groupfilter.' '.$filter.' ORDER BY id DESC'; + $sql='SELECT * FROM '.$tbl_wiki.', '.$tbl_wiki_conf.' WHERE '.$tbl_wiki_conf.'.page_id='.$tbl_wiki.'.page_id AND '.$tbl_wiki.'.reflink="'.api_html_entity_decode(Database::escape_string(stripslashes(urldecode($page)))).'" AND '.$tbl_wiki.'.'.$groupfilter.' '.$filter.' ORDER BY id DESC'; $result=Database::query($sql,__LINE__,__FILE__); $row=Database::fetch_array($result); // we do not need a while loop since we are always displaying the last version @@ -1593,7 +1593,7 @@ function check_emailcue($id_or_ref, $type, $lastime='', $lastuser='') //first, current author and time //Who is the author? $userinfo= Database::get_user_info_from_id($lastuser); - $email_user_author= get_lang('EditedBy').': '.$userinfo['firstname'].' '.$userinfo['lastname']; + $email_user_author= get_lang('EditedBy').': '.api_get_person_name($userinfo['firstname'], $userinfo['lastname']); //When ? $year = substr($lastime, 0, 4); @@ -1632,7 +1632,7 @@ function check_emailcue($id_or_ref, $type, $lastime='', $lastuser='') //first, current author and time //Who is the author of last message? $userinfo= Database::get_user_info_from_id($lastuser); - $email_user_author= get_lang('AddedBy').': '.$userinfo['firstname'].' '.$userinfo['lastname']; + $email_user_author= get_lang('AddedBy').': '.api_get_person_name($userinfo['firstname'], $userinfo['lastname']); //When ? $year = substr($lastime, 0, 4); @@ -1679,7 +1679,7 @@ function check_emailcue($id_or_ref, $type, $lastime='', $lastuser='') //Who is the author? $userinfo= Database::get_user_info_from_id($row['user_id']); - $email_user_author= get_lang('AddedBy').': '.$userinfo['firstname'].' '.$userinfo['lastname']; + $email_user_author= get_lang('AddedBy').': '.api_get_person_name($userinfo['firstname'], $userinfo['lastname']); //When ? $year = substr($row['dtime'], 0, 4); @@ -1718,7 +1718,7 @@ function check_emailcue($id_or_ref, $type, $lastime='', $lastuser='') //Who is the author? $userinfo= Database::get_user_info_from_id(api_get_user_id()); //current user - $email_user_author= get_lang('DeletedBy').': '.$userinfo['firstname'].' '.$userinfo['lastname']; + $email_user_author= get_lang('DeletedBy').': '.api_get_person_name($userinfo['firstname'], $userinfo['lastname']); //When ? @@ -1741,12 +1741,12 @@ function check_emailcue($id_or_ref, $type, $lastime='', $lastuser='') if(empty($charset)){$charset='ISO-8859-1';} $headers = 'Content-Type: text/html; charset='. $charset; $userinfo = Database::get_user_info_from_id($row['user_id']); //$row['user_id'] obtained from tbl_wiki_mailcue - $name_to = $userinfo['firstname'].' '.$userinfo['lastname']; + $name_to = api_get_person_name($userinfo['firstname'], $userinfo['lastname'], null, PERSON_NAME_EMAIL_ADDRESS); $email_to = $userinfo['email']; $sender_name = api_get_setting('emailAdministrator'); $sender_email = api_get_setting('emailAdministrator'); $email_subject = get_lang('EmailWikiChanges').' - '.$_course['official_code']; - $email_body = get_lang('DearUser').' '.$userinfo['firstname'].' '.$userinfo['lastname'].',