Element
09-02-2006, 08:31 AM
I have a problem with a modification I downloaded for IPB. It is a IMDb.com mod to feed some infor about a movie through fopen to use as a BBcode tag for IPB.
It seems that it catches the wrong HTML for the cast of movies from http://imdb.com. Right now it catches the end of the page and the links... that is wrong... Here is what the result is (Look at the cast part)
http://amerikanmetz.rave5.com/realmscommunity/index.php?showtopic=36
Here is the problematic code:
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_raw );
for($i = 0; $i < count($actors_raw); $i++) {
strip_tags($actores_raw[$i], '<a>');
}
$actores = " . "]" . $actores_raw[4] . " (http://imdb.com" . $actores_raw[3), ";
if (strlen($actores_raw[6]) > 5 && strlen($actores_raw[7]) > 5) {
$actors .= " . "]" . $actores_raw[7] . " (http://imdb.com" . $actores_raw[6), ";
}
if (strlen($actores_raw[9]) > 5 && strlen($actores_raw[10]) > 5) {
$actors .= " . "]" . $actores_raw[10] . " (http://imdb.com" . $actores_raw[9), ";
}
if (strlen($actores_raw[12]) > 5 && strlen($actores_raw[14]) > 5) {
$actors .= " . "]" . $actores_raw[13] . " (http://imdb.com" . $actores_raw[12), ";
}
if (strlen($actores_raw[15]) >= 5 && strlen($actores_raw[16]) >= 5) {
$actors .= " . "]" . $actores_raw[16] . " (http://imdb.com" . $actores_raw[15)";
}
It seems that it catches the wrong HTML for the cast of movies from http://imdb.com. Right now it catches the end of the page and the links... that is wrong... Here is what the result is (Look at the cast part)
http://amerikanmetz.rave5.com/realmscommunity/index.php?showtopic=36
Here is the problematic code:
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_raw );
for($i = 0; $i < count($actors_raw); $i++) {
strip_tags($actores_raw[$i], '<a>');
}
$actores = " . "]" . $actores_raw[4] . " (http://imdb.com" . $actores_raw[3), ";
if (strlen($actores_raw[6]) > 5 && strlen($actores_raw[7]) > 5) {
$actors .= " . "]" . $actores_raw[7] . " (http://imdb.com" . $actores_raw[6), ";
}
if (strlen($actores_raw[9]) > 5 && strlen($actores_raw[10]) > 5) {
$actors .= " . "]" . $actores_raw[10] . " (http://imdb.com" . $actores_raw[9), ";
}
if (strlen($actores_raw[12]) > 5 && strlen($actores_raw[14]) > 5) {
$actors .= " . "]" . $actores_raw[13] . " (http://imdb.com" . $actores_raw[12), ";
}
if (strlen($actores_raw[15]) >= 5 && strlen($actores_raw[16]) >= 5) {
$actors .= " . "]" . $actores_raw[16] . " (http://imdb.com" . $actores_raw[15)";
}