Thread Rating:
  • 2 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Display Avatars in Threadlist like XenForo (for MyBB)
#1
By MyBBAddict.com

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

.php   aitl.php (Size: 1.35 KB / Downloads: 393)

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

Find
Code:
<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
Code:
<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
Code:
#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!
Reply
#2
do you have a screenshot of this?
Reply
#3
It can be viewed live on my forum:
http://mybbaddict.com/forum-forum-suggestions-feedback

Smile
Reply
#4
hmm thanks might just add this
Reply
#5
This user has been denied support. This user has been denied support.
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.
Reply
#6
Wow I didn't even think of that...is there a way to do this more efficiently?
Reply
#7
(03-05-2012, 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
PHP Code:
$query $db->query("select * from " TABLE_PREFIX "users where uid={$thread['uid']}");
    
$thread_user $db->fetch_array($query); 

with
PHP Code:
$thread_user get_user($thread['uid']); 

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

i wish you retain the original credits
[Image: mnvhXxj.png]
Reply
#9
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.
Reply
#10
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.
[Image: 468x60-1.png]
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)