Предлагаю вариант сокращенного отображения новинок трекера на главной странице портала
Посмотреть на мои труды можно здесь
Админам:Если мой пост не в тойм разделе - просьба отнестись с пониманием и перенести его в нужное место
У меня к сожалению нет прав на прикрепление файлов в сообщение, поэтому архив выложить не смог.
Опишу все по порядку для тех кто заинтересовался и желает такое увидеть на своем сайте
начнем по порядку:
Откроем файл portal/block/ppkBB3cker_ltorrents.php
находим
Код: Выделить всё
'TORRENTS_COUNT' => $i,
'S_LTDISPLAY' => $ltdisplay_opt[3] && $ltdisplay ? 1 : 0,
Код: Выделить всё
'TOPIC_FORUM_IMG' => $fetch_announcements[$i]['forum_image'] ? '<img src="' . $phpbb_root_path . $fetch_announcements[$i]['forum_image'] . '"/>' : '',
'TORRENT_SEEDERS_VAL' => $fetch_announcements[$i]['seeders'] ? '<a href="'.append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $a_fid . '&t=' . $fetch_announcements[$i]['topic_id'].'&opt=seed#opt').'">'.intval(@$fetch_announcements[$i]['seeders']).'</a>' : '',
'TORRENT_LEECHERS_VAL' => $fetch_announcements[$i]['leechers'] ? '<a href="'.append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $a_fid . '&t=' . $fetch_announcements[$i]['topic_id'].'&opt=leech#opt').'">'.intval(@$fetch_announcements[$i]['leechers']).'</a>' : '',
'TORRENT_COMPLETED_VAL' => $fetch_announcements[$i]['times_completed'] ? '<a href="'.append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $a_fid . '&t=' . $fetch_announcements[$i]['topic_id'].'&opt=finished#opt').'">'.intval(@$fetch_announcements[$i]['times_completed']).'</a>' : '',
'TORRENT_SIZE_VAL' => $fetch_announcements[$i]['size'] ? '<a href="'.append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $a_fid . '&t=' . $fetch_announcements[$i]['topic_id'].'&opt=filelist#opt').'">'.get_formatted_filesize(@$fetch_announcements[$i]['size']).'</a>' : '???',
'TORRENT_HEALTH_VAL' => $fetch_announcements[$i]['seeders'] && $fetch_announcements[$i]['leechers'] ? '<a href="'.append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $a_fid . '&t=' . $fetch_announcements[$i]['topic_id'].'&opt=leave#opt').'">'.get_torrent_health(@$fetch_announcements[$i]['seeders'], @$fetch_announcements[$i]['leechers']).'</a>' : '',
Далее в этом же файле находим
Код: Выделить всё
p.enable_smilies,
p.enable_bbcode,
p.enable_magic_url,
p.bbcode_bitfield,
Код: Выделить всё
tr.seeders,
tr.times_completed,
tr.leechers,
tr.size,
f.forum_image,
в этом же запросе сразу после
Код: Выделить всё
FROM
Код: Выделить всё
' . FORUMS_TABLE . ' AS f,
Код: Выделить всё
' . $post_time . "
Код: Выделить всё
f.forum_id = t.forum_id AND
Код: Выделить всё
$posts[$i]['topic_views'] = ($row['topic_views']);
Код: Выделить всё
$posts[$i]['seeders'] = ($row['seeders']);
$posts[$i]['times_completed'] = ($row['times_completed']);
$posts[$i]['leechers'] = ($row['leechers']);
$posts[$i]['size'] = ($row['size']);
$posts[$i]['forum_image'] = ($row['forum_image']);
Проверяем: если все сделали правильно, то работать должен и полный вариант и сокращенный.
Следующий пункт это создание файла шаблона компактного блока. Вариант блока работает на всех subsilver2 подобных шаблонах
создаем файл \styles\subsilver2\template\portal\block\ppkBB3cker_ltorrents_compact.html
не забываем, что файл должен быть в кодировке UTF8 без BUM
в файл вставляем следующее:
Код: Выделить всё
<table class="tablebg" cellspacing="1" width="100%">
<tr>
<th>{L_LATEST_TORRENTS}</th>
</tr>
<tr class="row1">
<td>
<!-- IF LATEST_TORR_COUNT -->
<table class="tablebg" width="100%" cellspacing="1">
<tr>
<th colspan="2" nowrap="nowrap"> {L_TOPICS} </th>
<th nowrap="nowrap"> {L_AUTHOR} </th>
</tr>
<!-- BEGIN torrents_row -->
<tr valign="middle">
<td class="row1" width="25" align="center">
{torrents_row.TOPIC_FORUM_IMG}
</td>
<td class="row1">
<!-- IF torrents_row.S_HAS_TRACKER_POSTER -->
<!-- BEGIN torrent_poster_fields -->
<a href="{torrents_row.U_VIEW_COMMENTS}" title='<img{torrents_row.torrent_poster_fields.POSTER_WH} src="{torrents_row.torrent_poster_fields.POSTER_SRC}" alt="" />'><strong>{torrents_row.TITLE}</strong></a>
<!-- END torrent_poster_fields -->
<!-- ELSE -->
<a href="{torrents_row.U_VIEW_COMMENTS}" alt=""><strong>{torrents_row.TITLE}</strong></a>
<!-- ENDIF -->
<table width="100%" cellpadding="0" cellspacing="1" border="0">
<tr class="cat">
<td width="17%" nowrap="nowrap">{L_TORRENT_SEEDERS}: <b>{torrents_row.TORRENT_SEEDERS_VAL}</b></td>
<td width="18%" nowrap="nowrap">{L_TORRENT_LEECHERS}: <b>{torrents_row.TORRENT_LEECHERS_VAL}</b></td>
<td width="19%" nowrap="nowrap">{L_TORRENT_COMPLETED}: <b>{torrents_row.TORRENT_COMPLETED_VAL}</b></td>
<td width="26%" nowrap="nowrap">{L_TORRENT_SIZE}: <b>{torrents_row.TORRENT_SIZE_VAL}</b> {torrents_row.TORRENT_SIZE_LANG}</td>
<td width="20%" nowrap="nowrap">{L_TORRENT_HEALTH}: <b>{torrents_row.TORRENT_HEALTH_VAL}</b>%</td></tr>
</table>
</td>
<td class="row2" width="100" align="center"><strong><a href="{torrents_row.U_USER_PROFILE}">{torrents_row.POSTER}</a></strong></td>
</tr>
<!-- END torrents_row -->
</table>
<!-- IF PAGINATION or TOTAL_POSTS or TOTAL_TOPICS -->
<span style="float: right;"><div class="pagination">
<!-- IF PAGINATION --><a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{PAGE_NUMBER}</a>
• <span>{PAGINATION}</span><!-- ELSE --> • {PAGE_NUMBER}<!-- ENDIF -->
</div>
</span>
<!-- ENDIF -->
<!-- ELSE -->
{L_NO_LATEST_TORRENTS}
<!-- ENDIF -->
</td>
</tr>
</table>
<br />
находим в нем
Код: Выделить всё
<!-- IF S_TRACKER_CENTER -->
<!-- INCLUDE portal/block/ppkBB3cker_ltorrents.html -->
<!-- ENDIF -->
Код: Выделить всё
<!-- IF S_TRACKER_CENTER -->
<!-- INCLUDE portal/block/ppkBB3cker_ltorrents_compact.html -->
<!-- ENDIF -->
у вас компактное отображение новинок.
Замечу:
1.Если вы не ставили последние обновления в которых реализовано отображение всплывающих подсказок с помощью jquerry постеры во всплывающих подсказках отображаться не будут.
2. Для тех, у кого все на мази и не нравится, что постеры "маленько прозрачные" - тогда правьте css
3. Постер во всплывающем окне отображается при наведении курсора мыши на названии новой раздачи и только при условии, что постер размещен на сайте штатным способом.