Mind blowing SEO improving and Google rank increasing Signature Rotator SEO Tool.

Thread: 

How To Add Avatars To The User CP?

Ads
banner
banner
banner
GWinston Offline referral

Posts: 7
Joined: Jan 2014
Reputation: 0

#1
Junior Member
Hello,

How could I add avatars to the UserCP under 'Your Latest Threads'?

I have added avatars to forumdisplay and search, but how would I add it for the UserCP under 'Your Latest Threads'?

Thank you very much.
marcus_avrelius Offline referral

Posts: 2,424
Joined: May 2013
Reputation: 102

#2
Support Team
Hi, you want to show avatars next to the threads inside "Your Latest Threads" table if so then do this!

Go to Admin Control Panel >> Templates & Style >> Templates >> Your Custom Template >> User Control Panel Templates >> usercp_latest_threads_threads

Inside the template find:

PHP Code:
<td class="{$bgcolor}">{$gotounread}{$thread['displayprefix']}<a href="{$thread['threadlink']}class="{$new_class}">{$thread['subject']}</a><br /><span class="smalltext">{$thread['author']}</span></td

Replace it with this HTML code:

PHP Code:
<td id="tvatar">{$thread_avatar}</td><td class="{$bgcolor}">{$gotounread}{$thread['displayprefix']}<a href="{$thread['threadlink']}class="{$new_class}">{$thread['subject']}</a><br /><span class="smalltext">{$thread['author']}</span></td

Now we need to add some PHP code! Open your usercp.php file and find:

PHP Code:
if($mybb->settings['threadreadcut'] > 0

Above it add this PHP code:

PHP Code:
if(!$thread['avatar']) {
     
$thread_avatar "<a href='member.php?action=profile&uid={$thread['uid']}'><img src='images/default_avatar.gif' alt='' title='{$thread['username']}' /></a>";
     }
     else
     {
     
$thread_avatar "<a href='member.php?action=profile&uid={$thread['uid']}'><img src='{$thread['avatar']}' alt='' title='{$thread['username']}' /></a>";
     } 

Next find:

PHP Code:
SELECT t.*, t.username AS threadusernameu.username 

Replace it with this PHP expression:

PHP Code:
SELECT t.*, t.username AS threadusernameu.usernameu.avatar 


That is it you are all set. For more info check this thread: http://letsforum.com/Thread-Display-Avat...ke-XenForo

Please tell me if it works. If you maybe need some CSS style change then feel free to ask Smile
Looking for ways to make money fast? Read this article and start earning money todya fast, easy or for free.
antony Offline referral

Posts: 478
Joined: Jul 2013
Reputation: 5

#3
Senior Member
Great reply Marcus but I am wondering why do you need avatars in your Control Panel?
victor Offline referral

Posts: 638
Joined: Jun 2013
Reputation: 33

#4
Senior Member
Just remember that you will have to edit core files again after you upgrade MYBB script!
GWinston Offline referral

Posts: 7
Joined: Jan 2014
Reputation: 0

#5
Junior Member
(01-30-2014 05:04 PM)antony Wrote:  Great reply Marcus but I am wondering why do you need avatars in your Control Panel?

The only reason I needed them is so all thread titles look the same, and not some with avatars and some without.
ivan Offline referral

Posts: 713
Joined: Jul 2013
Reputation: 6

#6
Senior Member
So is it working because if it does I may use it too?
GWinston Offline referral

Posts: 7
Joined: Jan 2014
Reputation: 0

#7
Junior Member
(01-31-2014 03:39 AM)ivan Wrote:  So is it working because if it does I may use it too?

Yes, it definitely works! Thanks to Marcus who answered my question perfectly, wow!

Now I think all of the threads listed have avatars next to them, unless I find more that need avatars added.

EDIT: Yes, I need to add avatars next to private message titles to make them easier & quicker to know who sent it. We remember pictures easier than text.
marcus_avrelius Offline referral

Posts: 2,424
Joined: May 2013
Reputation: 102

#8
Support Team
Hi I am glad it works. Listen I am not sure how to do it so I will take a loot at it later (have plenty of things to do)
Looking for ways to make money fast? Read this article and start earning money todya fast, easy or for free.





User(s) browsing this thread: 1 Guest(s)