MyBB Community Forums

Full Version: Display Avatars in Threadlist like XenForo (for MyBB)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5
By MyBBAddict.com

Firstly, you need to download and activate this plugin. Add to ./inc/plugins
Download Avatars in Threadlist
or
[attachment=25661]

Second, you need to naviagte here:
ACP > Themes and Templates > Templates > Your Theme Templates > Forum Display Teamples > Forumdisplay_thread 

Find
<div>
			<span>{$prefix} {$gotounread}{$thread['threadprefix']}<a href="{$thread['threadlink']}" class="{$inline_edit_class} {$new_class}" id="tid_{$inline_edit_tid}">{$thread['subject']}</a>{$thread['multipage']}</span>
			<div class="author smalltext">{$thread['profilelink']}</div>
		</div>

Replace with
<div>
            <table><tr><td id="tvatar">{$thread_avatar}</td><td>{$prefix} {$gotounread}{$thread['threadprefix']}<a href="{$thread['threadlink']}" class="{$inline_edit_class} {$new_class}" id="tid_{$inline_edit_tid}">{$thread['subject']}</a>{$thread['multipage']}<br><font color="grey">created by:</font> {$thread['profilelink']}</td></tr></table>        
        </div>

Then, finally, add this code to your global.css
#tvatar img {
    -moz-border-radius: 4px 4px 4px 4px;
    background-color: #FCFCFF;
    border: 1px solid #A5CAE4;
    max-height: 36px;
    max-width: 36px;
    padding: 2px;
}


You're done!
do you have a screenshot of this?
It can be viewed live on my forum:
http://mybbaddict.com/forum-forum-suggestions-feedback

Smile
hmm thanks might just add this
This plugin will add a lot of extra queries to the page. If you have 25 threads shown on a page you're going to run 25 extra queries. That will more than double the existing default queries. Just an FYI.
Wow I didn't even think of that...is there a way to do this more efficiently?
(2012-03-05, 11:04 PM)BitzDefender Wrote: [ -> ]Wow I didn't even think of that...is there a way to do this more efficiently?

e.g. replacing
$query = $db->query("select * from " . TABLE_PREFIX . "users where uid={$thread['uid']}");
	
$thread_user = $db->fetch_array($query);

with
$thread_user = get_user($thread['uid']);

would help reducing the amount of queries.
this was the actual tutorial,and it was done by scoutie,FBI, Mahigrafix and some codes by me.
http://community.mybb.com/thread-79700-p...#pid643922

i wish you retain the original credits
I saw the tutorial posted on another dead forum with no credits, and it had very bad grammar. So I fixed it up and posted it, I didn't know the code was yours so don't treat me like the bad guy.
Interesting find. I'm not yet quite sold on the idea of placing avatars in that exact spot (I find them distracting from the thread icons), but it does seem to be a popular design item with XF.
Pages: 1 2 3 4 5