Autor Tópico: código BBC imdb  (Lida 4794 vezes)

0 Membros e 1 Visitante estão a ver este tópico.

Offline candidosa2

  • Suporte Tecnico
  • Fundador
  • *
  • Mensagens: 5072
  • Rank: 1658
  • Sexo: Masculino
  • Suporte
    • Hosting Moçambique
código BBC imdb
« em: 28 de Outubro de 2014, 00:34 »


Nao se esquecer que tem que usar assim o codigo

Citar
[imdb]tt0848228[/imdb]

subs.php

Pesquisar por

Código: [Seleccione]
array(
'tag' => 'br',
'type' => 'closed',
'content' => '<br />',
),


Adicione depois

Código: [Seleccione]
array(
'tag' => 'imdb',
'type' => 'unparsed_content',
'content' => ($context['browser']['is_gecko'] ? '<pre style="margin-top: 0; display: inline;">$1</pre>' : '$1'),
'validate' => isset($disabled['code']) ? null : create_function('&$tag, &$data, $disabled', '
global $context,$txt,$settings;
if (!isset($disabled[\'code\']))
{$filmidsi = preg_replace("/[^0-9]/i","",$data);
if (strlen($filmidsi) != 7) return;
$imdb_url = "http://imdb.com/title/tt".$filmidsi."/";
$imdb = @fopen($imdb_url, "r");
if (!$imdb) return;
while (!feof($imdb)) {$imdb_raw .= fgets($imdb, 4096);}
fclose($imdb);
preg_match ( "~<span class=\"itemprop\" itemprop=\"name\">(.*?)</span>~s" , $imdb_raw , $baslik );
$baslik = $baslik[1];
$baslik = str_replace("\n"," ", trim(strip_tags($baslik)));
$baslik = "<a href=\"{$imdb_url}\" target=\"blank\" title=\"{$baslik}\">{$baslik}</a>";
preg_match ( "~Genres:</h4>(.*?)(<a class=|</div>)~s" , $imdb_raw , $tür );
$tür =preg_replace( "/\s+/" , " " ,$tür[1]);
preg_match ( "~Plot Keywords:</h4>(.*?)(<a class=|</div>)~s" , $imdb_raw , $tagline );
                        $tagline = preg_replace( "/\s+/" , " " , $tagline[1] ); 
preg_match ( "~<p itemprop=\"description\">(.*?)(</p>)~s" , $imdb_raw , $p_outline );
$p_outline = preg_replace( "/\s+/" , " " , $p_outline[1]);
preg_match ( "~ Ratings:(.*?)(<a class=|</div>)~s" , $imdb_raw , $u_rating );
$u_rating = preg_replace( "/\s+/" , " " ,$u_rating[1]);
preg_match ( "~Runtime:(.*?)(<a class=|</div>)~s" , $imdb_raw , $runtime );
$runtime = str_replace("\n"," ", trim(strip_tags($runtime[1])));
preg_match ( "~Language:(.*?)(<a class=|</div>)~s" , $imdb_raw , $dil );
$dil =preg_replace( "/\s+/" , " " ,$dil[1]);
preg_match("~Stars:</h4>(.*?)(<a class=|</div>)~s", $imdb_raw, $oyuncu);
$oyuncu = preg_replace( "/\s+/" , " " ,$oyuncu[1]);
$data = "<div style=\"font-family: arial; font-weight: 600; font-size: 10px;\">"
."<b>{$baslik}</b></br>"
."<b>{$txt[\'imbd_genre\']}</b>{$tür}</br>"
."<b>{$txt[\'imbd_tagline\']}</b>{$tagline}</br>"
."<b>{$txt[\'imbd_desc\']}</b>{$p_outline}</br>"
."<b>{$txt[\'imbd_user_rating\']}</b>{$u_rating}</br>"
."<b>{$txt[\'imbd_runtime\']}</b>{$runtime}</br>"
."<b>{$txt[\'imbd_language\']}</b>{$dil}</br>"
."<b>{$txt[\'imbd_cast\']}</b>{$oyuncu}</br>"
."</div>";
}'),
'block_level' => true,
),



Modificationsportuguese_pt.php

Pesquisar ou colocar antes

Código: [Seleccione]
?>

O seguinte codigo

Código: [Seleccione]
$txt['imbd_genre'] = "Esp&eacute;cie:";
$txt['imbd_tagline'] = "Slogan:";
$txt['imbd_desc'] = "Explica&ccedil;&atilde;o:";
$txt['imbd_user_rating'] = "Vota&ccedil;&atilde;o:";
$txt['imbd_runtime'] = "Dura&ccedil;&atilde;o:";
$txt['imbd_language'] = "L&iacute;ngua:";
$txt['imbd_cast'] = "Elenco:";