Advertisement:

Author Topic: [Tutorial] Colocar um leitor de MP3 com tag BBC [versão 2.0.x]  (Read 4218 times)

Offline edu_fmc

  • Jr. Member
  • **
  • Posts: 332
    • Fórum Música
Boas,

Tive algum problema para colocar um leitor de MP3 para tocar músicas que tinha no server ou então para tocar backingtrack de outros sites.
Depois de pesquisar encontrei um MOD para a versão 1.x e alterei-o para a versão 2.0.4 que é a que uso.

O MOD é o mp3 Flash Player BBC Tag:
http://custom.simplemachines.org/mods/index.php?mod=829ufwr


Vamos começar:

Primeiro, faça download do anexo que estou a deixar.

Faça upload dos ficheiros para:
mp3.gif -> themes/images/bbc
podcast -> themes/images
dewplayer.swf -> board (raiz)
dewplayer-multi.swf -> board (raiz)



.Source/Subs.php
Code: (encontrar) [Select]
array(
'tag' => 'hr',
'type' => 'closed',
'content' => '<hr />',
'block_level' => true,
),

Code: (Adicionar antes) [Select]
array(
'tag' => 'mp3',
'type' => 'unparsed_commas_content',
'test' => '\d+,\d+,0|1,center|left|right\]',
'content' => '$1',
'validate' => create_function('&$tag, &$data, $disabled', '
if (!isset($disabled[\'mp3\'])) {
$url =  end(explode(\'/\', dirname("{$_SERVER[\'PHP_SELF\']}")));
$chopped = parse_url($url);
$board_dir = "http://". "{$_SERVER[\'HTTP_HOST\']}"."/".$chopped[\'path\'];
$theme_dir = "$board_dir/Themes/default";
if (strpos($data[0], \'|\') === false)
{
$data[0] = "<p style=\"color: #000000;font-family: Arial, sans-serif;font-size: 11px;font-weight: normal;text-align: $5;text-decoration: none;\"><object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0\" width=\"$2\" height=\"$3\" id=\"dewplayer\" align=\"middle\"><param name=\"allowScriptAccess\" value=\"sameDomain\" /><param name=\"movie\" value=\"$board_dir/dewplayer.swf?son=".strtr($data[0], array(\'<br />\' => \'\'))."&autostart=$4&bgcolor=FFFFFF\" /><param name=\"quality\" value=\"high\" /><param name=\"bgcolor\" value=\"FFFFFF\" /><embed src=\"$board_dir/dewplayer.swf?son=".strtr($data[0], array(\'<br />\' => \'\'))."&autostart=$4&bgcolor=FFFFFF\" quality=\"high\" bgcolor=\"FFFFFF\" width=\"$2\" height=\"$3\" name=\"dewplayer\" align=\"middle\" allowScriptAccess=\"sameDomain\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\"></embed></object> <a href=\"".strtr($data[0], array(\'<br />\' => \'\'))."\"><img align=\"absbottom\" style=\"text-decoration: none;border: none;\" src=\"$theme_dir/images/podcast.gif\" title =\"Podcast\" alt=\"Podcast\"></a><br></p>";
} else {
$data[0] = "<p style=\"color: #000000;font-family: Arial, sans-serif;font-size: 11px;font-weight: normal;text-align: $5;text-decoration: none;\"><object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0\" width=\"$2\" height=\"$3\" id=\"dewplayer\" align=\"middle\"><param name=\"wmode\" value=\"transparent\"><param name=\"allowScriptAccess\" value=\"sameDomain\" /><param name=\"movie\" value=\"$board_dir/dewplayer-multi.swf?mp3=".strtr($data[0], array(\'<br />\' => \'\'))."&autostart=$4&showtime=1&bgcolor=FFFFFF\" /><param name=\"quality\" value=\"high\" /><param name=\"bgcolor\" value=\"FFFFFF\" /><embed src=\"$board_dir/dewplayer-multi.swf?mp3=".strtr($data[0], array(\'<br />\' => \'\'))."&autostart=$4&showtime=1&bgcolor=FFFFFF\" quality=\"high\" bgcolor=\"FFFFFF\" width=\"$2\" height=\"$3\" name=\"dewplayer\" wmode=\"transparent\" align=\"middle\" allowScriptAccess=\"sameDomain\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\"></embed></object></p>";
}
} else {
$tag[\'content\'] = \'$1\';
}
'),
'block_level' => true,
'disabled_content' => '<a href="$1" target="_blank">$1</a>',
),



.Source/Subs-Editor.php
Code: (encontrar) [Select]
array(
'image' => 'hr',
'code' => 'hr',
'before' => '[hr]',
'description' => $txt['horizontal_rule']
)

Code: (Adicionar Depois) [Select]
array(),
array(
'image' => 'mp3',
'code' => 'mp3',
'before' => '[mp3=200,20,0,left]',
'after' => '[/mp3]',
'description' => $txt['mp3']
),
array(),


.Themes/default/languages/Modifications.portuguese_pt-utf8.php - Se usarem este idioma, caso contrário alterem o idioma que usarem.
Code: (Encontrar) [Select]
?>
Code: (Adicionar Antes) [Select]
//Begin MP3 Player
$txt['mp3'] = 'Inserir leitor de MP3';
//END MP3 Player



Espero que vos seja útil :)
« Last Edit: July 29, 2013, 11:09:54 AM by edu_fmc »