http://www.phpbbguru.net/community/topi ... ml#p258443
По патч файлу поставил, на форуме работает отлично, однако на портале вложения мп3'ишные отображаються как текст:
Код: Выделить всё
Attachment:
02 - Лучше присядь.mp3.mp3
Код: Выделить всё
Attachment:
02 - Лучше присядь.mp3.mp3
Код: Выделить всё
if($row['extension']=='torrent')
{
$attachments[$row['post_msg_id']]['torrents'][]=$row;
}
Код: Выделить всё
if($row['extension']=='mp3')
{
$attachments[$row['post_msg_id']]['mp3'][]=$row;
}
Код: Выделить всё
'S_HAS_TRACKER_TORRENT' => $is_candowntorr && $attachments[$fetch_announcements[$i]['post_id']]['torrents'] ? true : false,
Код: Выделить всё
'S_HAS_TRACKER_MP3' => $is_candowntorr && $attachments[$fetch_announcements[$i]['post_id']]['mp3'] ? true : false,
Код: Выделить всё
'TORRENT_ALTITLE' => $torrent_basename,
)
);
}
}
Код: Выделить всё
if($is_candowntorr && $attachments[$fetch_announcements[$i]['post_id']]['mp3'])
{
foreach ($attachments[$fetch_announcements[$i]['post_id']]['mp3'] as $mp3_data)
{
$mp3_basename=basename($mp3_data['real_filename']);
$template->assign_block_vars('torrents_row.mp3_fields', array(
'MP3_LINK' => append_sid("{$phpbb_root_path}download/file.$phpEx", 'id=' . $mp3_data['attach_id'] . $mp3_addon),
'MP3_SRC' => $phpbb_root_path . 'images/tracker/filesave_big.png',
'MP3_SRCS' => $phpbb_root_path . 'images/tracker/filesave.png',
'MP3_ALTITLE' => utf8_strlen($mp3_basename)>$mp3_substr ? utf8_substr($mp3_basename, 0, $mp3_substr).'...' : $mp3_basename,
)
);
}
}
Код: Выделить всё
</tr>
<!-- END torrent_screenshot_fields -->
<!-- ENDIF -->
Код: Выделить всё
<!-- IF torrents_row.S_HAS_TRACKER_MP3 -->
<tr>
<td class="row3"><b class="genmed">Sample: </b></td>
</tr>
<!-- BEGIN mp3_fields --> <tr>
<td>
<a href="{torrents_row.mp3_fields.MP3_LINK}">{torrents_row.mp3_fields.MP3_ALTITLE}</a>:<br>
<object type="application/x-shockwave-flash"
data="player_mp3.swf?mp3={torrents_row.mp3_fields.MP3_LINK}" width="200" height="20" />
<param name="movie" value="player_mp3.swf?mp3={torrents_row.mp3_fields.MP3_LINK}" />
<param name="wmode" value="transparent">
</object><br> </td>
</tr>
<!-- END mp3_fields -->
<!-- ENDIF -->
Код: Выделить всё
'S_HAS_TRACKER_POSTER' => (@$torrents_attach['poster']) ? true : false,
Код: Выделить всё
'S_HAS_TRACKER_MP3' => (@$torrents_attach['mp3']) ? true : false,
Код: Выделить всё
if(@$torrents_attach['screenshot'])
{
include($viewtopic_add2inc.'viewtopic_add2_screenshot.'.$phpEx);
}
Код: Выделить всё
if(@$torrents_attach['mp3'])
{
include($viewtopic_add2inc.'viewtopic_add2_mp3.'.$phpEx);
}
Код: Выделить всё
<?php
/**
*
* @package ppkBB3cker
* @version $Id: viewtopic_add2_poster.php 1.000 2009-02-17 11:25:00 PPK $
* @copyright (c) 2008, 2009 PPK
* http://www.ppkbb3cker.ru, http://protoneutron.narod.ru
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/
/**
* @ignore
*/
if (!defined('IN_PHPBB'))
{
exit;
}
$mp3_addon='';
foreach ($torrents_attach['mp3'] as $mp3_data)
{
$mp3_basename=basename($mp3_data['real_filename']);
$template->assign_block_vars('postrow.mp3_fields', array(
'MP3_LINK' => append_sid("{$phpbb_root_path}download/file.$phpEx", 'id=' . $mp3_data['attach_id'] . $mp3_addon),
'MP3_SRC' => $phpbb_root_path . 'images/tracker/filesave_big.png',
'MP3_SRCS' => $phpbb_root_path . 'images/tracker/filesave.png',
'MP3_ALTITLE' => utf8_strlen($mp3_basename)>$mp3_substr ? utf8_substr($mp3_basename, 0, $mp3_substr).'...' : $mp3_basename,
)
);
}
?>
Код: Выделить всё
$(".torr_sl").show();
}
return false;
});
Код: Выделить всё
$(".mp3_cl").click(function () {
var isVisible = $('.mp3_sl').is(':visible');
if(isVisible)
{
$(".mp3_sl").hide();
}
else
{
$(".mp3_sl").show();
}
return false;
});
Код: Выделить всё
<!-- END torrent_screenshot_fields -->
</ul>
</div>
</div>
</div>
<!-- ENDIF -->
Код: Выделить всё
<!-- IF postrow.S_HAS_TRACKER_MP3 -->
<div class="myblock" style="width:{postrow.TORR_TABLE_WIDTH}px;">
<div class="row3">
<span><a class="mp3_cl" href="#">Sample: </a></span>
</div>
<div class="mp3_sl">
<!-- BEGIN torrent_mp3_fields -->
<a href="{postrow.mp3_fields.MP3_LINK}">{postrow.mp3_fields.MP3_ALTITLE}</a>:<br>
<object type="application/x-shockwave-flash"
data="player_mp3.swf?mp3={postrow.mp3_fields.MP3_LINK}" width="200" height="20" />
<param name="movie" value="player_mp3.swf?mp3={postrow.mp3_fields.MP3_LINK}" />
<param name="wmode" value="transparent">
</object><br>
<!-- END torrent_mp3_fields -->
<!-- ENDIF -->
Вернуться в «Вопросы, ответы и примеры решений»