English > Development

PK's MovieDB dynamic website template

(1/17) > >>

blue334:
Hi,
I managed to write an sql export template for PVD, which seems to work fine for my use.
The php website template I'm using is a modified version of PK's MovieDB, originally written for Ant's Movie Catalog. Since AMC and PVD use similar fields, I had no problem filling the corresponding fields.

I had a few minor issues:
- %value=43 (Audio Codec) returns nothing, I reckon this is a bug in PVD
- Not sure how to replace existing ['] (as in won't) with [''] in options (this is necessary since 's are used as value delimiters in a sql script).
When putting replace="'<->''" in options I end up with four ''''. It is easily fixed using search/replace though.


Compared to the original unmodified template for PK's MovieDB I use more fields (technical details mostly). Imdb ratings are also handled differently. I use the ripper's tag for the Media Label field (showing as "Version" on the website). I also don't use large images, so I took out some code to resize images.


Here is my database as exported from PVD:
http://blue334.awardspace.com

If you hit a page that throws you out, that just means it contains a word in the host's filter list. I'm trying to work out a complete list of filtered words.Here is my database as exported from PVD:
http://blue334.awardspace.com

If you hit a page that throws you out, that just means it contains a word in the host's filter list. I'm trying to work out a complete list of filtered words.



--- Quote ---PK's MovieBD dynamic website template.
Modified and adapted for Personal Video Database (PVD).


Date 2009-05-31


1.  Unpack the first .zip file to an empty folder

2.  Register a website at www.byethost.com or other free host.

3.  Create a database "yourdomain_movies" using the management tools for the site.
    Log into phpmyadmin. Run the SQL query "fields.sql" (included in the secon zip file)
    to create a table "movies" with the necessary fields. Check that the structure looks
   ok afterwards. Take note of servername, your credentials, the database name and the table name.
   
4.  Edit mdb_config.inc in the first file with the database values.

5.  Log on to the domain with an ftp manager.

6.  Where the dummy index.html file resides, upload contents
    of the first zip file (including the modified mdb_config.inc)

7.  Check that you can access your domain http://yourdomain.blahblah.com/index.php

8.  On your local computer, create a directory for export.
    Create a subdirectory "images" for pictures export.

9.  PVD uses system settings to format dates. The website template assumes sortable
    date format YYYY-MM-DD for date entries. If your regional settings are
    different, change them in Control Panel>Regional Settings temporarily.

    An alternative method to fix wrongly formatted dates is regular expressions.
   Notepad++ supports search-replace using regexp.
   Example to convert dates formatted as 26.06.2007 to 2007-06-26:
   Find ([^0-9])([0123][0-9])\.([01][0-9])\.([1-2][0-9][0-9][0-9])([^0-9])
    Replace with \1\4-\3-\2\5
   The regexp method applies to the finished output file in [11]
   
10. Start PVD

11. Export database using the sql export template pk_sql.ptm (put this and all other
    files with .ptm extension in \Personal Video Database\Plugins\Templates first).
    Export to the directory you created in [7].

12. Open the file in notepad++ or similar editor that will save UTF-8 NO BOM format.

13. Search-Replace all instances of [''''] with ['']

14. Search-Remove all instances of [images/]

15. If you have poster images of multiple formats, search-replace all
    non-jpg extensions in the textfile to .jpg (e.g. .png, .gif, .jpeg).

16. Format file as UTF-8 NO BOM and save.

17. Resize/convert images to jpg W=200px using a batch tool (e.g. Xnview, Faststone)

18. Log on to phpmyadmin again.

19. Import the sql script into the
    database.

20. Upload the resized images to the resource folder using your ftp file manager.

21. Run http://yourdomain.blahblah.com/processperiod.php

22. Enter website and you're done. Ask me if there are problems.


*MORE*

UPDATING THE SITE
When updating drop the entire table in phpmyadmin and run the fields.sql query again.

ENABLING THE "PERIOD" SIDE PANEL.
The Period panel groups years into periods, which is much better than individual years if you
have many older movies. This requires a separate php script to be run AFTER you're
done uploading your database, ref. [21] above.

If you perform an update on your site you must run processperiod.php again.
Thanks to ty3001 at the AMC forums for the processperiod.php script.

PERSONALIZATION
You probably want to change the logo. It is located in templates\default\images
To change the color scheme, just edit the stylesheet. Some gif files
in the logo folder will have to be modified as well.

BEFORE YOU START
This is a basic step-by-step method for getting your database online.
A few things will not work out of the box, like custom fields.
The example files require the presence of a custom field "Ripper" which must be edited out.
It has been kept in as an example only.
The example also require unique indexes for each movie entry. It is possible to work around this.


--- End quote ---

All required files uploaded 2009-05-31:
http://www.mediafire.com/file/mdmzyztym4n/pkdb for 0.9.9.8 - website files.zip
http://www.mediafire.com/file/z2dmwgmmhjg/templates -  sql scripts.zip

Example site in my sig.

rick.ca:

--- Quote ---Here is my database as exported from PVD
--- End quote ---

Wow! That's impressive. :o  I don't know anything about setting up websites, but I'll ask what others are bound to... Are you able to share the website template? And with that, would a novice be able to do this? This would be a great solution for those who have asked how to display their database on a website.

blue334:
A novice with a little bit of patience can do this, that's who I am. It is not really difficult, but since a database backend is required, there are a number of possible problems if you're new to it (sql scripts being rejected for various reasons, codepage issues are the most troublesome)

I tried a couple of other free hosts without success before awardspace. You may want to read the thread over at the AMC forum to see what hosts people are using.

I'll gladly make available my modified template, but be aware that I'm no php programmer and what changes I've made are ad hoc, ugly and undocumented.

There are other dynamic website templates available for AMC, my sql template is proof of concept that these should also work with PVB

blue334:
Deleted.

See later post.

nostra:
Very cool, blue. Thanks for your contribution.
I'll consider adding the export template and maybe some additional automation to make the process easier.

Navigation

[0] Message Index

[#] Next page

Go to full version