Bravo List

Bravo List (http://www.bvlist.com/index.php)
-   TBDev (http://www.bvlist.com/forumdisplay.php?f=20)
-   -   Nexusphp and IMBD Parser (http://www.bvlist.com/showthread.php?t=10335)

mpx 2nd April 2015 23:59

Nexusphp and IMBD Parser
 
I have question how to make in nexusphp source to automatic imdb parse data. Now i using default imdb mod/source for necusphp

PHP Code:


    
if ($imdb_id && $showextinfo['imdb'] == 'yes' && $CURUSER['showimdb'] != 'no')
    {
        
$thenumbers $imdb_id;

        
$Cache->new_page('imdb_id_'.$thenumbers.'_large'1296000true);
        if (!
$Cache->get_page()){
            
$movie = new imdb ($thenumbers);
            
$movieid $thenumbers;
            
$movie->setid ($movieid);
            
$target = array('Title''Credits''Plot');
            switch (
$movie->cachestate($target))
            {
                case 
"0" //cache is not ready, try to
                
{
                    if(
$row['cache_stamp']==|| ($row['cache_stamp'] != && (time()-$row['cache_stamp']) > $auto_obj->timeout))    //not exist or timed out
                        
tr($lang_details['text_imdb'] . $lang_details['row_info'] , $lang_details['text_imdb'] . $lang_details['text_not_ready']."<a href=\"retriver.php?id="$id ."&type=1&siteid=1\">".$lang_details['text_here_to_retrieve'] . $lang_details['text_imdb'],1);
                    else
                        
tr($lang_details['text_imdb'] . $lang_details['row_info'] , "<img src=\"pic/progressbar.gif\" alt=\"\" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" $lang_details['text_someone_has_requested'] . $lang_details['text_imdb'] . " ".min(max(time()-$row['cache_stamp'],0),$auto_obj->timeout) . $lang_details['text_please_be_patient'],1);
                    break;
                }
                case 
"1" :
                    {
                        
reset_cachetimestamp($row['id']);
                        
$country $movie->country ();
                        
$director $movie->director();
                        
$creator $movie->creator(); // For TV series
                        
$write $movie->writing();
                        
$produce $movie->producer();
                        
$cast $movie->cast();
                        
$plot $movie->plot ();
                        
$plot_outline $movie->plotoutline();
                        
$compose $movie->composer();
                        
$gen $movie->genres();
                        
//$comment = $movie->comment();
                        
$similiar_movies $movie->similiar_movies();

                        if ((
$photo_url $movie->photo_localurl() ) != FALSE)
                            
$smallth "<img src=\"".$photo_url"\" width=\"105\" onclick=\"Preview(this);\" alt=\"poster\" />";
                        else
                            
$smallth "<img src=\"pic/imdb_pic/nophoto.gif\" alt=\"no poster\" />";

                        
$autodata '<a href="http://www.imdb.com/title/tt'.$thenumbers.'">http://www.imdb.com/title/tt'.$thenumbers."</a><strong><font color=\"navy\">------------------------------------------------------------------------------------------------------------------------------------</font>\n";
                        
$autodata .= "<font color=\"darkred\" size=\"3\">".$lang_details['text_information']."</font>\n";
                        
$autodata .= "<font color=\"navy\">------------------------------------------------------------------------------------------------------------------------------------</font></strong>\n";
                        
$autodata .= "<strong><font color=\"DarkRed\">"$lang_details['text_title']."</font></strong>" "".$movie->title ()."\n";
                        
$autodata .= "<strong><font color=\"DarkRed\">".$lang_details['text_also_known_as']."</font></strong>";

                        
$temp "";
                        foreach (
$movie->alsoknow() as $ak)
                        {
                            
$temp .= $ak["title"].$ak["year"]. ($ak["country"] != "" " (".$ak["country"].")" "") . ($ak["comment"] != "" " (" $ak["comment"] . ")" "") . ", ";
                        }
                        
$autodata .= rtrim(trim($temp), ",");
                        
$runtimes str_replace(" min",$lang_details['text_mins'], $movie->runtime_all());
                        
$autodata .= "\n<strong><font color=\"DarkRed\">".$lang_details['text_year']."</font></strong>" "".$movie->year ()."\n";
                        
$autodata .= "<strong><font color=\"DarkRed\">".$lang_details['text_runtime']."</font></strong>".$runtimes."\n";
                        
$autodata .= "<strong><font color=\"DarkRed\">".$lang_details['text_votes']."</font></strong>" "".$movie->votes ()."\n";
                        
$autodata .= "<strong><font color=\"DarkRed\">".$lang_details['text_rating']."</font></strong>" "".$movie->rating ()."\n";
                        
$autodata .= "<strong><font color=\"DarkRed\">".$lang_details['text_language']."</font></strong>" "".$movie->language ()."\n";
                        
$autodata .= "<strong><font color=\"DarkRed\">".$lang_details['text_country']."</font></strong>";

                        
$temp "";
                        for (
$i 0$i count ($country); $i++)
                        {
                            
$temp .="$country[$i], ";
                        }
                        
$autodata .= rtrim(trim($temp), ",");

                        
$autodata .= "\n<strong><font color=\"DarkRed\">".$lang_details['text_all_genres']."</font></strong>";
                        
$temp "";
                        for (
$i 0$i count($gen); $i++)
                        {
                            
$temp .= "$gen[$i], ";
                        }
                        
$autodata .= rtrim(trim($temp), ",");

                        
$autodata .= "\n<strong><font color=\"DarkRed\">".$lang_details['text_tagline']."</font></strong>" "".$movie->tagline ()."\n";
                        if (
$director){
                            
$autodata .= "<strong><font color=\"DarkRed\">".$lang_details['text_director']."</font></strong>";
                            
$temp "";
                            for (
$i 0$i count ($director); $i++)
                            {
                                
$temp .= "<a target=\"_blank\" href=\"http://www.imdb.com/Name?" "".$director[$i]["imdb"]."" ."\">" $director[$i]["name"] . "</a>, ";
                            }
                            
$autodata .= rtrim(trim($temp), ",");
                        }
                        elseif (
$creator)
                            
$autodata .= "<strong><font color=\"DarkRed\">".$lang_details['text_creator']."</font></strong>".$creator;

                        
$autodata .= "\n<strong><font color=\"DarkRed\">".$lang_details['text_written_by']."</font></strong>";
                        
$temp "";
                        for (
$i 0$i count ($write); $i++)
                        {
                            
$temp .= "<a target=\"_blank\" href=\"http://www.imdb.com/Name?" "".$write[$i]["imdb"]."" ."\">" "".$write[$i]["name"]."" "</a>, ";
                        }
                        
$autodata .= rtrim(trim($temp), ",");

                        
$autodata .= "\n<strong><font color=\"DarkRed\">".$lang_details['text_produced_by']."</font></strong>";
                        
$temp "";
                        for (
$i 0$i count ($produce); $i++)
                        {
                            
$temp .= "<a target=\"_blank\" href=\"http://www.imdb.com/Name?" "".$produce[$i]["imdb"]."" ." \">" "".$produce[$i]["name"]."" "</a>, ";
                        }
                        
$autodata .= rtrim(trim($temp), ",");

                        
$autodata .= "\n<strong><font color=\"DarkRed\">".$lang_details['text_music']."</font></strong>";
                        
$temp "";
                        for (
$i 0$i count($compose); $i++)
                        {
                            
$temp .= "<a target=\"_blank\" href=\"http://www.imdb.com/Name?" "".$compose[$i]["imdb"]."" ." \">" "".$compose[$i]["name"]."" "</a>, ";
                        }
                        
$autodata .= rtrim(trim($temp), ",");

                        
$autodata .= "\n\n<strong><font color=\"navy\">------------------------------------------------------------------------------------------------------------------------------------</font>\n";
                        
$autodata .= "<font color=\"darkred\" size=\"3\">".$lang_details['text_plot_outline']."</font>\n";
                        
$autodata .= "<font color=\"navy\">------------------------------------------------------------------------------------------------------------------------------------</font></strong>";

                        if(
count($plot) == 0)
                        {
                            
$autodata .= "\n".$plot_outline;
                        }
                        else
                        {
                            for (
$i 0$i count ($plot); $i++)
                            {
                                
$autodata .= "\n<font color=\"DarkRed\">.</font> ";
                                
$autodata .= $plot[$i];
                            }
                        }


                        
$autodata .= "\n\n<strong><font color=\"navy\">------------------------------------------------------------------------------------------------------------------------------------</font>\n";
                        
$autodata .= "<font color=\"darkred\" size=\"3\">".$lang_details['text_cast']."</font>\n";
                        
$autodata .= "<font color=\"navy\">------------------------------------------------------------------------------------------------------------------------------------</font></strong>\n";

                        for (
$i 0$i count ($cast); $i++)
                        {
                            if (
$i 9)
                            {
                                break;
                            }
                            
$autodata .= "<font color=\"DarkRed\">.</font> " "<a target=\"_blank\" href=\"http://www.imdb.com/Name?" "".$cast[$i]["imdb"]."" ."\">" $cast[$i]["name"] . "</a> " .$lang_details['text_as']."<strong><font color=\"DarkRed\">" "".$cast[$i]["role"]."" " </font></strong>\n";
                        }


                        
/*$autodata .= "<strong><font color=\"navy\">------------------------------------------------------------------------------------------------------------------------------------</font>\n";
                        $autodata .= "<font color=\"darkred\" size=\"3\">".$lang_details['text_may_also_like']."</font>\n";
                        $autodata .= "<font color=\"navy\">------------------------------------------------------------------------------------------------------------------------------------</font></strong>\n";

                        $autodata .=  "<table cellpadding=\"10\"><tr>";
                        if($similiar_movies)
                        {
                            $counter = 0;
                            foreach($similiar_movies as $similiar_movies_each)
                            {
                                $on_site = "";
                                $imdb_config_inst = new imdb_config();
                                if($imdb_id_new = parse_imdb_id($imdb_config_inst->imdbsite . $similiar_movies_each['Link']))
                                {
                                    $similiar_res = sql_query("SELECT id FROM torrents WHERE url = " . sqlesc((int)$imdb_id_new) . " AND id != ".sqlesc($id)." ORDER BY RAND() LIMIT 1") or sqlerr(__FILE__, __LINE__);
                                    while($similiar_arr = mysql_fetch_array($similiar_res)) {
                                        $on_site = "<strong><a href=\"" .htmlspecialchars(get_protocol_prefix() . $BASEURL . "/details.php?id=" . $similiar_arr['id'] . "&hit=1")."\">" . $lang_details['text_local_link'] . "</a></strong>";
                                    }
                                }

                                $autodata .=  ($counter == 5 ? "</tr><tr>" : "" ) . "<td align=\"center\" style=\"border: 0px; padding-left: 20px; padding-right: 20px; padding-bottom: 10px\"><a href=\"" . $movie->protocol_prefix . $movie->imdbsite . $similiar_movies_each['Link'] . "\" title=\"\"><img style=\"border:0px;\" src=\"" . $similiar_movies_each['Local'] . "\" alt=\"" . $similiar_movies_each['Name'] . "\" />" . $similiar_movies_each['Name'] . "</a>" . ($on_site != "" ? $on_site : "&nbsp;") .  "</td>";
                                $counter++;
                            }
                        }
                        $autodata .=  "</tr></table>";*/

                        //$autodata .= "\n\n<strong><font color=\"navy\">------------------------------------------------------------------------------------------------------------------------------------</font>\n";
                        //$autodata .= "<font color=\"darkred\" size=\"3\">".$lang_details['text_recommended_comment']."</font>\n";
                        //$autodata .= "<font color=\"navy\">------------------------------------------------------------------------------------------------------------------------------------</font></strong>";

                        //$autodata .= "".$comment;
                        
$cache_time $movie->getcachetime();

                        
$Cache->add_whole_row();
                        print(
"<tr>");
                        print(
"<td class=\"rowhead\"><a href=\"javascript: klappe_ext('imdb')\"><span class=\"nowrap\"><img class=\"minus\" src=\"pic/trans.gif\" alt=\"Show/Hide\" id=\"picimdb\" title=\"".$lang_detail['title_show_or_hide']."\" /> ".$lang_details['text_imdb'] . $lang_details['row_info'] ."</span></a><div id=\"posterimdb\">".  $smallth."</div></td>");
                        
$Cache->end_whole_row();
                        
$Cache->add_row();
                        
$Cache->add_part();
                        print(
"<td class=\"rowfollow\" align=\"left\"><div id='kimdb'>".$autodata);
                        
$Cache->end_part();
                        
$Cache->add_part();
                        print(
$lang_details['text_information_updated_at'] . date("Y-m-d"$cache_time) . $lang_details['text_might_be_outdated']."<a href=\"".htmlspecialchars("retriver.php?id="$id ."&type=2&siteid=1")."\">".$lang_details['text_here_to_update']);
                        
$Cache->end_part();
                        
$Cache->end_row();
                        
$Cache->add_whole_row();
                        print(
"</div></td></tr>");
                        
$Cache->end_whole_row();
                        
$Cache->cache_page();
                        echo 
$Cache->next_row();
                        
$Cache->next_row();
                        echo 
$Cache->next_part();
                        if (
get_user_class() >= $updateextinfo_class)
                            echo 
$Cache->next_part();
                        echo 
$Cache->next_row();
                        break;
                    }
                case 
"2" :
                    {
                        
tr($lang_details['text_imdb'] . $lang_details['row_info'] ,$lang_details['text_network_error'],1);
                        break;
                    }
                case 
"3" :// not a valid imdb url
                
{
                    break;
                }
            }
        }
        else{
                echo 
$Cache->next_row();
                
$Cache->next_row();
                echo 
$Cache->next_part();
                if (
get_user_class() >= $updateextinfo_class){
                    echo 
$Cache->next_part();
                }
                echo 
$Cache->next_row();
        }
    } 

Bump: I found the solution :gum:

Johnny Utah 27th January 2017 22:47

it would have been nice to know what is the solution?

thartley55 28th January 2017 01:49

I'll bet he was thinking the exact same thing...since he/she was waiting for a reply for nearly two years. :wallbash:
:chch:


All times are GMT +2. The time now is 10:40.

Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2024, vBulletin Solutions Inc.