Put your AMC data on the web (PHP, MySQL)

If you made a template for printing or HTML export, you can offer it to the others here. You can also ask here for help about these templates
Post Reply
smalltux
Posts: 2
Joined: 2007-05-18 19:42:16

Put your AMC data on the web (PHP, MySQL)

Post by smalltux »

Introduction

I had a great time with AMC and I still use it as my primary tool for collecting movie info. But you need some PHP and MySQL database if you want to display, link and browse your movie collection over the internet.

Here is my best effort so far:

http://www.luka.in.rs

It's simple, clean and searchable. It's frame based but if you browse the site with your mobile phone, your mobile web client will be automatically detected and the layout will be adjusted (no frames). So, you'll have your collection of movies by your side at all times.

The site has some other nice features. Just to spice your appetite a little, here is the list of my movies with YouTube video clips:

http://www.luka.in.rs/index.php?q=clip&t=youtube

...and a list of my movies currently on IMDB's top#250 page:

http://www.luka.in.rs/index.php?q=IMDB&t=top250

Nice? If you agree, read further...

Database setup

Create an empty database on your MySQL server with two empty tables in it (the first one is reserved for future use, the second one will hold
real data):

Code: Select all

CREATE DATABASE `moviesdb` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci;

USE `moviesdb`;

CREATE TABLE attributes (
  ID int(11) NOT NULL auto_increment,
  NUM int(11) NOT NULL,
  `VALUE` varchar(512) collate latin1_general_ci NOT NULL,
  `TYPE` varchar(512) collate latin1_general_ci NOT NULL,
  INFO varchar(512) collate latin1_general_ci default NULL,
  PRIMARY KEY  (ID),
  KEY `VALUE` (`VALUE`),
  KEY `TYPE` (`TYPE`),
  KEY NUM (NUM)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

CREATE TABLE movies (
  ID int(11) NOT NULL auto_increment,
  NUM int(11) NOT NULL default '0',
  MEDIA text collate latin1_general_ci,
  RATING float default NULL,
  ORIGINALTITLE varchar(768) collate latin1_general_ci NOT NULL,
  TRANSLATEDTITLE text collate latin1_general_ci,
  DIRECTOR text collate latin1_general_ci,
  COUNTRY text collate latin1_general_ci,
  `YEAR` int(11) default NULL,
  LENGTH int(11) default NULL,
  ACTORS text collate latin1_general_ci,
  URL text collate latin1_general_ci,
  DESCRIPTION text collate latin1_general_ci,
  SOURCE varchar(32) collate latin1_general_ci default NULL,
  COMMENTS text collate latin1_general_ci,
  SUBTITLES text collate latin1_general_ci,
  CATEGORY text collate latin1_general_ci,
  PICTURENAME text collate latin1_general_ci,
  PRODUCER text collate latin1_general_ci,
  DATEADD date NOT NULL,
  LANGUAGES text collate latin1_general_ci,
  PARSED int(11) NOT NULL default '0',
  TOP250 int(11) NOT NULL default '0',
  PRIMARY KEY  (ID),
  UNIQUE KEY NUM (NUM),
  UNIQUE KEY ORIGINALTITLE_YEAR (ORIGINALTITLE,`YEAR`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;
To access this database from PHP code, you'll need four parameters:

- database host (like 'localhost' or 'mysql.myhosting.mydomain')
- database name ('moviesdb' in the example above)
- database username
- database password

Remember these parameters, you'll need them in the following step.

Web site setup

Download the following archive:

http://www.luka.in.rs/movies_i_like.tar.gz

Unpack the archive to some empty folder on your computer (folder structure must be preserved).

Locate the file conf.php. Edit the first four lines (access parameters
for your MySQL movie database created in the first step) and save the file.

Move all the files and directories to some folder under the document root of your website. Your movie catalog will be accessed through URL like: http://yourhost.domain/movies/index.php

IMPORTANT: Folder 'update' contains scripts which will be used to update the content of your website. PROTECT THAT FOLDER IMMEDIATELLY with username/password of your choice (I have used plain and simple .htaccess protection on my website).

Working with AMC

Remember, all your data will come from AMC. Data should be properly formatted if you want to use my PHP code out of the box. I use the following fields in AMC (other fields are of no interest to me):

MEDIA: location of the movie on your shelf. I use something like '[123]' (box 123) or '[123][124]' (one movie in two boxes)

RATING: must be a number, like IMDB rating (7.6, 8.2, 3.2...)

ORIGINALTITLE: the name says it all

TRANSLATEDTITLE: other movie titles

DIRECTOR: list of directors, comma separated

COUNTRY: list of countries, comma separated

YEAR: a single number like '1976'

LENGTH: a number, movie duration in minutes

ACTORS: coma separated list of actors with roles in braces, like 'Al Pacino (as Michael), Marlon Brando (as Godfather)'

URL: single URL of the movie (IMDB, Amazon or any other link)

DESCRIPTION: movie description (plot). PUT MOVIE TAGLINE AS THE FIRST LINE HERE, with quotes. Example:

"The biggest adventure ever"
This movie is about...etc...etc..

SOURCE: I use this field for YouTube URL (movie trailer). Don't bother to extract clip id from the youtube URL, just paste the full URL from the address line of your browser (like http://www.youtube.com/watch?v=XyzB16st8wM&feature=user)

COMMENTS: movie comentary.

SUBTITLES: english, french... whatever

CATEGORY: comma separated list of movie categories

PRODUCER: I use this field for movie credits, not the actual producer

LANGUAGES: comma separated list of movie languages

Image: my code assumes that you store only small (thumbnail) images in your AMC, the page will look ugly with too big images. My thumbnails are mostly 107px wide (don't ask me how I chose number 107 :) )

This looks complicated but in fact - it is not. If you use IMDB script of AMC to collect movie data, it can be tuned to format imported data eactly as described above! Once you set parameters for the IMDB import script, all settings will be preserved for future use.

Updating your online (MySQL) movie database

In AMC select a number of movies you want to export.

Use SQL export, and don't forget to export movie thumbnails at the same time. Choose to export ONLY movie fields given above, otherwise you will fail.

AMC will create one .sql file on your local disk and a number of image files (movie thumbs).

Open your movie site (http://yourhost.domain/movies/index.php for example) and look for the green round button with an arrow on the bottom of the left frame. Click on it and you will be asked for username/password (because you protected the 'update' folder, remeber?)

Update form appears with several fields labeled like 'File 1:', 'File 2:'...

Select your .sql file and image files with 'browse' buttons (the order of upload does not matter) and click on 'Upload new movies'.

You can repeat the proces as many times as necessary.

You are done.

Updating IMDB Top#250 ranks

If you want to see a nice looking tag for each your movie currently on the IMDB TOP#250 list do the following:

Go to http://www.imdb.com/chart/top

Open the source code of the page (Ctrl+U in Firefox), select all code (CTRL+A) and copy it to the clipboard (CTRL+C).

Go to your website, click on the green button with an arrow (as described before), paste the HTML code in the big text area and click on the 'Update IMDB ranks' button).

That's it.

Editing your movies online, without AMC

When a single movie info is displayed in the right frame, look for 'edit' button in it (under the thumbnail). Click on it, and you will be asked for username/password of the protected update folder. Once you get through, you will see your movie data in an editable form.

Bulk start

Export all your movies and images to get an .sql file and a number of thumbnail images.

Upload only SQL file to your webserver by using the given procedure (click on the green button to get the upload form, browse for .sql file, click on the update button).

Transfer all your exported thumbnail images in bulk via FTP to the thumbnail directory ('t').

Insert new movie without AMC

Click on the red 'plus' button on the bottom of the left frame.

Icing on the cake

...or: import new movie directly from IMDB :)

Click on the yellow 'plus' button on the bottom of the left frame. The popup window appears. Paste IMDB url of the movie here (like http://www.imdb.com/title/tt0468569/). Click on the OK button and enjoy.
ouafouaf
Posts: 8
Joined: 2008-03-27 12:45:42

Post by ouafouaf »

I like what you did here. One of the best attempt I've seen so far managing an AMC online. I like the youtube part too ;p

It took me a while to adapt my amc to the PKMovie template, so I dont think I want to change now, but maybe later.

I'm looking forward to other nice features, then I'll think about using your template !

Good job :grinking:
ouafouaf
Posts: 8
Joined: 2008-03-27 12:45:42

Post by ouafouaf »

the link to the archive is dead.
wvd
Posts: 96
Joined: 2006-08-02 22:21:20
Location: Nederland

Post by wvd »

It's a pity, this looked very good
pele
Posts: 72
Joined: 2009-02-21 20:25:57

Post by pele »

hi,

HAs somebody the files?

Kr, Bianca
Iffoffo
Posts: 3
Joined: 2013-10-31 16:30:15

Post by Iffoffo »

Also the youtube part is dead.... Any update?
ouafouaf wrote:the link to the archive is dead.
Monkiros
Posts: 1
Joined: 2014-03-04 14:30:24

Post by Monkiros »

What about this update?
Movieman
Posts: 1
Joined: 2014-06-14 11:45:27

Re: Put your AMC data on the web (PHP, MySQL)

Post by Movieman »

smalltux wrote:Introduction

....
Download the following archive:

http://www.luka.in.rs/movies_i_like.tar.gz

Unpack the archive to some empty folder on your computer (folder structure must be preserved).
Dead link... :??:
alainvdv
Posts: 2
Joined: 2014-09-02 20:34:17

Post by alainvdv »

hello Luka is it possible to reput the files , so that we also can use that beautyful export tool thanks alain
Post Reply