1. Create a new user defined tag (Extensions -> User Defined Tags), call it realname and add the code shown below:
Code: Select all
global $gCms;
$db = $gCms->db;
$query = "select first_name, last_name from ". $gCms->config['db_prefix'] . "users where user_id =?";
$row = $db->GetRow($query, array($params['user']));
echo $row['first_name'].' '.$row['last_name'];
2. In the admin console click on Content -> News and switch to the tab Summary Templates. Open your template for edit and search for the Smarty variable {$entry->author}. Replace the variable with the Smarty tag {realname user=$entry->author_id}. Save the template and see the changes on the website.
3. Do the second step with Detail Template as well.