News:

Want to get involved in developing SMF? Why not lend a hand on our GitHub!

Main Menu

Show avatar icon into mobile version, using default theme

Started by radge, January 23, 2024, 02:49:47 PM

Previous topic - Next topic

radge

I am using smf 2.1.4 with the default theme and I cannot show the avatars in the posts, in the mobile version.

I have tried to modify this in file index.template.php

// Set the following variable to true if this theme wants to display the avatar of the user that posted the last and the first post on the message index and recent pages.
$settings['avatars_on_indexes'] = true;

// Set the following variable to true if this theme wants to display the avatar of the user that posted the last post on the board index.
$settings['avatars_on_boardIndex'] = true;

And this file BoardIndex.template.php

I have replaced this
function template_bi_board_lastpost($board)
{
if (!empty($board['last_post']['id']))
echo '
<p>', $board['last_post']['last_post_message'], '</p>';
}


With this code

function template_bi_board_lastpost($board)
{
if (!empty($board['last_post']['id']))
echo '
', $board['last_post']['member']['avatar']['image'], '
<p>', $board['last_post']['last_post_message'], '</p>';
}


It's strange because now in the mobile version the icons appear in the forum index, but when I enter a post they don't appear.

Thanks in advance.
Nuevo foro sobre renault http://www.renaultforo.com

TwitchisMental

QuoteIt's strange because now in the mobile version the icons appear in the forum index, but when I enter a post they don't appear.

Thanks in advance.


What you are editing has nothing to do with avatars in the post section. I would suggest undoing those changes.

To do what you are wanting to do -

Open responsive.css

Find :

.user_info li,
.custom_fields_above_member {
display: none;
}

Add After :

.user_info .avatar{
display: inline;
}

Diego Andrés


SMF Tricks - Free & Premium Responsive Themes for SMF.

TwitchisMental


Advertisement: