I need to use ajax to make this whole process smoother.
Here is a demo: http://www.theflickzone.com/dev/
If anyone can do this for me I will pay a few $ via paypal to say thanks :)
Contents of index.html
<form action="return.php" method="POST">
<p>IMDB URL: <input type="text" name="imdb" autocomplete="off"></p>
<p>Links(line by line):
<br />
<textarea cols="50" rows="5" name="links" autocomplete="off"></textarea></p>
<p><input type="submit" /></p>
</form>
Contents of return.php
<?php
function get_inner_string($a,$b,$c)
{
$y = explode($b,$a);
$x = explode($c,$y[1]);
return $x[0];
}
$imdb = $_POST['imdb'];
$openIMDB = file_get_contents($imdb);
$findTitle = get_inner_string($openIMDB, '<b>', '</b>');
$posterUrl = $_POST['imdb'];
$posterUrl = preg_replace(
'~http://www.imdb.com/title/tt\d+/~',
'http://www.theflickzone.com/IMDBPoster/getPoster.php?url=$0',
$posterUrl
);
$posterUrl = preg_replace(
'~url=http://www.imdb.com~',
'url=',
$posterUrl
);
echo '[IMG]' . $posterUrl . '[/IMG]';
echo '<br />';
echo '<br />';
echo '[IMDB]'.$imdb.'[/IMDB]';
echo '<br />';
$findPlot = get_inner_string($openIMDB, '<h5>Plot:</h5>', '<a class');
echo '[QUOTE]' . $findPlot . '[/QUOTE]';
echo '<br />';
$links = explode("\n", $_POST['links']);
$count = count($links);
if ($count == '1'){
$linksN = implode(\n, $links);
echo '<p>[FULL]' . $linksN . '[/FULL]</p>';
}
else {
for($i=0;$i<$count;$i++)
{
echo '[PART="'.($i+1).'"]'.$links[$i].'[/PART] <br />';
}
}
?>