alhrock / phptvdb

Automatically exported from code.google.com/p/phptvdb
0 stars 0 forks source link

Problem with getEpisodeByDate() #1

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
I used a simple bit of code to test it.

    include('TVDB.php');

        $tvShows = TV_Shows::findById('75978'); 
        $tvEpisode = $tvShows->getEpisodeByDate('20090308');

        echo $tvEpisode->name;

What is the expected output? What do you see instead?

Fatal error: Call to a member function getEpisodeByDate() on a non-object
in /home/usenettv/public_html/test/test.php on line 24

What version of the product are you using? On what operating system?
Hosted on a linux server.

Please provide any additional information below.

I'm not sure whats changed since I last used this function. 

Thanks

Original issue reported on code.google.com by Iveo...@gmail.com on 13 Mar 2009 at 10:56

GoogleCodeExporter commented 8 years ago
I forgot that I have added that function to the PHP and it did not come by 
default.

Within the TV_Show.class.php

        public function getEpisodeByDate ($datetoday){
            $params = array('action' => 'get_episodebydate', 
                            'datetoday'=>int)$datetoday, 
                            'show_id' => $this->id);

            $data = self::request($params);

            if ($data) {
                $xml = simplexml_load_string($data);
                return new TV_Episode($xml->Episode);
            } else {
                return false;
            }
        }

Which calls the following code from TVDB.class.php

                case 'get_episodebydate':
                    $datetoday = $params['datetoday'];
                    $showId = $params['show_id'];
                    $url =
self::apiUrl.'/GetEpisodeByAirDate.php?apikey='.self::apiKey.'&seriesid='.$showI
d.'&airdate='.$datetoday;

                    $data = self::fetchData($url);
                    return $data;
                break;

This was all working correctly, then suddenly it didn't I am unsure why.

Original comment by Iveo...@gmail.com on 13 Mar 2009 at 11:03

Attachments:

GoogleCodeExporter commented 8 years ago
This issue should be closed. The problem was not where I thought it was.

I shall open a new issue.

Original comment by Iveo...@hotmail.com on 17 Mar 2009 at 12:14

GoogleCodeExporter commented 8 years ago

Original comment by ryan.doherty on 27 Mar 2009 at 5:11