Код: Выделить всё
$template->assign_block_vars('similar', array(
Код: Выделить всё
$avatar_img = $avatar_max_dimensions = $topic_last_poster_avatar_height = $topic_last_poster_avatar_width = $topic_first_poster_avatar_width = $topic_first_poster_avatar_height = '';
if ( !empty($row['topic_first_poster_avatar']) || !empty($row['topic_last_poster_avatar']))
{
$avatar_max_dimensions = 50;
if ( $row['topic_first_poster_avatar_width'] >= $row['topic_first_poster_avatar_height'] )
{
$topic_first_poster_avatar_width = ( $row['topic_first_poster_avatar_width'] > $avatar_max_dimensions ) ? $avatar_max_dimensions : $row['topic_first_poster_avatar_width'] ;
$topic_first_poster_avatar_height = ( $topic_first_poster_avatar_width == $avatar_max_dimensions ) ? round($avatar_max_dimensions / $row['topic_first_poster_avatar_width'] * $row['topic_first_poster_avatar_height']) : $row['topic_first_poster_avatar_height'] ;
}
else
{
$topic_first_poster_avatar_height = ( $row['topic_first_poster_avatar_height'] > $avatar_max_dimensions ) ? $avatar_max_dimensions : $row['topic_first_poster_avatar_height'] ;
$topic_first_poster_avatar_width = ( $topic_first_poster_avatar_height == $avatar_max_dimensions ) ? round($avatar_max_dimensions / $row['topic_first_poster_avatar_height'] * $row['topic_first_poster_avatar_width']) : $row['topic_first_poster_avatar_width'] ;
}
if ( $row['topic_last_poster_avatar_width'] >= $row['topic_last_poster_avatar_height'] )
{
$topic_last_poster_avatar_width = ( $row['topic_last_poster_avatar_width'] > $avatar_max_dimensions ) ? $avatar_max_dimensions : $row['topic_last_poster_avatar_width'] ;
$topic_last_poster_avatar_height = ( $topic_last_poster_avatar_width == $avatar_max_dimensions ) ? round($avatar_max_dimensions / $row['topic_last_poster_avatar_width'] * $row['topic_last_poster_avatar_height']) : $row['topic_last_poster_avatar_height'] ;
}
else
{
$topic_last_poster_avatar_height = ( $row['topic_last_poster_avatar_height'] > $avatar_max_dimensions ) ? $avatar_max_dimensions : $row['topic_last_poster_avatar_height'] ;
$topic_last_poster_avatar_width = ( $topic_last_poster_avatar_height == $avatar_max_dimensions ) ? round($avatar_max_dimensions / $row['topic_last_poster_avatar_height'] * $row['topic_last_poster_avatar_width']) : $row['topic_last_poster_avatar_width'] ;
}
}
Код: Выделить всё
'S_UNREAD_TOPIC' => $unread_topic,
Код: Выделить всё
'TOPIC_AUTHOR_AVATAR' => ($config['enable_avatar_index']) ? get_user_avatar($row['topic_first_poster_avatar'], $row['topic_first_poster_avatar_type'], $topic_first_poster_avatar_width, $topic_first_poster_avatar_height) : false,
'TOPIC_AUTHOR_AVATAR_MARGIN' => ( $topic_first_poster_avatar_width == '' ) ? '' : (( $topic_first_poster_avatar_width == $avatar_max_dimensions ) ? 5 : ( $avatar_max_dimensions - $topic_first_poster_avatar_width + 5 )),
'AVATAR_WIDTH' => $avatar_max_dimensions,
'LAST_POST_AUTHOR_AVATAR' => ($config['enable_avatar_index']) ? get_user_avatar($row['topic_last_poster_avatar'], $row['topic_last_poster_avatar_type'], $topic_last_poster_avatar_width, $topic_last_poster_avatar_height) : false,
'LAST_POST_AUTHOR_AVATAR_MARGIN'=> ( $topic_last_poster_avatar_width == $avatar_max_dimensions ) ? 5 : ( $avatar_max_dimensions - $topic_last_poster_avatar_width + 5 ),
Код: Выделить всё
{similar.TOPIC_ICON_IMG}); background-repeat: no-repeat;"<!-- ENDIF -->>
Код: Выделить всё
<!-- IF similar.TOPIC_AUTHOR_AVATAR --><span style="float: left; padding-top: 3px; margin-right: {similar.TOPIC_AUTHOR_AVATAR_MARGIN}px;">{similar.TOPIC_AUTHOR_AVATAR}</span><!-- ENDIF -->
Код: Выделить всё
<span>
{L_POST_BY_AUTHOR}
Код: Выделить всё
<!-- IF similar.LAST_POST_AUTHOR_AVATAR --><div style="float: left; padding-top: 0px; margin-left: 5px; margin-right: {similar.LAST_POST_AUTHOR_AVATAR_MARGIN}px;">{similar.LAST_POST_AUTHOR_AVATAR}</div><!-- ENDIF -->
Код: Выделить всё
<td class="row1" width="25" align="center">{similar.TOPIC_FOLDER_IMG}</td>
Код: Выделить всё
<td class="row1" width="25" align="center"><!-- IF similar.TOPIC_AUTHOR_AVATAR -->{similar.TOPIC_AUTHOR_AVATAR}<!-- ENDIF --></td>
Код: Выделить всё
<td class="row1" width="120" align="center">
Код: Выделить всё
<!-- IF similar.LAST_POST_AUTHOR_AVATAR --><div style="float: left; padding-top: 0px; margin-left: 5px; margin-right: {similar.LAST_POST_AUTHOR_AVATAR_MARGIN}px;">{similar.LAST_POST_AUTHOR_AVATAR}</div><!-- ENDIF -->