Keep track of your DVD collection with this simple PHP script. The information
is stored in a MySQL database and an interface is provided to add, edit and
delete entries. Fully customizable fields allow you to display the details of
importance to you; the default fields are: Title, Studio, Year, Aspect Ratio
and Audio Format. You can optionally link each title to its corresponding page
at the Internet Movie Database, or to a URL of your choice. Customizable
colors, as well as header, footer and style sheet templates allow you to easily
modify the look and feel of the script.
[ Page Top ]
[ Page Top ]
1) Untar the distribution archive:
tar -zxvf phpDVD-1.0.4.tar.gz
The archive contains the following files:
Required:
| index.php | Main script |
| edit.php | Script for adding/editing/deleting entries |
| config.php | Configuration file |
| header.php | Header template |
| footer.php | Footer template |
| styles.php | Style Sheet template |
| go.gif | Image file for the "go" button |
Other:
| LICENSE | GNU General Public License |
| README | README (plain text format) |
| README.html | README (HTML format) |
| CHANGES | Change log |
| UPGRADE | Upgrade notes |
| table.sql | MySQL table & columns |
2) Create a directory where the script will reside in your web space.
For example:
3) Copy all seven required files, indicated in step 1 above, to the new
directory.
4) Create the MySQL database (phpdvd by default.)
5) Create the MySQL table, in the database you just created:
If you wish to use the default column names, you don't need to modify the
table.sql file. Use the following shell command to create the table with
the default columns:
mysql -u username phpdvd -p < table.sql
Where username is your MySQL user name and phpdvd is the name of the
database created in step 4.
If a password is not required to access the database, you can omit the -p option.
(Alternatively, you could also use a utility like phpMyAdmin to create the
table, using the same table.sql file.)
If you don't wish to use the default column names, edit the table.sql
file and modify the 6 column names to suit your needs, before creating the
table. You will also have to edit the config.php file and change the
MySQL Column Names settings to reflect the new names.
6) Edit the config.php file.
The config file is divided in different sections; the settings should be
pretty obvious... The first section contains the edit password, which is
the password required to make changes to the database through the script.
This isn't the same as your MySQL password! It is only used by the
edit.php script to prevent unauthorized users from modifying the
database.
The second section contains the database settings, such as the user name
and password of the MySQL user, the name of the database that you created
in step 4, and the name of the table crated in step 5 (dvds by default.)
You shouldn't need to modify any of the other sections, unless you wish
to customize the script...
If the config.php file will not reside in the same directory as the
index.php and edit.php scripts, you must edit both scripts and point
them to the correct location of the config file. In both index.php and
edit.php, the first setting defines the location of the config file.
[ Page Top ]
To display your DVD collection, simply run the index.php script from the
directory where you have installed it. For example:
http:/www.yoursite.com/dvd/ or
http://www.yoursite.com/dvd/index.php
[ Page Top ]
To edit your collection, run the edit.php script. For example:
http://www.yoursite.com/dvd/edit.php
- To add a new entry, click [ Add New Entry ] under the search box.
- To edit or delete an existing entry, click [ Edit ] next to the entry you
wish to edit.
- To go back to the regular view, click [ Exit Edit Mode ]
When adding/editing/deleting entries you will be prompted for a password.
This password is the first setting defined in the configuration file. Once
the correct password is entered, it will be saved in a cookie so that you
do not have to enter it each time you wish to edit the database.
[ Page Top ]
phpDVD allows you to link each title in your collection to its corresponding
page at the Internet Movie Database (http://www.IMDb.com).
There are two ways to do this:
- Using Direct Links:
This is the best solution, as it ensures that each title is linked to the
correct page at the IMDb. To enable direct links set the "IMDb link mode"
to 1 in your configuration file.
You will have to store the IMDb's unique record number for each title in the sixth column of your MySQL table (which is named link by
default.)
You do not need to put the full URL in this field. Instead, use only the
IMDb's unique record number.
For example: Let's assume that you own the DVD of Casablanca, and wish to
have a direct link to the IMDb's page for that movie. When you go to the
IMDb's page for Casablanca you will notice that the URL looks like this:
http://www.imdb.com/Title?0034583
The number following the question mark (0034583) is the IMDb's unique
record number for Casablanca. Put that number alone in your link field
(the sixth column of your MySQL table), without the rest of the URL.
- Search Links:
This option will link each title to an IMDb search query. To enable search
links set the "IMDb link mode" to 2 in your configuration file.
When using search links, clicking on Casablanca will take you to the
IMDb's search results for a query on "Casablanca". This isn't as good as
using direct links because searches will often return multiple results...
Since there is more than one movie with "Casablanca" in its title, you
won't be taken directly to the page for Casablanca; you will be taken to a
list of results instead. You can leave the sixth column of the MySQL table
empty when using this option, since the script won't need it.
- No Links:
If you do not wish to link to the IMDb, set the IMDb link mode to 0 in
your configuration file.
[ Page Top ]
Regardless of the option you have chosen for the "IMDb link mode" described
above, you can always link any title to a URL of your choice. To do this, put
a complete URL (beginning with http://) in the link field, instead of only
an IMDb record number.
For example: If you wish to link the title "Wonder Boys" to that movie's
official web site, you would put the full URL of that site in the link field.
In this case it would be: http://www.wonderboysmovie.com/
[ Page Top ]
The latest version of this script is available at the following locations:
My homepage: http://ugo.scarlata.it/
[ Page Top ]
Last update: Jun. 22nd, 2003.