English > Development
PK's MovieDB dynamic website template
omega42:
Blue, hope u can help
I've been trying to get ur script to work but when i export using the sql script the file only gives me the following
INSERT INTO movies (NUM, RIPPER, DATEADDED, IMDBRATING, ORATING, RATING, ORIGTITLE, TITLE, DIRECTOR, PRODUCER, COUNTRY, GENRE, YEAR, LENGTH, ACTORS, URL, DESCRIPTION, COMMENTS, VIDEOCODEC, VIDEOBITRATE, AUDIOCODEC, AUDIOBITRATE, RESOLUTION, FRAMERATE, SUBS, SIZE, VIEWDATE, TAGS, POSTER) VALUES ('0', '', '{%value=dateadded}', '{%value=imdbrating}', '{%value=orating}', '{%value=rating}', '{%value=origtitle}', '{%value=title}', '{%value=directors}', '{%value=producers}', '{%value=country}', '{%value=genre}', '{%value=year}', '{%value=length}', '{%value=actors template="pk_actors.ptm" params="full"}', '{%value=url}', '{%value=description}', '{%value=comment}', '{%value=videocodec}', '{%value=videobitrate}', '{%value=astreams template="pk_audiocodec.ptm"}', '{%value=astreams template="pk_audiobitrate.ptm"}', '{%value=resolution}', '{%value=framerate}', '{%value=subs}', '{%value=size}', '{%value=viewdate}', '{%value=tags}', '{%value=poster}');
etc...
It doesn't actually output any information
I'm using pkdb for 0.9.9.8 - website files & templates - sql scripts
The program is v 0.9.9.8
blue334:
Hi
Try deleting [RIPPER,] and ['{%value=Ripper custom="true"}',] in the pk_sql.ptm file.
RIPPER is a custom field in my database.
jwilpolt:
I thought I had done everything correct but when I try to access the PVD from the web I get this error;
* @copyright Copyright © 2006-2007, Michael Shepanski * @package PK-Designs * @version Version 1.0 (2007.01.06) * =============================================================================================== */ require_once('mdb3.php'); $moviedb = new MDB3(); ?>
get_html(); ?>
Hope you can help me with where I went wrong..
thanks
Jay
b_sleeth:
Thank you VERY much for an excellent script and documentation.
Rather than using the "processperiod.php" script, perhaps the following SQL statement would be more beneficial:
--- Code: ---UPDATE movies a SET a.PERIOD = CASE
WHEN a.YEAR >= 2050 THEN '2050-9999' WHEN a.YEAR >= 2045 THEN '2045-2049'
WHEN a.YEAR >= 2040 THEN '2040-2044' WHEN a.YEAR >= 2035 THEN '2035-2039'
WHEN a.YEAR >= 2030 THEN '2030-2034' WHEN a.YEAR >= 2025 THEN '2025-2029'
WHEN a.YEAR >= 2020 THEN '2020-2024' WHEN a.YEAR >= 2015 THEN '2015-2019'
WHEN a.YEAR >= 2010 THEN '2010-2014' WHEN a.YEAR >= 2005 THEN '2005-2009'
WHEN a.YEAR >= 2000 THEN '2000-2004' WHEN a.YEAR >= 1990 THEN '1990-1999'
WHEN a.YEAR >= 1980 THEN '1980-1989' WHEN a.YEAR >= 1970 THEN '1970-1979'
WHEN a.YEAR >= 1960 THEN '1960-1969' WHEN a.YEAR >= 1950 THEN '1950-1959'
WHEN a.YEAR >= 1940 THEN '1940-1949' WHEN a.YEAR >= 1930 THEN '1930-1939'
WHEN a.YEAR >= 1888 THEN '1888-1889' ELSE 'Unknown' END;
--- End code ---
The statement assumes the PERIOD column has already been added to the database. So, one should add the column ("PERIOD VARCHAR(15)") to the table creation script prior to creating the table, or manually alter the table by adding the column.
Also note that I changed the period descriptions slightly so as to not create overlapping descriptions. For example, the original php script creates periods 1930-1940 and 1940-1950. Using these descriptions, one is not sure if the year 1940 is in 1930-1940 or 1940-1950. The period descriptions above will create the periods as 1930-1939 and 1940-1949; which clearly shows that 1940 is part of the 1940-1949 period.
One other note. If the records in the movie table are deleted prior to importing, there is no need to drop and re-add the table. Adding the following SQL statement to the top of the export script will accomplish this:
--- Code: ---DELETE FROM movies;
--- End code ---
With all of this in mind, I have attached an updated export script that adds the delete and update statements in the appropriate spots. When used as the export template from PVD, the resulting SQL script file can be used to delete all existing records in the movies table, add all of the exported movies from PVD, and finally set the PERIOD on all of the imported records. Of course, your previous comments of removing all occurrences of "images/" and ensuring a valid format for the date columns in the SQL script file prior to running it are still applicable.
[attachment deleted by admin]
b_sleeth:
Once again, thank you for this great template.
In your instructions, you mention resizing images to 200px. In the CSS, the images will be forced to 200x284 dimension. Of course, this will cause images that are not in a 200x284 aspect ration to be squashed or stretched.
I ended up resizing my images to a maximum of Width=200px and a maximum height of 284px. I use ImageMagick's command line tool "mogrify.exe". Basically, the command line is:
--- Code: ---mogrify -resize "200x284" *.jpg
--- End code ---
Rather than monkeying with the CSS, I then changed the poster HTML IMG tags to include a style="width:auto;height:auto;". I believe this allows the intent of bounding the display to 200x284 (as the images have already been re-sized), while preserving the image's original aspect ratio.
Thank you again for sharing this template.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version