display avatar on index
bppratama Offline
Junior Member
**
Posts: 7
Joined: May 2015
Post: #1
display avatar on index
Can someone help me with this?
I want to show avatar of lastpost threads on index and without use a plugin

I already learn in index there is {$forums} and search in index.php about that string. It's string from functions_forumlist.php in inc folder, how to edit functions_forumlist.php to show avatar lastposter

Please help me
05-16-2016 02:42 AM
Find all posts by this user Quote this message in a reply
MrBrechreiz Offline
Member
***
Posts: 69
Joined: May 2012
Post: #2
RE: display avatar on index
Open functions_forumlist.php and search for

PHP Code:
$lastpost_profilelink = build_profile_link($lastpost_data['lastposter'], $lastpost_data['lastposteruid']);


Insert Below this

PHP Code:
1
2
3
4
5
6
7
8
9
10
$uid = intval($lastpost_data['lastposteruid']);
$user = get_user($uid);
if ($user['avatar'] != "")
{
$forum['lp_avatar'] = '<img src="'.$user['avatar'].'" height="25" width="25" title="'.$user['username'].' \'s avatar." alt="" />';
}
else
{
$forum['lp_avatar'] = '<img src="images/default_avatar.gif" height="25" width="25" title="Default Avatar" alt="" />';
}


images/default_avatar.gif  =  you have to customize


ACP -->Templates & Style -->Templates -->euer Template --> Forum Bit Templates  -> forumbit_depth2_forum_lastpost

You can use this variable where you want

Code:
{$forum['lp_avatar']}

(This post was last modified: 05-16-2016 03:42 AM by MrBrechreiz.)
05-16-2016 03:13 AM
Visit this user's website Find all posts by this user Quote this message in a reply
bppratama Offline
Junior Member
**
Posts: 7
Joined: May 2015
Post: #3
RE: display avatar on index
Ok i will try this later and give feedback, thanks mate
05-16-2016 08:02 AM
Find all posts by this user Quote this message in a reply
MrBrechreiz Offline
Member
***
Posts: 69
Joined: May 2012
Post: #4
RE: display avatar on index
Or use this plugin
http://community.mybb.com/mods.php?action=view&pid=74
05-16-2016 10:26 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Sama34 Offline
Senior Member
****
Posts: 490
Joined: May 2011
Post: #5
RE: display avatar on index
Be prepare to insert yourself into the poor-optimized system of MyBB edits/plugins if you already aren't in.

Support PM's will be ignored. Yipi
Plugins: Announcement Bars - Custom Reputation - Mark PM As Unread
05-22-2016 12:27 AM
Visit this user's website Find all posts by this user Quote this message in a reply

« Next Oldest | Next Newest »

 Standard Tools
Forum Jump: