(2015-08-11, 05:16 PM)XP Mai Wrote: Is it the same pattern for all other variables I want to make?
That's a matter of choice. The variable name you define in the php script is the one you must use in the template. So you can choose any name, as long as it is not an existing one.
But if you mean by "pattern": the way it works, yes. Only for the avatar it is perhaps more complex, I don't know yet.
OK, I finished it with the avatar, add the lines below to furumdisplay.php below the 2 lines that were added before:
$query = $db->simple_select("users", "avatar, avatardimensions, username", "uid = {$thread['uid']}");
$avatar = $db->fetch_array($query);
$profilelink = get_profile_link($thread['uid']);
$thread['avatar'] = "";
if ($avatar['avatar'] != "")
{
$useravatar = format_avatar($avatar['avatar'], $avatar['avatardimensions'], $mybb->settings['postmaxavatarsize']);
$thread['avatar'] = "<div class=\"author_avatar\"><a href=\"{$profilelink}\"><img src=\"{$useravatar['image']}\" alt=\"\" {$useravatar['width_height']} /></a></div>";
}
When you add {$thread['avatar']} to the proper place in template forumdisplay_thread the avatar will appear there linking to the thread starter's profile.
Now the variables that you mentioned in your opening post are treated.
I am curious whether you get it working. I am sure it will work, because I tested it.
Regards, Ad Bakker (NL)