Welcome to the Films script where you can lookup your favorite films and download posters & backdrops to use within your web application. This uses the themoviedb.org API so you will need to create an account and get an API key.
| Name | Created | Actions |
|---|---|---|
| Desperado | 12:53 AM, 24th April 2010 | |
| Fight Club | 12:53 AM, 24th April 2010 | |
| From Dusk Till Dawn | 12:54 AM, 24th April 2010 | |
| The Crow | 12:54 AM, 24th 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 `filmdb`;
CREATE TABLE `films` (
`id` INT AUTO_INCREMENT PRIMARY KEY NOT NULL,
`film_id` VARCHAR(10) NOT NULL DEFAULT '',
`film_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
);
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
-- films
/img/films
Finally you will need to insert your themoviedb.org API key in the includes/class.filmdb.php file
class Tvdb {
// API key for themoviedb website
var $api_key = 'INSERT_YOUR_MOVIEDB_API_KEY_HERE';
That's it you're good to go. Start by adding a few Films you lucky little devil you!
The main page (this one) will simply display a table of all the Films you have in the database with the option to edit/delete them. From here you can also add a Film using the link in the top corner.
When adding a Film you first need to run a search. Insert the film name into the first input field, if Javascript is enabled the list of found Films will automatically populate. If not click the "Search" button.
The script will come back with a number of found films. Click on one of these and again if Javascript is enabled the page will be automatically refreshed with the film infomation & images. If Javascript is not enable simply click the "Save" button at the bottom of the page.
N.B. Adding a new film may take a while as the images are downloaded from themoviedb.org server.
To edit a film click the "Edit" icon on the main page next to the film you want to edit. This page will display an editable overview of the film taken from themoviedb.org website along with the film poster image.
Each film comes with a number of different posters and backdrop images. When adding a film 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 film click the Bin icon on the main page, if Javascript is enabled a confirmation will be displayed. If you click "OK" the film will be removed from the database. Everything is soft deleted so you're able to recover deleted films from the database.