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

0 Members and 1 Guest are viewing this topic.

Offline rick.ca

  • Global Moderator
  • *****
  • Posts: 3241
  • "I'm willing to shoot you!"
    • View Profile
Re: Sql dump from PVD
« Reply #20 on: October 17, 2008, 01:24:00 am »
Quote
The replace function is indeed case sensitive now, but I can change this behavior easily.

I'm sure if I were using this regularly, I would find occasion to want it both ways. Can you add an option, or provide two separate functions?

Offline nostra

  • Administrator
  • *****
  • Posts: 2852
    • View Profile
    • Personal Video Database
Re: Sql dump from PVD
« Reply #21 on: October 17, 2008, 01:37:53 am »
Quote
I'm sure if I were using this regularly, I would find occasion to want it both ways. Can you add an option, or provide two separate functions?

OK, no problem. There will be two replace functions.
Gentlemen, you can’t fight in here! This is the War Room!

Offline blue334

  • User
  • ***
  • Posts: 100
    • View Profile
Re: Sql dump from PVD
« Reply #22 on: October 17, 2008, 10:48:26 am »
Sounds good, thanks.
Check out PKs MovieDB dynamic web template - exported from PVD: My site

Offline blue334

  • User
  • ***
  • Posts: 100
    • View Profile
Re: Sql dump from PVD
« Reply #23 on: October 18, 2008, 07:31:25 pm »
Here are some updated files. Changes are:

- cleaned the code,
- improved instructions
- optional components: "Period" panel (see my site) and awardspace filter replacement commands.


PKs_MovieDB_modified_public.zip


Contents of current README:

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


Date 2008-10-20


1.  Unpack PKs_MovieDB_modified_public.zip

2.  Register a website at www.awardspace.com or other free host (awardspace assumed below).

3.  Create a database "yourdomain_movies" using the management tools for the site.
    Log into phpmyadmin. Run the SQL query "fields.sql" 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 with the database values.

5.  Log on to yourdomain.awardspace.com with an ftp manager
    with yourdomain:pass as credentials (PASV mode).

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

7.  Check that you can access your domain http://yourdomain.awardspace.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.

10. Start PVD

11. Export database using the sql export template (put sql.ptm in
    \Personal Video Database\Plugins\Templates first).
    Export to the directory you just created.

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

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. If your sql export file is less than about 1,700KB, your
    script is ready to go. Otherwise split file into parts no bigger than 1,700KB.
    Make sure the split files are also saved as UTF-8 NO BOM (Byte Order Mark).
    The filesize limit suggested by phpadmin (2,048KB) is too high and will fail to run.

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

18. Log on to awardspace>phpmyadmin again.

19. Import the sql script(s) into the
    database.

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

21. Reload website and you're done. Ask me if there are problems.





*MORE STUFF*



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.

Run http://yourdomain.awardspace.com/processperiod.php in your browser

In the side panel section of mdb_config.inc, enable the PERIOD panel (change FALSE to TRUE).
Also uncomment the three lines (remove peceding slashes).
Disable the YEAR panel since you don't need both.

Upload mdb_config.inc again and reload your site.

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.



AUTOMATICALLY REPLACE WORDs BLOCKED BY AWARDSPACE
Changes words/phrases that will cause problems on an awardspace site
(due to their list of blocked words and phrases).
Paste contents of "Awardspace filtered words.txt" into the OPTIONS section of sql.ptm
(e.g below the last replace)
The word list is not complete but it will remove the most common filtered words.



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.



« Last Edit: October 20, 2008, 04:29:13 pm by blue334 »
Check out PKs MovieDB dynamic web template - exported from PVD: My site

Offline JedMeister

  • Member
  • *
  • Posts: 11
    • View Profile
Re: PK's MovieDB dynamic website template
« Reply #24 on: October 21, 2008, 08:37:40 am »
WOW  :o

That is impressive! (both the web template using the db from PVD and also your db!)

I'm not 100% sure how, but I'm going to have to have a go at setting this up on my web page too!

I only came across PVD today and I am sooo impressed with it! Lots of info and friendly folks here on the forums too!

Keep up the good work blue334!

Offline blue334

  • User
  • ***
  • Posts: 100
    • View Profile
Re: PK's MovieDB dynamic website template
« Reply #25 on: October 21, 2008, 10:47:40 am »
Thanks!
Been trying out a couple of other free hosts, and I think I'll change my recommendation of awardspace to byethost. Speedwise they're as good as or better than awardspace, but in addition they give you up to three databases, more space, no filtered words (it seems) and no practical filesize limit for sql scripts. Overall a better choice if uptime is good.

Also tried zymic.com, but that was too slow.
Check out PKs MovieDB dynamic web template - exported from PVD: My site

Offline ruffa

  • User
  • ***
  • Posts: 54
    • View Profile
Re: PK's MovieDB dynamic website template
« Reply #26 on: October 24, 2008, 08:09:07 pm »
i setup a free webspace account, althought i do already have webspace but no MySQL on it, so i set a new one up as u reccomended but having big trouble trying to figure out how these mySQL work, i created a database, but it's giving me a table full of blanks which i need to fill in and im not familiar with the language they use on these database creation things in mysql. it's asking about singed and unsigned, Null, and lots of blanks i have no idea what there are all for, i managed to fill in my colum titles but it won;t save because it keeps saying this is not a number!

Any advice?

I love the website u created, just the kind of thing i've been trying to find for ages, i found lots of free web based databases but all of them are setout just like excel or similar, instead of laid out as a webpage, and this is the first time i've found one like this.

Does anyone know of a commercial product(that needs no advanced tecnical knowledge) which would setout a excel or pvd database on a website in a similar way to what your doing hear?



Offline blue334

  • User
  • ***
  • Posts: 100
    • View Profile
Re: PK's MovieDB dynamic website template
« Reply #27 on: October 25, 2008, 12:49:52 am »
Are you in phpmyadmin? It is the web-based management interface for mysql databases that every site will have. It should look something like this:



You should not be setting up anything manually in the database, it is all done by running queries on the database. The first query is done by pasting the contents of fields.sql (a plaintext file included in the .zip) into the text box shown, and hitting "GO". If you already set up something manually, you must delete it first. Hit the "Drop" tab to do this.

This sets up the database table, the basic framework or "cupboard" for your data.

I'll gladly help you with the next steps, let me know how you do with this first.
Check out PKs MovieDB dynamic web template - exported from PVD: My site

Offline ruffa

  • User
  • ***
  • Posts: 54
    • View Profile
Re: PK's MovieDB dynamic website template
« Reply #28 on: October 25, 2008, 11:59:28 am »
thanks for the reply, i am using the free webhost u suggested,bytehost, so i went to the mySQL bit and created a new database, then named a field or somehting like it explains in your instructions called Movies, but i did not get to do the mysql query as i did not get that option i think probabbly because i was using bytehost and not the other one. So it asked how many fields i wanted, i put 28, i got this number by counting the number of fields on my PVD entries, eg. movie name, description, date etc.
So thats where i got up to, any advice would be most apreciated. I am pretty knowledgable when it comes to computers, and web design etc but never used MySQL before.

Offline blue334

  • User
  • ***
  • Posts: 100
    • View Profile
Re: PK's MovieDB dynamic website template
« Reply #29 on: October 25, 2008, 03:37:10 pm »
If you're in phpmyadmin you should have no problem locating the sql query tab. The phpmyadmin interface is more or less the same regardless of host. Make sure you clicked the link shown here:


Please note that I'm not telling you to create any tables or fields manually as you seem to believe you must, but to run a query/script to do this job. This query is contained in the fields.sql file. If you already set up a table named movies, please delete it as instructed above (the "Drop" part). Then run the query from the sql tab.

If have no trouble understanding that this can be confusing, so just keep asking.

PS it is byethost, not bytehost if that is an actual service.
Check out PKs MovieDB dynamic web template - exported from PVD: My site

Offline blue334

  • User
  • ***
  • Posts: 100
    • View Profile
Re: Sql dump from PVD
« Reply #30 on: October 25, 2008, 04:46:34 pm »
I have noticed you did not include the tags/keywords in your database, is this a choice or a limitation?
 Keywords are very important to me, as they can help me find movies within a specific theme.

Got the tags working properly now! I have limited the number of tags shown on the initial page, since there can be a lot of them. The complete list is displayed on the details page.

New domain/link where these are implemented: http://www.mymoviecollection.co.cc/
EDIT: if that link doesn't work properly try: http://blue334.byethost9.com

« Last Edit: October 26, 2008, 09:08:05 pm by blue334 »
Check out PKs MovieDB dynamic web template - exported from PVD: My site

Offline ruffa

  • User
  • ***
  • Posts: 54
    • View Profile
Re: PK's MovieDB dynamic website template
« Reply #31 on: October 27, 2008, 11:53:17 am »
thanks for the reply Blue, yes i did spell the name wrong it is byethost like u said, very nice find, thnx for reccomending this.
Will try what u said and see how i get on next time. thnx for the help...

Offline ruffa

  • User
  • ***
  • Posts: 54
    • View Profile
Re: PK's MovieDB dynamic website template
« Reply #32 on: October 27, 2008, 08:57:01 pm »
I had more luck this time, i didn;t read your instructions properly first time and didn;t see that i had to copy the text for the sql query. anyway i seem to be doing ok with it now, the bit i want to ask youo about is where on your premade fields query which setup the database, it has pre done fields for title, description etc. can you tell me how does the script recognise these fileds in the database info you are importing, does it recognise the words eg. title, description? or does it go by the order you put them in?
I'm asking because my database does not have the same order as yours, or i don't want to use all the fields u have included like bitrate media format etc. so i'm wondering how this might effect things when i try to add the database info to the equation?

I'm guessing that i just need to remove the fields i don't want from the my sql database table right?
But then will i need to alter any other files?

****
I'm also noticing when i'm exporting the pvd, it exports to an excel csv file, but it is not exporting all fields, any idea why this might be? for example fields like Producer, Date Added, Length are not showing on the csv file, only these fields are importing:
Title;Original Title;Year;Genre;Country;Actors;Director;Description;   
I guess i have to configure it somehow.   
*i just noticed in the export configuration that only those selected fields mentioned where included in the export script, so i guess that explains why they only exported these, i looked at the sql export script and it includes lots more but it also includes lots that i don;t want, or don't use and don;t want showing in the final website.            


Would be very helpful if u can advise.

« Last Edit: October 27, 2008, 09:07:40 pm by ruffa »

Offline ruffa

  • User
  • ***
  • Posts: 54
    • View Profile
Re: PK's MovieDB dynamic website template
« Reply #33 on: October 27, 2008, 09:18:23 pm »
my other problem, i can;t find where pvd is saving all the posters/dvd covers! i checked the tools menu and it states a folder that doesn't exist! so im now very confused as to where pvd is saving everything, i have checked the pvd installation folder and there are no files in the posters folder either, any ideas where they may be saved or how i can find out where?

Offline ruffa

  • User
  • ***
  • Posts: 54
    • View Profile
Re: PK's MovieDB dynamic website template
« Reply #34 on: October 27, 2008, 09:34:26 pm »
In the meantime i tried to import the data i had just to see what results i got, the first error is it says
#1054 - Unknown column 'VIDEOFORMAT' in 'field list'

this i guess will be due to some of the field titles not matching the ones on the mdb_config.inc file, or something to do with that anyway! something else i did while the database was created using the sql query, i deleted the fields that i didn't want to use form the database, this would have incluided the VIDEOFORMAT it mentions above, so maybe i get the error because the mdb_config.inc file is telling it to put this in ??

So i went to check that i could view the index.php file on my website which i had forget to do earlier and i cannot view it for some reason, it says 'cannot access XXX database with XXXX(my username) login, why it says that i have no idea, any suggestions?

hope im not hijacking this thread with my problems... :-\
« Last Edit: October 27, 2008, 09:38:31 pm by ruffa »

Offline blue334

  • User
  • ***
  • Posts: 100
    • View Profile
Re: PK's MovieDB dynamic website template
« Reply #35 on: October 27, 2008, 10:46:21 pm »
You shouldn't delete fields from the database, it just adds more trouble. You may not need that data, but other files assume it is there at least as a blank value. It really doesn't matter if those fields are in the database, and stuff you don't want displayed you just comment out in the html files (.tpl files). But don't worry about that now, try getting your page up first.

Next, forget about exporting csv, it is not relevant to this. What you are exporting is sql script files with a .sql extension. If you haven't already you must copy the sql.ptm file to the ..\Personal Video Database\Plugins\Templates directory. That will make it appear as an option in the export dialog pulldown menu. Before exporting, you must make a subdirectory named "images" in the folder where you plan on saving the sql file. If you don't images won't go anywhere probably.

NB! After you have successfully created a file with .sql extension this goes into the database the same way the fields.sql file does. But in this case the file will be much bigger, so it will not be practical/possible to paste its content in the sql query area in phpmyadmin. Instead you should go to the IMPORT tab, where there is an option to select the file from your hd and run it directly.

The database connection problem you experience is due to wrong credentials or other info in mdb_config.inc
Since you're with byethost, it should look somewhat similar to this:

$this->config['mysql']['server']    = "sql207.byethost9.com";
$this->config['mysql']['username']  = "b9_2508518";
$this->config['mysql']['password']  = "mypass";
$this->config['mysql']['database']  = "b9_2508518_movies";
$this->config['mysql']['table']     = "movies";


Since you deleted fields in the database you must delete/drop it completely and run the fields.sql query again.
Check out PKs MovieDB dynamic web template - exported from PVD: My site

Offline JedMeister

  • Member
  • *
  • Posts: 11
    • View Profile
Re: Sql dump from PVD
« Reply #36 on: October 28, 2008, 01:10:56 am »
New domain/link where these are implemented: http://www.mymoviecollection.co.cc/
EDIT: if that link doesn't work properly try: http://blue334.byethost9.com
bottom link appears to be broken, currently redirecting to here: http://php0h.com/hosting-blog6/index.php with the message "YOU ARE VIEWING THE OLD WEBSITE PLEASE WAIT WHILE YOU ARE REDIRECTED". Not sure what that's about?!?

Offline blue334

  • User
  • ***
  • Posts: 100
    • View Profile
Re: PK's MovieDB dynamic website template
« Reply #37 on: October 28, 2008, 08:28:25 am »
Every free host has its nags - they need one way or another to make a revenue. I don't yet know how much of an issue this will be, but both my domains at byethost have had downtime of about 24h during which they redirect to ads. It is basically the same as the aforementioned blocked words at awardspace, where you get redirected to their front page (where they sell commercial hosting packages).
If one wants free hosting, its only a matter of choosing the lesser evil. I don't want forced ads on my site, and I didn't much like the awardspace thing with blocked words. If byethost is still the best choice remains to be seen, depends on the frequency of these programmed downtimes.
Check out PKs MovieDB dynamic web template - exported from PVD: My site

Offline ruffa

  • User
  • ***
  • Posts: 54
    • View Profile
Re: PK's MovieDB dynamic website template
« Reply #38 on: October 28, 2008, 09:29:10 am »
Next, forget about exporting csv, it is not relevant to this. What you are exporting is sql script files with a .sql extension. If you haven't already you must copy the sql.ptm file to the ..\Personal Video Database\Plugins\Templates directory. DONE THIS OK That will make it appear as an option in the export dialog pulldown menu. Before exporting, you must make a subdirectory named "images" in the folder where you plan on saving the sql file DONE THIS AND I NOW SEE THE IMAGES ARE IN THERE. If you don't images won't go anywhere probably.

NB! After you have successfully created a file with .sql extension this goes into the database the same way the fields.sql file does DONE. But in this case the file will be much bigger, so it will not be practical/possible to paste its content in the sql query area in phpmyadmin. Instead you should go to the IMPORT tab, where there is an option to select the file from your hd and run it directly.

The database connection problem you experience is due to wrong credentials or other info in mdb_config.inc
Since you're with byethost, it should look somewhat similar to this:

$this->config['mysql']['server']    = "sql207.byethost9.com";
$this->config['mysql']['username']  = "b9_2508518";
$this->config['mysql']['password']  = "mypass";
$this->config['mysql']['database']  = "b9_2508518_movies";
$this->config['mysql']['table']     = "movies";


Since you deleted fields in the database you must delete/drop it completely and run the fields.sql query again.


Thanks for your help, i will redo the sql query and redo the database and redo the mdb config file, i think it's this that might be causing problems, u know the info u gave as an example of what it should look like, is this the only thing i should be changing? i altered a few more things on that file.

But even if the mdb config file was wrong, shoulkdn;t i have seen somehting when i tried to access the index.php file? i will redo it and see how i go this time.
Thanks again for all this help


Offline ruffa

  • User
  • ***
  • Posts: 54
    • View Profile
Re: PK's MovieDB dynamic website template
« Reply #39 on: October 28, 2008, 10:05:23 am »
I got the config file sorted now, i had the wrong password so i can now see the index.php ok. I made the new database in mysql etc.
but the problem i now have is when i try to import the .sql file it gives an error, it says 'Duplicate' i should have copied it for u to see but it highlighted the field YEAR and mentioned a duplicate in the database which gave an error. Any ideas what might be causing this?

I did change the way my pc shows the date, althought i only had the option to change the 'short date' as it says in windows options.
In PVD i actually do the dates liked: 21st Oct.2008 or 21/10/08  it changes.