Давненько еще я установил одну чудесную модификацию для phpbb3, а именно Avatar of poster on Index and Viewforum. Чем она хороша? Да тем, что добавляет на главную страницу, напротив каждого подфорума, аватар того, кто последним ответил в темах конкретных подфорумов, а так же на странице просмотра подфорумов выводится аватар автора темы и последнего ответившего. Все это наглядно вы можете увидеть на нашем форуме, присмотритесь. Собственно сегодня хотелось бы проанонсировать данный мод.
[list][*]
[*][/list]
Интеграция только для данной версии мода, на более новых версиях работать не будет
[attachment=0]avatar_index_viewforum121a.zip[/attachment]
[center]Вывод аватар на страницу Активных тем(Новые сообщения, Непрочитанные сообщения и тд)[/center][/b][/size]
Открываем
[code]$tpl_ary = array([/code]
Вставляем перед найденным
[code]$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 = 40; // here you can change the max-width you would like to have the avatars displayed
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'] ;
}
}[/code]
После найденного вставляем
[code]'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 ),
[/code]
Открываем шаблон
[code]<!-- IF searchresults.TOPIC_AUTHOR_AVATAR -->{searchresults.TOPIC_AUTHOR_AVATAR}<!-- ENDIF -->[/code]
Выводит аватару автора темы, а
[code]<!-- IF searchresults.LAST_POST_AUTHOR_AVATAR --> {searchresults.LAST_POST_AUTHOR_AVATAR}<!-- ENDIF -->[/code]
Выводит аватару последнего ответившего. Так что верстайте под свои стили сами
Сама по себе модификация легка в установке, правок правда многовато, но они не трудные. Скачиваем архив с модом и устанавливаем по инструкции
Нужно найти
[code] // These are fields that will be synchronised
$fieldnames = array([/code]
И вставить после найденного код
[code]//-- mod : apiv ----------------------------------------------------------------
//-- add
$fieldnames += array('first_poster_avatar', 'last_poster_avatar');
//-- fin mod : apiv ------------------------------------------------------------[/code]
Но вставить его надо таким образом, чтобы получилось
[code] // These are fields that will be synchronised
$fieldnames = array('time', 'replies', 'replies_real', 'poster', 'first_post_id', 'first_poster_name', 'first_poster_colour', 'last_post_id', 'last_post_subject', 'last_post_time', 'last_poster_id', 'last_poster_name', 'last_poster_colour');
//-- mod : apiv ----------------------------------------------------------------
//-- add
$fieldnames += array('first_poster_avatar', 'last_poster_avatar');
//-- fin mod : apiv ------------------------------------------------------------[/code]
Вот и все, модификация установлена, настройки мода находятся в админке - Общие - Аватары, успехов