Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - blue334

Pages: 1 [2]
21
Development / Re: PK's MovieDB dynamic website template
« on: October 28, 2008, 11:54:29 am »
My first thought would be that the database table is not empty, thus giving a duplicate error. But if you're sure it contains no data could you post a couple of lines from the sql file? Maybe I can spot something wrong.

You could also try to run just a couple of lines from the sql file, to narrow down the problem.


22
Development / Re: PK's MovieDB dynamic website template
« 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.

23
Development / Re: PK's MovieDB dynamic website template
« 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.

24
Development / Re: Sql dump from PVD
« 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


25
Development / Re: PK's MovieDB dynamic website template
« 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.

26
Development / Re: PK's MovieDB dynamic website template
« 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.

27
Development / Re: PK's MovieDB dynamic website template
« 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.

28
Development / Re: Sql dump from PVD
« 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.




29
Development / Re: Sql dump from PVD
« on: October 17, 2008, 10:48:26 am »
Sounds good, thanks.

30
Development / Re: Sql dump from PVD
« on: October 16, 2008, 02:26:00 pm »
Another question: I mentioned in my top post that my free host awardspace.com have a list of filtered words/phrases. If a page rendered contain any of these words/phrases, you are redirected to their homepage. This is quite annoying, but I can understand why a free service has to discourage commercial/phishing/porn sites on their servers. Unfortunately, in imdb movie descriptions these words and phrases will pop up occasionally.

Several of these words/phrases are known, and I want to make automatic string replacement of filtered words an optional addition to the export template. The only problem is the replace function is case sensitive, meaning replace="fake id<->f ake id" works, but not if it contains uppercase (Fake ID, Fake id, Fake Id etc.).

Provided it is possible to change this, would it matter to other uses of the replace function if it was made case insensitive?

31
Development / Re: Sql dump from PVD
« on: October 15, 2008, 06:47:43 pm »
The credits sorting is a problem with my database, not with the template. It was probably caused by the AMC import plugin (only imported records have the problem).

I suppose your method would make it possible to rename image files, but it may not be worth the hassle in my case. Uploading the full set of image files with every update may be time-consuming, but fortunately only for my ftp client.

32
Development / Re: Sql dump from PVD
« on: October 14, 2008, 09:44:05 pm »
Added the suggested fields in a separate section, no custom fields had to be used fortunately. Further comments and suggestions welcome. Will tidy up code and readme file before I upload a new set of files.

http://blue334.awardspace.com/ as before. You will notice I don't use date viewed, user rating or personal comments myself (yet).

One question: is it possible (by some magic) to name poster images by movie id instead of number increment? This would make it easier to do smaller updates to the website, because image paths would be statically linked with an entry in PVD. If I now delete an entry in PVD I get new links to most or all images, meaning I have to upload all 3,000+ again.

EDIT: Notice the new "Sort by" options in the pulldown menu.

33
Development / Re: Sql dump from PVD
« on: October 11, 2008, 10:48:31 pm »
You're right about comments. The reason I thought they were imported is that my database is full of imdb user comments in that field, but those entries (about 70% of my database) come from AMC import. I hadn't really noticed the difference.

34
Development / Re: Sql dump from PVD
« on: October 11, 2008, 09:41:00 pm »
Indeed there is.. hadn't noticed since I'm using that field as a generic checkbox for other purposes. My movies are batch-added as seen by default, but that doesn't set a date value. Then I tick them as unseen when I'm done adding the media info.

35
Development / Re: Sql dump from PVD
« on: October 11, 2008, 08:24:15 pm »
I'll consider what you suggest, seems like good ideas. The existing comment field would be impractical, since that is already used in a default imdb import. A custom field would be better, provided it can be exported by the export plugin.
Date viewed could also be made a custom field I suppose, if it can be exported it could be grouped in a separate section with user rating and comments.

36
Development / Re: Sql dump from PVD
« on: October 10, 2008, 01:04:25 pm »
I managed to add the tags, but unfortunately they choke the server. Too much information to handle for the php parser presumably. They may work with smaller databases than mine, or more powerful webservers.

37
Development / Re: Sql dump from PVD
« on: October 10, 2008, 08:25:50 am »
The reason for missing keywords is that AMC doesn't use/import them, so they were never part of the original template. I could try to add them, shouldn't be difficult.

38
Development / Re: Sql dump from PVD
« on: October 08, 2008, 07:44:44 pm »
Deleted.

See later post.

39
Development / Re: Sql dump from PVD
« on: October 08, 2008, 04:47:50 pm »
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

40
Development / PK's MovieDB dynamic website template
« on: October 08, 2008, 09:06:39 am »
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.


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.

Pages: 1 [2]
anything