Welcome to the TV Shows script where you can lookup your favorite shows and download posters & fanart to use within your web application. This uses the thetvdb.com API so you will need to create an account and get an API key.
| Name | Created | Actions |
|---|---|---|
| Breaking Bad | 9:51 AM, 15th April 2010 | |
| Lost | 9:48 AM, 15th April 2010 | |
| Sons of Anarchy | 3:17 AM, 17th April 2010 | |
| True Blood | 9:51 AM, 15th April 2010 |
Requests are welcome so let me know if you think the script needs anything via email
First create the database and tables using the SQL below:
CREATE DATABASE `tvdb`;
CREATE TABLE `shows` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`series_id` varchar(10) NOT NULL DEFAULT '',
`series_name` varchar(255) NOT NULL DEFAULT '',
`overview` text NOT NULL,
`created` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`modified` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`status` tinyint(1) NOT NULL DEFAULT '1',
PRIMARY KEY (`id`)
);
Now you need to modifiy the includes/config.php file with the base path and base URL of the script.
$base_path = 'C:\Xampplite\htdocs\Testing\tvdb\\';
$base_url = 'http://localhost/Testing/tvdb/';
Along with your database settings.
define('HOSTNAME','localhost');
define('DB_USERNAME','USERNAME');
define('DB_PASSWORD','PASSWORD');
define('DB_NAME','tvdb');
On a live server you will also need to make the following folders writable so that the script can add/edit files
/cache
-- searches
-- series
-- zip
/img/series
/img/cache
Finally you will need to insert your TVDB API key in the includes/class.tvdb.php file
class Tvdb {
// API key for TVDB website
var $api_key = 'INSERT_YOUR_TVDB_API_KEY_HERE';
That's it you're good to go. Start by adding a few TV Shows you lucky little devil you!
The main page (this one) will simply display a table of all the Shows you have in the database with the option to edit/delete them. From here you can also add a Show using the link in the top corner.
When adding a Show you first need to run a search. Insert the show name into the first input field, if Javascript is enabled the list of found Shows will automatically populate. If not click the "Search" button.
The script will come back with a number of found shows. Click on one of these and again if Javascript is enabled the page will be automatically refreshed with the show infomation & images. If Javascript is not enable simply click the "Save" button at the bottom of the page.
N.B. Adding a new show may take a while as the images are downloaded from thetvdb.com server.
To edit a show click the "Edit" icon on the main page next to the show you want to edit. This page will display an editable overview of the show taken from thetvdb.com website along with the show banner image.
Each show comes with a number of different posters and fanart images. When adding a show the defaults are downloaded and used however on this page you can change these. To change simply click on the "Change" link. Javascript has to be enabled for this to function. Once clicked a full list of images will be displayed, click one of these new images and the default one will be replaced. Click the "Save" button at the bottom of the page so save your new choice.
To delete a show click the Bin icon on the main page, if Javascript is enabled a confirmation will be displayed. If you click "OK" the show will be removed from the database. Everything is soft deleted so you're able to recover deleted shows from the database.