Görünümü
[ resmi görüntülemek için tıklayın ]
Kod: Tümünü seç
<html>
<head>
<meta http-equiv="Content-Language" content="pt">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>New Page 1</title>
</head>
<body style="font-family: Tahoma; font-size: 10pt; background-color: #E6E6FF">
<table border="1" width="100%" id="table1" cellspacing="0" bordercolor="#C4C4FF" cellpadding="0" bgcolor="#F2F2FF">
<tr>
<td style="font-size: 10pt; border-collapse: collapse; padding: 10px">
<p align="center"><font size="6">[IMDB] for IPB 2.1.x</font></td>
</tr>
</table>
<p align="center"> </p>
<table border="1" width="100%" id="table2" cellspacing="0" bordercolor="#C4C4FF" cellpadding="0" bgcolor="#F2F2FF">
<tr>
<td style="font-size: 10pt; border-collapse: collapse; padding: 10px"><b>Files needed to edit:</b><ul>
<li>\sources\classes\bbcode\class_bbcode.php <font face="Wingdings">
<a href="#class_bbcode">î</a></font></li>
<li>\cache\lang_cache\en\lang_post.php <font face="Wingdings">
<a href="#lang_post">î</a></font></li>
<li>\jscripts\ipb_editor_std.js <font face="Wingdings">
<a href="#ipb_editor_std">î</a></font></li>
</ul>
<p><b>» Admin CP editing required! </b><font face="Wingdings">
<a href="#admin_cp">î</a></font></td>
</tr>
</table>
<p> </p>
<table border="1" width="100%" id="table3" cellspacing="0" bordercolor="#C4C4FF" cellpadding="0" bgcolor="#F2F2FF">
<tr>
<td style="font-size: 10pt; border-collapse: collapse; padding: 10px" bgcolor="#D7D7FF"><b><font size="3"><a name="class_bbcode"></a>» class_bbcode.php</font></b></td>
</tr>
<tr>
<td style="font-size: 10pt; border-collapse: collapse; padding: 10px">
<ol>
<li><b>Find:</b><br><br><textarea rows="7" cols="69" name="1"> //-----------------------------------------
// Do [QUOTE(name,date)] tags
//-----------------------------------------
</textarea><br>
<br>
<b>Add Before:<br>
<br>
</b><textarea rows="7" cols="69" name="10"> //-----------------------------------------
// tags [imdb]
//-----------------------------------------
$txt = preg_replace( "#(\[imdb=.*\])#Uies" , "\$this->regex_parse_imdb('\\1')" , $txt);
$txt = preg_replace( "#(\[imdb\].*\[/imdb\])#ies" , "\$this->regex_parse_imdb('\\1')" , $txt );
</textarea><br>
<br>
</li>
<li><b>Find:</b><br><br><textarea rows="7" cols="69" name="11"> //-----------------------------------------
// Quote
//-----------------------------------------
$txt = preg_replace( "#<!--QuoteBegin-->(.+?)<!--QuoteEBegin-->#" , '[quote]' , $txt );</textarea><br>
<br>
<b>Add Before:<br>
<br>
</b><textarea rows="7" cols="69" name="12"> //-----------------------------------------
// IMDB
//-----------------------------------------
$txt = preg_replace( "#<!--ImdbBegin(.+?)-->(.+?)<!--ImdbEnd(.+?)-->#ms" , '[imdb=\\1]' , $txt );
</textarea><br>
<br>
</li>
<li><b>Find:</b><br><br><textarea rows="7" cols="69" name="13"> /*-------------------------------------------------------------------------*/
// OVERWRITE DEFAULT: regex_font_attr:
/*-------------------------------------------------------------------------*/</textarea><br>
<br>
<b>Add Before:
</b><i>(<b>PS:</b> Here you can now edit two variables: <b>
$imdb_toptext</b>, the text of the IMDB-Box; and <b>$imdb_perpost</b>,
the number of tags allowed per post)</i><b><br>
<br>
</b><textarea rows="13" cols="94" name="14"> /*-------------------------------------------------------------------------*/
// regex_parse_imdb: cria a caixinha do imdb
/*-------------------------------------------------------------------------*/
var $imdb_count = 0;
function regex_parse_imdb($texto="")
{
global $imdb_count;
// Change this to your like
$imdb_toptext = 'IMDB'; // Title of the IMDB-Box
$imdb_perpost = 1; // maximum number of imdb tags allowed per post
// Stop editing here
if ($texto == "") return;
$imdb_count++;
if ($imdb_count > $imdb_perpost) return;
$idfilme = preg_replace('/[^0-9]/i',"\\1",$texto);
if (strlen($idfilme) != 7) { $this->error = 'imdb_nao7'; return; }
$imdb_style = $this->wrap_style('quote');
$imdb_url = "http://imdb.com/title/tt".$idfilme."/";
$imdb = @fopen($imdb_url, "r");
if ($imdb == FALSE) { $this->error = 'imdb_invalido'; return; }
while (!feof($imdb))
$imdb_raw .= fgets($imdb, 4096);
fclose($imdb);
preg_match ( "'<h1><strong class=\"title\">(.*?)</strong></h1>'s" , $imdb_raw , $titulo );
$titulo = str_replace("\n"," ", trim(strip_tags($titulo[1])));
preg_match ( "'Genre:</b>\\n(.*?)(\(more\)|\\n)'" , $imdb_raw , $genero );
$genero = @strip_tags($genero[1]);
preg_match ( "'Tagline:</b> (.*?)( <a href|\\n)'" , $imdb_raw , $slogan );
$slogan = @$slogan[1];
preg_match ( "'Plot (Outline|Summary):</b> (.*?)( <a href=|\\n)'" , $imdb_raw , $resumo );
$resumo = @$resumo[2];
preg_match ( "'Runtime:</b>\\n(.*?)\\n<br>'" , $imdb_raw , $duracao );
$duracao = @$duracao[1];
if (strlen($duracao) > 50) $duracao = substr($duracao,0,50)."...";
preg_match ( "'User Rating:(.*?)\\n\\n(.*?)\\n(.*?)\\n<b>(.*?)/10</b> \((.*?) votes\)\\n'" , $imdb_raw , $votacao );
$votos = @$votacao[5];
$votacao = @$votacao[4];
if ($votacao >= 0) $cor = 'red';
if ($votacao >= 4) $cor = '#C8C800';
if ($votacao >= 8) $cor = 'green';
$estrelas = 4 + $votacao * 9 + log10($votacao) ;
$estrelas = '<span style="position:relative; font-size: 16px; background: url(\'style_images/1/imdb_rate_full.gif\')"><img width="'.($estrelas - 1).'" height="16" src="style_images/1/tp.gif"></span><span style="font-size: 16px; background: url(\'style_images/1/imdb_rate_none.gif\') right"><img width="'.(101 - $estrelas).'" height="16" src="style_images/1/tp.gif"></span>';
preg_match ( "'top 250: (.*?)</a>'" , $imdb_raw , $top );
$top = @strip_tags($top[0]);
if (isset($top)) $top = '[URL=http://imdb.com/chart/top]'.$top.'[/URL]';
preg_match ( "'Awards:</b> \\n(.*?)\\n<a href's" , $imdb_raw , $premios );
$premios = @str_replace("\n"," ",$premios[1]);
preg_match ( "'(Cast overview,|Complete credited cast|Credited cast)(.*?)<a href=\"(.*?)\">(.*?)</a>(.*?)<a href=\"(.*?)\">(.*?)</a>(.*?)<a href=\"(.*?)\">(.*?)</a>(.*?)<a href=\"(.*?)\">(.*?)</a>(.*?)<a href=\"(.*?)\">(.*?)</a>(.*?)'s" , $imdb_raw , $actores );
$actores = "[url=http://imdb.com".@$actores[3]."]".@$actores[4]."[/url], ".
"[url=http://imdb.com".@$actores[6]."]".@$actores[7]."[/url], ".
"[url=http://imdb.com".@$actores[9]."]".@$actores[10]."[/url], ".
"[url=http://imdb.com".@$actores[12]."]".@$actores[13]."[/url], ".
"[url=http://imdb.com".@$actores[15]."]".@$actores[16]."[/url]";
$imdb_final = "<table border='0'><tr><td style='font-size: 13px; line-height:125%;'>";
$imdb_final .= "[B][size=4]» [url=".$imdb_url."]".$titulo."[/url][/size][/B]<br><br>";
if ($genero <> "") $imdb_final .= "[B]Genre[/B]: $genero<br>";
if ($slogan <> "") $imdb_final .= "[B]Tagline[/B]: $slogan<br>";
if ($resumo <> "") $imdb_final .= "[B]Plot Outline[/B]: $resumo<br>";
if ($votos <> "") $imdb_final .= "[B]User Rating[/B]: [COLOR=$cor][B]".$votacao."[/B][/COLOR]/10 $estrelas ($votos votes) $top<br>";
if ($duracao <> "") $imdb_final .= "[B]Runtime[/B]: $duracao<br>";
if ($premios <> "") $imdb_final .= "[B]Awards[/B]: $premios<br>";
if ($actores <> "") $imdb_final .= "[B]Cast[/B] [SIZE=1][I](first 5)[/I][/SIZE]: $actores<br>";
$imdb_final .= "<br>[B]IMDB[/B]: [url]".$imdb_url."[/url]</span></td></tr></table>";
$imdb_topo = str_replace("<div class='quotetop'>QUOTE</div>","<div class='quotetop' style='padding:0px;'><div width=100% style='background: url(style_images/1/css_img_imdb.gif) no-repeat right top; margin:0;padding:4px;'>$imdb_toptext</div></div>", $imdb_style['START']);
return "<!--ImdbBegin".$idfilme."-->".$imdb_topo.$imdb_final.$imdb_style['END']."<!--ImdbEnd".$idfilme."-->";
} </textarea><br>
<br>
</li>
<li><b>Done!</b></li>
</ol>
</tr>
</table>
<p> </p>
<table border="1" width="100%" id="table4" cellspacing="0" bordercolor="#C4C4FF" cellpadding="0" bgcolor="#F2F2FF">
<tr>
<td style="font-size: 10pt; border-collapse: collapse; padding: 10px" bgcolor="#D7D7FF"><b><font size="3"><a name="lang_post"></a>»
lang_post.php</font></b></td>
</tr>
<tr>
<td style="font-size: 10pt; border-collapse: collapse; padding: 10px">
<ol>
<li><b>Find:</b><br><br><textarea rows="7" cols="69" name="15"><?php
</textarea><br>
<br>
<b>Add After:<br>
<br>
</b><textarea rows="7" cols="69" name="16">$lang['imdb_nao7'] = "[IMDB] ID consists in 7 numbers";
$lang['imdb_invalido'] = "[IMDB] The id you entered does not exists, or the movie is not valid!";</textarea><br>
<br>
</li>
<li><b>Done!</b></li>
</ol>
</tr>
</table>
<p> </p>
<table border="1" width="100%" id="table5" cellspacing="0" bordercolor="#C4C4FF" cellpadding="0" bgcolor="#F2F2FF">
<tr>
<td style="font-size: 10pt; border-collapse: collapse; padding: 10px" bgcolor="#D7D7FF"><b><font size="3"><a name="ipb_editor_std"></a>» </font></b>
<font size="3"><b>ipb_editor_std.js</b></font></td>
</tr>
<tr>
<td style="font-size: 10pt; border-collapse: collapse; padding: 10px">
<ol>
<li><b>Find:</b><br><br><textarea rows="7" cols="69" name="17">/*-------------------------------------------------------------------------*/
// URL tag
/*-------------------------------------------------------------------------*/</textarea><br>
<br>
<b>Add Before:<br>
<br>
</b><textarea rows="13" cols="94" name="18">/*-------------------------------------------------------------------------*/
// IMDB tag
/*-------------------------------------------------------------------------*/
function tag_imdb()
{
//----------------------------------------
// Do we have ranged text?
//----------------------------------------
if ( check_range() )
{
//----------------------------------------
// Yes, just wrap text
//----------------------------------------
wrap_tags( "[imdb]", "[/imdb]", "" );
}
else
{
var imdbID = prompt("What's the ID/URL of the movie?\nExample: 1234567 , http://www.imdb.com/title/tt1234567/ , etc", "");
if ( ! imdbID )
{
alert("It would be useful to write something ...");
return;
}
wrap_tags( "[imdb]"+imdbID+"[/imdb]", "" );
}
}</textarea><br>
<br>
</li>
<li><b>Done!</b></li>
</ol>
</tr>
</table>
<p> </p>
<table border="1" width="100%" id="table6" cellspacing="0" bordercolor="#C4C4FF" cellpadding="0" bgcolor="#F2F2FF">
<tr>
<td style="font-size: 10pt; border-collapse: collapse; padding: 10px" bgcolor="#D7D7FF"><b><font size="3"><a name="admin_cp"></a>» Admin
CP</font></b></td>
</tr>
<tr>
<td style="font-size: 10pt; border-collapse: collapse; padding: 10px">
<ol>
<li><b>Go to:</b><br><br>
Look & Feel -> Skin Manager -> Edit Template HTML -> Post / PM
Editor -> editor_std<br>
<br>
<b>Find:</b><br>
<br><textarea rows="7" cols="69" name="19"> <td><div id='do_code'><img class="rteimage" src="{ipb.vars['img_url']}/folder_rte_images/code.gif" width="21" height="21 alt="{ipb.lang['js_tt_code']}" title="{ipb.lang['js_tt_code']}" onclick="simpletag('code')"></div></td></textarea><br>
<br>
<b>Add After:<br>
<br>
</b><textarea rows="13" cols="94" name="110"> <!--SEP-->
<td><img class="rteVertSep" src="{ipb.vars['img_url']}/folder_rte_images/blackdot.gif" width="1" height="20" border="0" alt=""></td>
<!--/SEP-->
<td><div id='do_imdb'><img class="rteimage" src="style_images/1/folder_rte_images/imdb.gif" width="25" height="24" alt="IMDB" title="Add IMDB Tag" onclick="tag_imdb()"></div></td></textarea><br>
<br>
Click <u>Save Template Bit</u><br>
</li>
<li><b>Done!</b></li>
</ol>
</tr>
</table>
</body>
</html>