Author Topic: PK's MovieDB dynamic website template  (Read 143033 times)

0 Members and 1 Guest are viewing this topic.

Offline blue334

  • User
  • ***
  • Posts: 100
    • View Profile
Re: PK's MovieDB dynamic website template
« Reply #60 on: May 31, 2009, 05:14:42 pm »
Since we have a release now I have some updated files. Also made some changes, like bigger posters.
Link to my site based on these files is in my sig.


Needed files:
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

The files are just proof of concept and will have to be adapted for other databases. Ask me if you decide to try.


EDIT: Updated first post with a step-by-step description and the new files
« Last Edit: May 31, 2009, 09:37:23 pm by blue334 »
Check out PKs MovieDB dynamic web template - exported from PVD: My site

Offline rick.ca

  • Global Moderator
  • *****
  • Posts: 3241
  • "I'm willing to shoot you!"
    • View Profile
Re: PK's MovieDB dynamic website template
« Reply #61 on: May 31, 2009, 08:06:18 pm »
Very impressive! 8)

A few suggestions...

Suppress list items when count is 0.

This update is confusing to the newcomer. It seems this is an update to an original set of files—but where are they? The best practise is to always update the first message in the topic with the current release. I don't think it would hurt to delete the original text of your first message and turn it into a "latest release" message. You can still post an update for existing users here, but also link back to the original message for those needing a "full install."

Offline blue334

  • User
  • ***
  • Posts: 100
    • View Profile
Re: PK's MovieDB dynamic website template
« Reply #62 on: May 31, 2009, 09:50:16 pm »
Fixed the first post so the thread is a little more welcoming.

About suppressing items, that may be difficult though I see your point. The left side panels do have a "threshold value", but that only applies to the unfiltered selection.
Check out PKs MovieDB dynamic web template - exported from PVD: My site

Offline ouafouaf

  • Member
  • *
  • Posts: 21
    • View Profile
Re: PK's MovieDB dynamic website template
« Reply #63 on: June 21, 2009, 11:55:33 am »
hello.

Following a wise advice, i decided to move from AMC to PVD today.
I've been using AMC for quite some years now, and using your template.
As you probably know, some people are still working on improving your template over there too, and I did make some changes for my personal use too.

My worst regret about leaving AMC was to be unable to adapt my template (as Im really bad with php), but then I found your thread here.
I thought you disappeared, but you just moved to here :)

So, anyway, thanks a lot for your work, I can keep using PK MovieDB !! Also, I realize that the changes made on the template are very similar to the changes I made myself, so your version is pretty much what Im looking for.

Just a little question. Do you plan on adding pages for people ? That would be awesome too. Probably quite a lot of work, but I believe in you  ;D

Offline ouafouaf

  • Member
  • *
  • Posts: 21
    • View Profile
Re: PK's MovieDB dynamic website template
« Reply #64 on: June 21, 2009, 02:48:05 pm »
I have a couple of questions:

1) About characters encoding.
I don't know much about char encodes, so forgive me.
I need to include foreign characters to my DB, mostly east asian (chinese, japanese). As you know, AMC was not friendly with those so I had to enter unicodes in the database so that the characters show up in your template.
Now, I see I will have to do changes in the charset to make your template work fine, will it be ok for east asian chars ?

2) Countries
Someone in AMC forums made some changes in your script so that multiple countries can me supported better.
I see your script still doesnt do that, neither in the menu or in the movie details.
I don't want to have "France, Italy" or "USA, UK" in my menu, i prefer that my movies enter both category separatly.
Is it possible to change that ? I see your menu has both "France, Italy" and "Italy, France", I suppose it annoys you too :)
In the details, it's not as big a problem, but if countries were not grouped, that would be better too.

3) Fields
Could you possibly list all the fields you are using for your script in here ?
I'm willing to start my list from scrap (because my amc database as a lot of problems imo), and I would like to start it with the same pattern as yours :)

THANK YOU VERY VERY MUCH (oops caplocks)
btw, i just saw the support of tags, it's very nice too.

Offline blue334

  • User
  • ***
  • Posts: 100
    • View Profile
Re: PK's MovieDB dynamic website template
« Reply #65 on: June 21, 2009, 05:48:19 pm »
Hi,

About you first post, I'm unsure whether you think I'm the original author of the PK template - I'm not. Just this modified version and one earlier version for AMC (of course you could be referring to the latter as the one you've been using).

1) I've never had to deal with asian characters, but I have no trouble with special characters from e.g. Turkish or Icelandic. Just make sure the exported sql file is saved as unicode, and that the database is also unicode.
Or are you referring to text in the template itself, like headers?

2) I've only recently noticed this as a problem, I don't think it used to be like that. Maybe something changed at imdb lately? It is certainly annoying, and I will try to dig up the fix from the AMC thread.

3) I currently use only one custom field, "Ripper". Refers to the ripper tag of course. All the fields actually used by the template are listed in the "Fields.sql" file in one of the zip files.


About the people pages suggestion, would that be something similar to people view in pvd?
I should say that I actually suck at php coding too. I'm not alienated by it though so I can usually make minor changes or fixes. Not sure I will be able to code new functionality from scratch though.


Check out PKs MovieDB dynamic web template - exported from PVD: My site

Offline ouafouaf

  • Member
  • *
  • Posts: 21
    • View Profile
Re: PK's MovieDB dynamic website template
« Reply #66 on: June 21, 2009, 06:03:21 pm »
thank you for your fast answer. I DID think you were the original author :)

My AMC database has about 1800 entries, but I have some problems with the content, and Im starting a complete new database. It might take a while, but I don't get much sleep anyway :P

I hope you will correct the problem with the countries.

I also hope (yeah I know, i ask a lot, but it is just suggestions), that you will include screenshots in your next version.

That's a great work you're doing, Im sure a lot of people is following your work :)

« Last Edit: June 21, 2009, 06:05:06 pm by ouafouaf »

Offline rick.ca

  • Global Moderator
  • *****
  • Posts: 3241
  • "I'm willing to shoot you!"
    • View Profile
Re: PK's MovieDB dynamic website template
« Reply #67 on: June 21, 2009, 10:47:47 pm »
Quote
My AMC database has about 1800 entries, but I have some problems with the content, and Im starting a complete new database. It might take a while, but I don't get much sleep anyway Tongue

In case you're not aware... there's an AMC import plugin. You should be able to import just the parts you don't have a problem with—or at least the titles and years if you're planning to rebuild your database.

Offline kri kri

  • User
  • ***
  • Posts: 35
    • View Profile
Re: PK's MovieDB dynamic website template
« Reply #68 on: June 22, 2009, 05:29:18 am »
If I have a Windows Home Server box, how hard would it be to set this up?

Offline blue334

  • User
  • ***
  • Posts: 100
    • View Profile
Re: PK's MovieDB dynamic website template
« Reply #69 on: June 22, 2009, 04:20:00 pm »
That depends, if you have apache+mysql+php running on your server and know what these do, you shouldn't have too much trouble. I think my description is pretty thorough.


The files I've made available is my unedited template, it won't work perfectly out of the box since your PVD database most probably isn't structured excactly like mine. Be prepared for a little work correcting for those differences.


Check out PKs MovieDB dynamic web template - exported from PVD: My site

Offline omega42

  • Member
  • *
  • Posts: 1
    • View Profile
Re: PK's MovieDB dynamic website template
« Reply #70 on: September 03, 2009, 02:19:28 am »
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
« Last Edit: September 03, 2009, 07:08:24 pm by rick.ca »

Offline blue334

  • User
  • ***
  • Posts: 100
    • View Profile
Re: PK's MovieDB dynamic website template
« Reply #71 on: September 03, 2009, 05:55:17 pm »
Hi

Try deleting [RIPPER,] and  ['{%value=Ripper custom="true"}',] in the pk_sql.ptm file.
RIPPER is a custom field in my database.
Check out PKs MovieDB dynamic web template - exported from PVD: My site

Offline jwilpolt

  • Member
  • *
  • Posts: 1
    • View Profile
web template cant connect
« Reply #72 on: December 21, 2009, 08:24:26 pm »
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

Offline b_sleeth

  • Member
  • *
  • Posts: 7
    • View Profile
Re: PK's MovieDB dynamic website template - Updated Export ptm Script
« Reply #73 on: February 23, 2010, 07:37:41 pm »
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: [Select]
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;

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: [Select]
DELETE FROM movies;
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]

Offline b_sleeth

  • Member
  • *
  • Posts: 7
    • View Profile
Resize Images to 200x248 and Change HTML to Auto Width/Height
« Reply #74 on: February 26, 2010, 02:23:51 am »
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: [Select]
mogrify -resize "200x284" *.jpg
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.

Offline botez

  • Member
  • *
  • Posts: 8
    • View Profile
Re: PK's MovieDB dynamic website template
« Reply #75 on: August 06, 2010, 01:05:55 am »
I've been messing with this script once again (http://botez.byethost9.com/index.php) and am trying to find a way to sort by last names for fields like Director, Actor, etc.  Currently, you can only sort by the first letter of the first name.

I figure there has to be a way to do this, either via a SQL command on the existing database or some kind of regular expression on the export out of PVD.  Or perhaps it all has to be done in the PHP, like the "period" function from a few posts above.

Does anyone have any ideas on this?

mgpw4me@yahoo.com

  • Guest
Re: PK's MovieDB dynamic website template
« Reply #76 on: August 06, 2010, 03:59:14 am »
It will be difficult to sort by last name when the database keeps the entire name in a single field.  Without first separating surnames from given names manually, you can't really tell where the last name starts.  There's also an issue with groups of people (bands, comedy groups, whatever) being listed in the database.

Examples follow:

Lee Van Cleef
Anthony Michael Frederick
Miou-Miou
Bjork
4 Out of 5 Doctors (a band)
Ana Lúcia da Rocha Franco

Offline botez

  • Member
  • *
  • Posts: 8
    • View Profile
Re: PK's MovieDB dynamic website template
« Reply #77 on: August 06, 2010, 06:25:16 pm »
Thanks mgpw4me.  That makes perfect sense.  I'll just let that one go for now :)

Two other things I'd love to get some tips on, both regarding side panels:

1) First off, I want to get them to sort by count, instead of by name.  Thus a director panel would be ordered by number of movies in my database instead of alphabetically.  I swear this should be a simple tweak of the panel template code and how the keys/values are sorted, but I've yet to be able to get it to work.

EDIT: I finally figured this one out -- needed to edit the mdp_panel.inc and change the following line in the sort_categories function:

        $keys = array_keys($categories);
        sort($categories);

to

        ksort($categories);
        arsort($categories);
        $keys = array_keys($categories);

I then create a second function and a second class that allows the panel to be sorted this way.  Yippee.

2) When you select a subset of data, say showing all the films that have the genre of "horror", the side panel for directors stays with the same set of names that it has for the entire movie collection.  So, if I have 10 James Cameron films in my database and then select "horror", instead of showing me the directors with the most horror movies, it would just keep Cameron on there with a "0" next to his name, since he has no horror movies.  You can click on my database if this makes no sense (http://botez.byethost9.com/index.php?genre=Horror) to see what I'm talking about.

I'd like to find a way to be able to get the side panel to update when you drill down into genres/years/etc.

Thanks for any help anyone can provide.
« Last Edit: August 06, 2010, 06:59:20 pm by botez »

Offline afrocuban

  • Moderator
  • *****
  • Posts: 476
    • View Profile
Re: PK's MovieDB dynamic website template
« Reply #78 on: December 20, 2023, 08:54:41 pm »
How we can block guests? We have spam here.

Offline Ivek23

  • Global Moderator
  • *****
  • Posts: 2713
    • View Profile
Re: PK's MovieDB dynamic website template
« Reply #79 on: December 20, 2023, 10:36:53 pm »
How we can block guests? We have spam here.

Thanks for the warning, I didn't see it, I would have removed it earlier, so I removed it now. Obviously, as an admin, I will have to disable guests from continuing to post on the forum.
« Last Edit: December 20, 2023, 10:38:50 pm by Ivek23 »
Ivek23
Win 10 64bit (32bit)   PVD v0.9.9.21, PVD v1.0.2.7, PVD v1.0.2.7 + MOD