Personal Video Database

English => Development => Scripts and Templates => Topic started by: svenne on April 01, 2010, 03:18:03 pm

Title: Export template: HTML List (English + German)
Post by: svenne on April 01, 2010, 03:18:03 pm
I'd like to contribute an export template. It generates a HTML-list (an unordered list with some details) and is formatted via style sheets (HTML and CSS both stored in one file). The print styles differ from screen styles: different margins, smaller font, white background, black font color, font face is changed to "Calibri" (in screen view it's "Helvetica"). If either of them is not installed on your PC, the style switches to "Verdana" or to the standard sans-serif font selected in your browser.
The styles are W3C-compliant and should render fine with any modern browser, with older ones it might look crappy or even be unreadable. I tested them with Firefox 3.6 and IE 7 only.
Hope, someone will like it...

The first template is in English, the second one is in German.

----> You'll find the newest templates here (http://www.videodb.info/forum_en/index.php/topic,1844.msg18507.html#msg18507)
Title: Re: Export template: HTML List (English + German)
Post by: rick.ca on April 01, 2010, 08:35:15 pm
Thanks! It's nice that the print style is included. Just curious...Is it possible for that to print each movie on a separate page?
Title: Re: Export template: HTML List (English + German)
Post by: svenne on April 01, 2010, 11:47:05 pm
Yes, print styles in general are a nice invention...  ;)
By the way, the print style already tells browsers to insert page-breaks only between list entries, so that a movie entry should not be split up over two pages if possible, but unfortunately only Opera implemented this CSS 2.0 standard feature till today.  ::)

But to print every movie on a new page is easy to achieve and works with most (up to date versions of) common browsers:
li.movie {page-break-after:always;}
should do the trick.
Title: Re: Export template: HTML List (English + German)
Post by: rick.ca on April 02, 2010, 12:02:43 am
Perfect! You're now our official HTML exportmeister. Congrats. ;)
Title: Re: Export template: HTML List (English + German)
Post by: svenne on April 02, 2010, 12:24:38 am
Great!!   :) So, there are some things I need for my new working position, here's my wishlist...  ;) ok, only one wish to start with: I would really like to be able to export the film duration in seconds. Other apps I tested or worked with for some while want to have the duration in seconds for CSV-fileimport. It is always nice to know that you have the possibility to switch back to your old application. It makes it so much easier (emotionally ;) ) to give Personal Video Database a try...
Title: Re: Export template: HTML List (English + German)
Post by: rick.ca on April 02, 2010, 03:10:01 am
Quote
I would really like to be able to export the film duration in seconds.

As I indicated here (http://www.videodb.info/forum_en/index.php?topic=1843.msg8913#msg8913), this is unlikely possible. Maybe just as well...it saves me from explaining your position has no perks and is largely thankless. And you're not allowed to resign without a 2/3 majority of the membership. 8)

Although I'm not sure what they want or why, I'm hoping you might come up with a set of templates that would satisfy the somewhat regular request for some sort of print facility. ;)
Title: Re: Export template: HTML List (English + German)
Post by: svenne on April 02, 2010, 12:55:39 pm
Every value that can be exported can be formatted for printing with HTML and CSS. The result would only be limited by the printing capabilities of the browser. Within the CSS you can even assign fixed font sizes in "pt" (point), just as it is done in Word, for example.

There is another possibility that might work out even better: I could try to write export templates for rich text files (.rtf). Did something similar few years ago.

Rich text is some kind of markup language, just like HTML, but more cryptic. Though the file format once was introduced by Microsoft, it's been there for decades now and every word processor I came across would open RTF-files with ease. It's not limited to Windows systems. The format is common to Mac- and Linux-applications, too. So anyone could open their exported movie details, movie lists, or whatever, with their standard word processor. RTF-files are already assigned to the standard word processor in most cases by default, so (double)click the RTF-file and it shows up. Then you can apply some changes to the content if you want to and just print it.
Title: Re: Export template: HTML List (English + German)
Post by: buah on April 02, 2010, 03:07:11 pm
Really nice work svenne! I'm wondering could it be possible to make HTML export to looks just like PVD classic skin (with left and right frame)?
Title: Re: Export template: HTML List (English + German)
Post by: rick.ca on April 03, 2010, 07:05:53 am
Quote
I could try to write export templates for rich text files

That's an interesting idea, but can those also be displayed in a browser? Some users want that (for a variety of reasons), while others want something they can print. It would be nice to kill two birds with one stone.

Quote
I'm wondering could it be possible to make HTML export to looks just like PVD classic skin (with left and right frame)?

I was wondering the same thing. It seems a logical place to start—a template that at least includes all the standard fields laid-out in a manner similar to the default skin. I wouldn't expect it to look exactly the same or that it would be the best presentation, but it may be a necessary lowest common denominator. It would be complete, familiar, and would serve as a good starting point for those who want to modify it.

It would also be nice to have something similar to the existing Index & Movies template. That is, a linked table of contents or index to the movies included in the report. If that were a one-movie-per-line listing, it might serve as a stand-alone listing as well as an index.
Title: Re: Export template: HTML List (English + German)
Post by: svenne on April 07, 2010, 02:59:03 am
No, RTF cannot be displayed in a browser. We can stick just to HTML and CSS and first see what's possible, that makes sense.

Ok, frames...
At the moment templates don't allow saving the additional HTML-file containing the frameset, do they?
For frames you'd have to save this file + the movie list + the movie detail pages. But I could do something similar using iframes (inner frames), or I'd better say, I already did that.  ;)
Iframes are not so very different from frames, they are standard HTML since HTML 4.0 and supported by all modern browsers, as far as I know.
I didn't include all possible fields, but I could add more to the template in near future.

There are four attachments. The first two are just updated versions of "HTML List" (the templates are now replacing <, > and & with proper HTML codes). The last two are those with iframes, just try them and you will see what they do...

(see latest post of mine in this thread for attachments!!)
Title: Re: Export template: HTML List (English + German)
Post by: rick.ca on April 07, 2010, 05:07:44 am
Very nice! 8)

Understandably, only the selected movie in HTML Frames can be printed. Is there any way all of the movies could be printed at once?

Hyperlinks (i.e., those created by PVD's hyperlink function) are displayed as code. Can these be handled so they show their display text? And can those that are URL links be translated into HTML hyperlinks?
Title: Re: Export template: HTML List (English + German)
Post by: mgpw4me@yahoo.com on April 07, 2010, 09:14:43 am
Very cool  8)

As usual, (you'll have to excuse me) I have some suggestions  ;D

Exporting the movie data to JavaScript arrays would allow you to do regional character transformations, sorts and create views.  A few javascript links to populate the list to create views (people, movie, genre, etc.) and I'd buy it !!  ...and Rick.ca would only be a couple of JS lines away from his long-awaited 'people of interest' template.

Title: Re: Export template: HTML List (English + German)
Post by: svenne on April 07, 2010, 03:33:36 pm
Topic: links...
First of all I changed the templates to replace the pvd link codes to some kind of silent but W3C conform HTML code (span class='pvdlink' title='[linktype and reference]'...) using a chain(!) of "replace" statements. Funny (and very useful, of course...) that it works this way...
I will use javascript to "reactivate" all pvd links based on movie IDs and URLs later, that's all I can do. The export functionality for templates is limited and there is no direct access to the database contents. For pvd link types "title", "name", "original title", "genre", "country", and so on, the templates can't fetch information to which HTML subpage(s) the exported links should point, or can they?
I wasn't aware myself, but by the way: per default PVD exports all internal link codes as is. That means they show up in the exported HTML source as <link contry="Loompaland">...</link> and so on. You don't see the code when exporting via "Web Pages(IndexMovies)", because they can't be interpreted by the browser and are kindly omitted. But they are there. Nasty, nasty links! They break HTML specifications... The HTML <link>-tag is not allowed within the <body>-tag. That might become problematic, if the W3C or some browser developer considers <link> within the <body> tag to do something, that shurely would differ from its beviour within PVD. Furthermore, the HTML attributes "id", "name" and "title" already have purposes that have nothing to do with their function within PVD. This can lead to very unexpected behaviour in some cases, especially when export templates become more complex, containing CSS and javascript functionality relying on IDs, for instance.
The templates I wrote just replaced "<" or ">" with "&lt;" and "&gt;" to prevent these characters (whenever they appear in floating text) to be misinterpreted as HTML tags, hence all the link codes became visible... Oops!  :)

Topic: printing...
To print all movies at once you'll need a template that exports all the data (you want to print) into a single file. Of course you could add some javasript to the iframe template that gathers all the information by following all links to the subpages, then inserts all of it into the current page and then calls the browser's print dialog, but that's complicated and not reliable. Javascript would need to have access to the different HTML files and depending on security settings and browser behavior this is impossible in some or even most cases.

Topic: javascript functionality...
Regional characters: There should be no problem with regional characters right now since almost every exotic character can be displayed: within the HTML pages the charset is declared as utf-8. Are there some special characters displayed incorrectly after export? Then please tell me more details about that. Or perhaps I didn't understand your suggestion?
Sorting: You can sort the list in PVD and then export it. The sort order will be the same in the exported file. Of course it would be nice to have all the major functionality of PVD in the exported HTML, too. But with all the data that would have to be stored in the HTML file and all the necessary restructuring of HTML content via javascript that follows, it would be easier to have a MySQL-Database with some PHP as frontend. Or a Firebird database... um...
We already have that, or kind of, I'd say even something better, and it is freeware, too! Thanks to Nostra!  ;)
I don't want to mock your suggestions, of course, they are quite neat. But it would be a lot of work to recode the functions of PVD and even internal functions of Firebird to achieve all this funtionality. Let's face it, we've got an export template here, not another fully functional front end to the database. To write something to access a PVD database through the internet with enhanced fuctionality, that is a different task, I guess. But being able to re-sort the movie list in different ways within the HTML file is a cool idea nevertheless, so I probably will spend a lot of spare time and add that... some day...  ;)
By the way (see Nostras post here (http://www.videodb.info/forum_en/index.php?topic=1210.msg8888#msg8888)), the sorting problems of PVD will shurely be addressed sooner or later, though it seems to be a little bit tricky...

The new templates are attached:
Title: Re: Export template: HTML List (English + German)
Post by: mgpw4me@yahoo.com on April 07, 2010, 04:24:59 pm
No takers, huh?  Oh well, I'll have to write Rick's POI code myself <grin>...maybe soon.

The export works perfectly fine.  If sorting was to be done, then translations would be desirable...and simple...if you only have to deal with a single locale (and locale isn't Kanji).  I have all the people names in my database translated to English characters in the 'transname' field.

Before PVD, I used JavaScript as described to keep my data.  One line of characters (0-Z) for each of title, actor, genre populating the list from lookup tables.  The results were displayed from a second file that was specialized for the title or actor using numeric parameters and loading smaller, more detailed script arrays.
Title: Re: Export template: HTML List (English + German)
Post by: nostra on April 07, 2010, 07:28:07 pm
Wow, svenne, really great work!

Be sure to see your templates in the standard installation package of 0.9.9.20 ;)
Title: Re: Export template: HTML List (English + German)
Post by: rick.ca on April 07, 2010, 10:35:27 pm
...and Rick.ca would only be a couple of JS lines away from his long-awaited 'people of interest' template.

It must be long awaited—I can't remember what it is! ???
Title: Re: Export template: HTML List (English + German)
Post by: rick.ca on April 07, 2010, 11:35:40 pm
Quote
I will use javascript to "reactivate" all pvd links based on movie IDs and URLs later, that's all I can do.

I wasn't expecting more, and even this isn't essential. It now looks okay.

BTW, I appreciate you taking the time to explain all this, as well as coding the templates. While I don't understand fully, it helps me understand what's feasible. And begging others to do what I already know is feasible is always more effective. ;D

And I agree the object here is not to replace PVD with some kind of Java-Web contraption. It's to find ways to extend the functionality of the program. And in doing so, if nostra is relieved of the burden of providing the same function within the program, so much the better. Printing may be a good example of this. I've always wondered what users expect when they ask for a "printing feature." A full-blown report generator would be overkill and beyond the capability of most users. A non-configurable solution would be of limited use. And it's hard to imagine what half-measures might work. So printing using templates like these seems like a good solution.

While I like the HTML Frames template, I wonder what you think of my original idea of a separate list (one movie per line) linked to a detailed report. My thought was, being separate, the list could provide the means to print a simple list of the selected movies, while the detailed report would provide the means to print the details (with each movie starting on a new page). In other words, the details would all be in one page, with the links from the list being to anchors. It wouldn't be as slick as what you've done for browsing purposes, but maybe it would be a way of displaying the same information while also providing the means to print two different reports. Being in one template also makes it easier to use and maintain.
Title: Re: Export template: HTML List (English + German)
Post by: svenne on April 08, 2010, 02:47:56 am
Nice to hear these templates will find their way into the standard installation package!  :)

I could write a template for a seperate movie list linking to detailed reports (plural!). In fact I just would have to modify the existing iframe template a little bit (and throw out the iframe). A list linked to a single detailed report file is not possible, sorry. Templates allow two ways of data export: either one single list (that can be split into some smaller portions with a maximum number of movies per page) or: a list linking to several subpages each containig the data for one movie.
For printing purposes I could extend the single list template adding some more standard fields and the poster images. JavaScript can be used to show or hide details for a selected movie or for all of the movies at once. Hence you would be able to print the index (without page breaks between each entry, of course) or all the movie entries with all the details visible (with each movie starting on a new page when printed).
That should become a third template called "Detailed HTML List", because I really like the simpler one, too. It's compact and nice to send per eMail. Including the poster-images in the detailed list will blow up the summed file size of the exported data quite a lot!

So, for the new versions of the iframes and list templates I added some JavaScript to revive the ID-links and URL-links. Of course, whenever you export only a portion of your database, the id-links pointing to movies that were NOT exported will then point to files that do not exist, that means they will be broken. No way to avoid that. But I think that won't be too annoying. At least I can live with it... ;)
Title: Re: Export template: HTML List (English + German)
Post by: rick.ca on April 08, 2010, 07:45:58 am
Quote
Of course, whenever you export only a portion of your database, the id-links pointing to movies that were NOT exported will then point to files that do not exist, that means they will be broken.

I don't think anyone will have a problem with that. But since you're inclined to think about such things... URL links can be to local files, and these don't require a protocol to work in PVD. Is it possible to detect these and add the "file://" prefix they would require to work in a browser?

Quote
A list linked to a single detailed report file is not possible, sorry.

Then I suppose the next best thing would be a pair of templates that would be run at the same time (i.e., with the same file selection). One would print as a simple list that could be used as an index or table of contents. The other would print the details with each movie starting on a new page.
Title: Re: Export template: HTML List (English + German)
Post by: svenne on April 08, 2010, 04:23:58 pm
Yes, I understand what you'd like to have for printing purposes. I will see what I can do.

New versions of the templates...
I modified the javascript part. Links to local files should work now.
Title: Re: Export template: HTML List (English + German)
Post by: rick.ca on April 08, 2010, 08:55:22 pm
Quote
Links to local files should work now.

Perfectly. Thanks!
Title: Re: Export template: HTML List (English + German)
Post by: svenne on April 09, 2010, 02:30:44 am
Almost perfect...  ;)  I had a bug in them, that rendered one of the scrollbars useless in Firefox.  :-[
New versions...
Title: Re: Export template: HTML List (English + German)
Post by: rick.ca on April 09, 2010, 02:54:42 am
Good thing you caught that. Nostra would have been very unhappy to find it couldn't display Dr. Strangelove or: How I Learned to Stop Worrying and Love the Bomb (http://www.imdb.com/title/tt0057012/). ;D
Title: Re: Export template: HTML List (English + German)
Post by: svenne on April 10, 2010, 09:47:11 pm
Hell, yes!! :D Never wanted that to happen!

New versions, again... (for frame templates only, the list templates stayed the same)
A "broken" image was displayed in the upper right corner on exported HTML pages when movie entries had no poster with them. Corrected that.
Then I tidied up a little and "streamlined" the exported code. The stylesheets are in seperate files. The templates are a lot easier to maintain now and the seperate stylesheets offer new possibilities. Now there can be user selectable stylesheets (switching between stylesheets would even work without javascript). Therefore it will be possible with a single export template to provide different layouts (list only or fully detailed records, for example). I will implement that next week.
Title: Re: Export template: HTML List (English + German)
Post by: rick.ca on April 10, 2010, 11:06:25 pm
Quote
The templates are a lot easier to maintain now and the seperate stylesheets offer new possibilities.

One possibility is straightforward modifications will be easy for most users. It didn't take me long to figure out how to add my custom Reviews to the report. In movieframe.ptm, I simply added...

  <h2>Description</h2><p>{%value=description}</p>
  <h2>Review</h2><p>{%value=Review custom="true"}</p>
  <h2>Comments</h2><p>{%value=comment}</p>

...and it worked! :o (I'm always amazed when the obvious works.) Maybe you could prepare a brief tutorial when you're done on how to use the templates provided, along with instructions for such modifications.
Title: Re: Export template: HTML List (English + German)
Post by: mgpw4me@yahoo.com on April 10, 2010, 11:08:24 pm
Sounds like Nostra started something with all the docs that have suddenly appeared  ;D
Title: Re: Export template: HTML List (English + German)
Post by: buah on April 11, 2010, 03:02:29 am
Svenne, thank you for a really nice html export template. Don't blame me for not being clear enough to say that there should be only right (i)frame, while there wasn't actual need for a left one.
Once again, really impressed with the result.
Title: Re: Export template: HTML List (English + German)
Post by: svenne on April 11, 2010, 03:14:45 pm
To both rick and mgpw4me: That's how it should be.  ;)

I will prepare a brief tutorial, but I won't give an introduction to HTML and CSS. Concerning the HTML part you can copy and paste lines, change them and see what happens. I was trying to keep that as simple and compact as possible. Perhaps I should mention that the list templates have some headlines that you can't see with standard styles applied, so don't be surprised.

After you finished to change something you should test if the HTML is still valid (that every tag has its closing tag, and so on), especially if you're less experienced. You can do that here: http://validator.w3.org (http://validator.w3.org)
I tried it myself a few minutes ago and saw that I used XHTML syntax in one line and I'm into (barrier-free) web design for years now... I changed that now, but I'm shure you won't see any difference in this case, most browsers are kind enough and don't bother.
CSS is a bit more complicated, because the different browsers still (mis)interpret some things in different ways, but people could change colors or fonts quite safely. Nevertheless I would advice them to read one of the CSS tutorials you can find easily on the web. The majority of users won't even know about hexadecimal values or RGB colors, for example, and I don't want to write a documentation raising more questions than giving answers to those. Nevertheless, everyone who wants to should dare to mess with the source code. There's no reason not to try and if they do something wrong their computers won't explode afterwards... although in some cases I'd really like that.  ;D
You can validate CSS here: http://jigsaw.w3.org/css-validator/ (http://jigsaw.w3.org/css-validator/)

To buah: Thanks, I like it that you like it (like it is, like).  ;) And there only is one iframe, the list part is a simple <div></div> containing an unordered list (<ul></ul>). By the way, it would be possible to have a "real" frameset generated with templates (but the iframe looks nicer...). I just wasn't aware that nostra implemented a copy command that can be used. It's documented here (http://www.videodb.info/forum_en/index.php?topic=766.0), but I overread that.  ::)

Since it is possible to store all the CSS in seperate files now, I can do more complex things with so called alternate styles (that have to be in different files).

Concerning PVD export templates in general, some stuff seems not to be documented. Nostra even introduced something like functions (http://www.videodb.info/forum_en/index.php?topic=1358.msg5678#msg5678), but I don't know if there are more, what they do and how they work. By the way, is there a possibility to define some kind of (constant) global variables in the %OPTIONS% part, that could be used throughout the template? Something like #define (http://www.cppreference.com/wiki/preprocessor/define) in C++? It doesn't need to be that complex, simple string replacement would do (like {#StringReplace...}, just not applied to %values but to the template itself). Sometimes missed that, but just a little bit.

New versions of the templates... I only transformed the single occurence of XHTML into HTML, no big deal...

(The two language versions of the iframe template have some files in common. When extracting the second one to the same directory you surely will be asked if you want to replace files. You can safely click yes, those files are the same anyway. Both language versions will work properly afterwards.)
Title: Re: Export template: HTML List (English + German)
Post by: rick.ca on April 11, 2010, 10:03:24 pm
A small glitch with HTML Frames... Print view will only render one page. If opened in a separate tab or window, the print view will properly span two pages for longer entries.
Title: Re: Export template: HTML List (English + German)
Post by: svenne on April 11, 2010, 11:46:12 pm
I see... The problem lies in the nature of iframes + some less than perfect browser behaviour:
http://kb.mozillazine.org/Problems_printing_web_pages#Does_not_print_multiple_pages (http://kb.mozillazine.org/Problems_printing_web_pages#Does_not_print_multiple_pages)
Internet Explorer is not so different from Firefox. IE7 even printed a scrollbar (but it was of no use, I really tried hard but I only ripped the paper... ;) At least I could prevent IE from printing scrollbars via CSS now...).
Iframes (and frames) always where problematic when it comes to printing. One of two workarounds is what you did. The other is (at least in Firefox): right click into the iframe and tell the browser to print the current frame (choose "This Frame" -> "Print Frame").

I'm still working on a template for printing purposes...

You can always find the newest templates here in the first post (http://www.videodb.info/forum_en/index.php?topic=1844.msg8889#msg8889).
Title: Re: Export template: HTML List (English + German)
Post by: svenne on May 03, 2010, 07:53:03 pm
I had quite a lot of other things to do, so it took a little bit longer... Here is the first version of an HTML export template for printing purposes. Since I really didn't have much time, consider this alpha...
In Firefox you can choose between different print layouts: In the menu "View" go to "Page Styles" and you'll see a list to choose from. If your Database is huge it might take some time for the browser to reformat the whole thing (same with the browser's print preview). So be patient. Choosing different styles is possible in all common browsers and in IE8 or newer. It will work with IE7, too, but that'll need some javascript. I'm planning to add a menu to the exported HTML anyway, to make the different settings more obvious.
Title: HTML export template for printing purposes
Post by: svenne on May 22, 2010, 06:56:23 pm
It became quite tricky, because both Internet Explorer 7 and 8 are buggy. With IE8 at least you can choose between alternate stylesheets and they will be rendered on screen, but while printing the whole thing alternate stylesheets are ignored...  ::)
Ok, at last I found a workaround and now everything's fine in IE (as long as JavaScript is not deactivated, of course). Tested it with IE8, but with IE7 it should be ok, too, since problems of IE7 were the same.
Firefox is fine anyway.
Hope you like it...
Title: Re: Export template: HTML List (English + German)
Post by: rick.ca on May 22, 2010, 08:30:24 pm
Nice! Thanks.
Title: Re: HTML export template for printing purposes
Post by: svenne on June 05, 2010, 05:54:48 pm
I made some changes to the "HTML Print Layout" template:
- fixed some problems with the browsers refresh button
- in "no details"-view the information on genre now is ommitted. Replaced it with file properties (filesize, codec, languages)
- added "show/hide movie id" and "show/hide file properties" to the "Print Layout" dialog

Title: Re: Export templates: HTML List/Frames (English + German) + Print Layout
Post by: rick.ca on June 06, 2010, 12:16:32 am
This is coming along nicely. Now I wonder what happened to all those who were looking for a "print" capability. ::)

The print layout control doesn't seem to work properly in the "no details" view (in Firefox, if that matters)...

I think you should keep genre. It's still there, but your post implies you intended to remove it. It could be set apart from file properties by using a different font (or simply not italicizing)—should they both be selected.

It would also be nice if sequential numbers could be used instead of, or in addition to, id. A numbered "no detail" view could then be used as a table of contents for a detailed view.
Title: Re: Export templates: HTML List/Frames (English + German) + Print Layout
Post by: svenne on June 06, 2010, 12:48:56 am
I can't reproduce that behaviour, works fine here on Firefox 3.6.3...  :o
PVD never overwrites existing files (except the main html files and the poster images). Did you export to a directory where the subfolder "htmlprintfiles" already existed? Old versions of the stylesheets would be a problem. Try to delete "htmlprintfiles" and then do a fresh export with "HTML Print Layout". Please let me know if it works afterwards.

Ok, I will add sequential numbers soon.
I added ID, cause you can use the ID to index your DVDs and stick the number onto the cover of every DVD. Makes it easier to find the right one...
Title: Re: Export templates: HTML List/Frames (English + German) + Print Layout
Post by: rick.ca on June 06, 2010, 01:24:42 am
Quote
Please let me know if it works afterwards.

Yes, that was the problem. But I still think you should keep genre—the list is a little lean with just title and year. ;)

Quote
I added ID, cause you can use the ID to index your DVDs and stick the number onto the cover of every DVD. Makes it easier to find the right one...

Yes, I'm sure that exactly why some want to be able to print a list. For me, there's no need for either. Since I don't use ID, I can Reindex the movies selected for the report to get a numbered list. 8)

Posters don't span pages well. I'm sure users can figure that out on there own. But, if it's possible, you may want to consider forcing "one page per record" if "show poster" is selected.
Title: Re: Export templates: HTML List/Frames (English + German) + Print Layout
Post by: svenne on June 06, 2010, 02:03:03 am
Ok, no sequential numbers then. Would have been a little bit more difficult to achieve than just showing/hiding things. But if someone really wants this, I could add the feature to reindex within the exported file (so you won't loose your original IDs in PVD). By the way, if you sort your database alphabetically prior to export, there might be no real need for a table of contents with numbers. But if you'd like to have it, just tell me.

Yes, some poster images will span over two pages in Firefox as long as you don't choose "one page per record", but Internet Explorer for example handles this in a different way and avoids to split the images. So I don't want to force the "one page per record" setting, but instead let the user decide what to do. A CSS rule could be added to tell the browser never to split the DIV-tag containing the poster ("page-break-inside:avoid;"), but Firefox still ignores this. Might be implemented in near future though.

I added 'show/hide genre' now...
Title: Re: Export templates: HTML List/Frames (English + German) + Print Layout
Post by: rick.ca on June 06, 2010, 03:02:57 am
Quote
But if someone really wants this, I could add the feature to reindex within the exported file...

Fair enough. No point in catering to those who won't speak for themselves. ;D

Quote
...but Internet Explorer for example handles this in a different way and avoids to split the images.

The easier fix is to use the IE Tab Plus (https://addons.mozilla.org/en-US/firefox/addon/10909/) add-on for Firefox. That allows switching to the IE rendering engine and (while it never occurred to me before) that includes printing.

Quote
I added 'show/hide genre' now...

Thanks!

A minor suggestion: If the assigned filename (without the extension) was used as the report title, the user would have the ability to name the report whatever they like.
Title: Re: Export templates: HTML List/Frames (English + German) + Print Layout
Post by: svenne on June 06, 2010, 01:52:17 pm
Thanks for the info on IE Tab Plus (https://addons.mozilla.org/en-US/firefox/addon/10909/).

Quote
...user would have the ability to name the report whatever they like
I tried a different approach now to provide full control over the title apart from the filename...

Something different: Within the template, in %OPTIONS%-area: is it possible to get the filename that was chosen by the user in the filter dialog, with and without extension? Something like %filename%?
Then I'd like to change the subdirectories name from "htmlprintfiles" to "%filename%_files" (and I would need to omit the filenames extension here) to take advantage of this Windows feature:
http://paulelso.wordpress.com/2006/09/20/xp-folder-option-managing-pairs-of-web-pages-and-folders/ (http://paulelso.wordpress.com/2006/09/20/xp-folder-option-managing-pairs-of-web-pages-and-folders/)

You can always find the newest print template here (http://www.videodb.info/forum_en/index.php?topic=1844.msg8908#msg8908).
Title: Re: Export templates: HTML List/Frames (English + German) + Print Layout
Post by: rick.ca on June 06, 2010, 10:40:18 pm
Quote
Something different: Within the template, in %OPTIONS%-area: is it possible to get the filename that was chosen by the user in the filter dialog, with and without extension? Something like %filename%?

Not that I'm aware of. I assumed there would be an HTML variable for getting the filename of a page, but maybe that's a bit strange.  ::)

Quote
I tried a different approach now to provide full control over the title apart from the filename...

Yes, that's a better idea.
Title: Re: Export templates: HTML List/Frames (English + German) + Print Layout
Post by: svenne on June 06, 2010, 11:30:01 pm
Nostra implemented some special values you can use within the rest of the template (outside of the %OPTIONS% part), documented here (if anyone wonders): http://www.videodb.info/help/hlp_export.html
There are
{%value="206"} - Path to the first page (HTML)
{%value="207"} - Path to the index file for the current record (HTML)
{%value="215"} - Path to the current record's file (HTML)
{%value="220"} - Path to the index file for the current record
just to name a few. And there are functions to extract a filename (without path) from these values or its extension, and in combination with StringReplace you can have the filename without its extension. So your suggestion to take the filename (without extension) as headline would not be that difficult to achieve.
But I was thinking of something else already: If the user decides to name the exported file "statlersmoviecollection.html" it would be nice to name the subdirectory containing all the accompanying files (like CSS stylesheets and poster images) "statlersmoviecollection_files" instead of "htmlprintfiles". Not only that the user would immediately see that both file and folder belong together, Windows also would recognize this and treat them as if they were glued together. For example, if you moved the html file to a different location, the subdirectory would automatically move too, etc.
Title: Re: Export templates: HTML List/Frames (English + German) + Print Layout
Post by: rick.ca on June 07, 2010, 01:26:19 am
Quote
So your suggestion to take the filename (without extension) as headline would not be that difficult to achieve.

I still like what you've done better, but I suppose it would be cool if the filename was used as the default heading. It would also go nicely with your idea of linking the subdirectory. If one does want to copy or move the files, that will obviously make them easy to identify, and that operation less error-prone.
Title: Re: Export templates: HTML List/Frames (English + German) + Print Layout
Post by: svenne on June 07, 2010, 04:18:44 pm
I made the database filename the default heading, so if you (in PVD) go to File->Save as and save your database as "Rick's Movies.PVD", all export templates I wrote would use "Rick's Movies" as default heading... bad idea?

Quote
idea of linking the subdirectory
I will post a feature request, perhaps Nostra will find the time to add a variable handing over the filename from the "save"-dialog in the %OPTIONS% section.
Title: Re: Export templates: HTML List/Frames (English + German) + Print Layout
Post by: rick.ca on June 07, 2010, 06:52:15 pm
Quote
all export templates I wrote would use "Rick's Movies" as default heading... bad idea?

I think it's a good idea—as long as you're retaining the editable "headline." In other words, it will default to the filename, but can still be changed in the browser.

Quote
I will post a feature request, perhaps Nostra will find the time to add a variable handing over the filename from the "save"-dialog in the %OPTIONS% section.

OIC. I guess you can't use the filename after-the-fact to create the directory. :-\
Title: Re: Export templates: HTML List/Frames (English + German) + Print Layout
Post by: svenne on July 10, 2010, 05:00:06 pm
Quote
I guess you can't use the filename after-the-fact to create the directory.
Yes. I will change that as soon as Nostra has implemented the variables necessary.

I managed to add support for hyperlink types "Title" and "Original Title" now (to templates "HTML Frames" and "HTML List"). So supported hyperlink types now are "ID" (= mid = "Database Record ID", see here (http://www.videodb.info/forum_en/index.php?topic=2022.0)!), "URL", "Title" and "Original Title".
Title: Re: Export templates: HTML List/Frames (English + German) + Print Layout
Post by: svenne on July 11, 2010, 04:44:15 pm
I added a new feature to the "HTML Frames" template:
You can choose now wether you want to see all exported entries or only the newest ones. If you export your database to share it with friends: now it is easier for them to keep track of new additions, even if you export your whole database.
Title: Re: Export templates: HTML List/Frames (English + German) + Print Layout
Post by: wannytje on July 25, 2010, 10:00:35 am
Hi,

I'm new at this.

I would like to print out a list (summary) of all the childeren DVD's (I assigned a category "kids" to those movies).  I would like to print the poster too, as my children can not read yet.

How do I go about to do this?  The HTML-stuff looks a bit complicated....
Title: Re: Export templates: HTML List/Frames (English + German) + Print Layout
Post by: svenne on July 25, 2010, 11:16:19 am
Ok, that should be an easy task, but if anything stays unclear, feel free to ask...
So here we go:

1) Do a search for "kids" in "Category":

In Personal Video Database click on the button next to "Search" that says "Title + Original Title + Aka" and change it to "Category" (it is somewhwere in the lower part of the long, long list you will see).

Enter your search term ("kids") into the "Search:"-field

All movies that do not fit the search term will be invisible now. (You can undo/reset your search later by clicking onto the curled green arrow next to the search field)

2) After doing the search, choose "HTML print layout" from the "Export"-menu... and you're (almost) done.

3) Just in case: If you want to have bigger posters, edit the file "main.css" (in subfolder htmlprintfiles\css\ in the folder you exported to) with Notepad. You will see the following code quite at the top of this file:

Code: [Select]
div.poster
{
  max-width:170pt;
  float:right;
  clear:both;
  padding:0.3em;
  margin:1em;
  border:1px dotted black;
}

Change "max-width:170pt;" to "max-width:250pt;", save main.css and reload the exported HTML-file in your browser: now posters should be almost half the page wide (if the original poster images are big enough, cause small images won't be enlarged)...

4) Print the exported list with your browser's print feature.
Title: Re: Export templates: HTML List/Frames (English + German) + Print Layout
Post by: svenne on July 25, 2010, 11:55:57 am
And something was wrong with the ZIP-Archive containing the HTML print layout template. Stylesheets were missing...  :-[

So these are the newest and complete versions:
Title: empty.html does not display correctly
Post by: Sefdik on August 07, 2010, 11:18:09 am
Ah but ..... next problem.
Should this be a new post or a bug post?  ???

I am learning, I am using the HTML Frames (English) that came with PVD.  I have modified this and have found /plugins/templates/frames movieframe.ptm and empty.html and modified them to suit my purposes.

However empty.html does not display correctly.   It works OK the first time but subsequent modifications are NOT reflected.   If I delete the empty.html from the destination directory it works OK again.

So it would appear that if there is an existing empty.html in the destination directory then it DOES NOT get overwritten.

Any ideas ....

Seth, Burgundy France (where it is still not raining but not as hot as Moscow).
Title: Re: Export template: HTML List (English + German)
Post by: rick.ca on August 07, 2010, 08:21:13 pm
Svenne is the author of these templates. I've moved your post to his support topic.

Quote
If I delete the empty.html from the destination directory it works OK again.

I don't know why the old file would not be overwritten, but why don't you just do this? More generally, I would think clearing the destination folder or using a new one would be a prudent thing to do after making any changes to a template.
Title: Re: Export template: HTML List (English + German)
Post by: svenne on August 08, 2010, 11:18:16 am
Hi Seth, hi Rick, I'm unsure if it's a feature or a bug... ;-) Existing files in destination folder are not overwritten when copied via template (copyfile="source<->target"). This is not only the case with my template, but with templates in general. It may be intended to prevent accidental overwrites. In contrast, exported images and exported movie pages are overwritten (after prompting for confirmation to overwrite the main/index file). I'd guess it's a (minor) bug...
So if you modify a template and want to test it, you should always empty the destination folder first.

Perhaps we should tell Nostra. I'd guess that he can change that behaviour with little effort.
Title: Re: Export template: HTML List (English + German)
Post by: nostra on August 08, 2010, 11:35:34 am
Yes, it is a minor bug. I will fix it in the next plugin update.
Title: Re: Export template: HTML List (English + German)
Post by: Sefdik on August 16, 2010, 01:46:51 pm
To me it seems inconsistent, I want to export my data, I have modified it, add, deleted or changed records and I have modified the templates, therefore I want it to use the new template.

It's no real hassle having to delete the empty.html first but it is inconsistent.

Maybe Nostra can give us a choice.   If I knew how to modify (copyfile="source<->target") or whatever to effect an overwrite, I could do it myself.

Seth, Burgundy France (where at Long last it is raining and has been for 2 days).
Title: Re: Export template: HTML List (English + German)
Post by: nostra on August 16, 2010, 07:18:51 pm
The new version of the plugin should overwrite existing files using copyfile option.
Title: Re: Export templates: HTML List/Frames (English + German) + Print Layout
Post by: svenne on August 17, 2010, 03:51:55 am
Just fetched the latest updates (in PVD: "Help" -> "Check for updates") and it's fine now. I surely appreciate the fix, thanks!

New versions of my export templates... For all those who tend to collect their favourite soap operas...  ;)
- episodes will be taken into account by all three templates now. Episodes will be listed below the description field of the corresponding main entry...

Some minor changes:
- the quality field will only be shown if it is not empty (same with some other fields)
- internal links will only be active if the movie entry they point to was not excluded from export. This was not the case for link type "ID" (= mid = "Database Record ID") until now
- there are some other tiny changes/bugfixes, but i can't remember what they were actually... ::)
Title: Re: Export templates: HTML List/Frames (English + German) + Print Layout
Post by: svenne on August 21, 2010, 12:58:55 pm
I modified the templates again, taking advantage of a new feature (http://www.videodb.info/forum_en/index.php?topic=1987.0) Nostra implemented...

If export templates don't generate a single file but multiple files instead (several html pages + stylesheet files + images, etc.), these files now can be stored in a folder named similar to the main file.

An example:
if you advise the "HTML Frames" template to export your database to a file named mymovies.html, now all additional files that are generated during the process will be stored in a folder named mymovies_files. Hence it will be more obvious which folder belongs to a corresponding html file, especially if you do several different exports (like different selections, your movie list altered by filters, or whatever). Windows users will also benefit from this feature ("pairs of web pages and folders"):
http://paulelso.wordpress.com/2006/09/20/xp-folder-option-managing-pairs-of-web-pages-and-folders/
Title: Re: Export templates: HTML List/Frames (English + German) + Print Layout
Post by: svenne on August 22, 2010, 06:59:13 pm
- added a little bit more details for audio streams
- added "Subtitles" field (will only show up if not empty)
- added a "Print" button (to HTML Print Layout)
- did some minor tweaks
Title: Re: Export templates: HTML List/Frames (English + German) + Print Layout
Post by: svenne on September 25, 2010, 01:37:59 am
There is a minor problem when using the template functions replace/#StringReplace to replace quotation marks (' or "): When there is a PVD-link in the exported field things get messed up. Since I excluded empty fields from export with the aid of some nested #StringReplace and #ConditionAdd commands, this became an issue here for fields that contain PVD-links. For sure it's a bug in PVD, but it's complicated to explain how and when these heavily nested commands trigger it and I'm sure it's complicated to solve... and that would be for the benefit of maybe only one or two people (already including me)...  ;)
Since removing this bug (that most likely no other one would ever stumble upon while developing templates) would surely delay release of PVD 1.0 I won't mention this never ever again... ;)
So I reconsidered my strategy and added some simple javascript to get a workaround... and it works. Fields with links are exported nicely and empty fields are not displayed. Here are the new versions of my templates...
Title: Re: Export templates: HTML List/Frames (English + German) + Print Layout
Post by: svenne on November 15, 2010, 09:52:55 pm
Some new features...

- I added colored dots for loaned movies and for those on the wish list

- just to make mgpw4me happy ;): I added some sort functionality. While viewing the exported data in your browser you can choose to (re-)sort your movie list in three different ways (but the initial sort order will still be the same you had in PVD when exporting). If you push the "Sort list..."-button a menu will pop up...
If you choose to sort by alphabet: it will be case insensitive and characters like à, á, â, ã, ä, å, will be treated as "a", while the german ß will be treated as double-s, æ will be treated as "ae", and so on... might not be just as good as the Unicode Collation Algorithm (http://www.videodb.info/forum_en/index.php?topic=1210.msg8883#msg8883), but almost! ;)

Title: Re: Export template: HTML List (English + German)
Post by: mgpw4me@yahoo.com on November 16, 2010, 08:00:27 am
- just to make mgpw4me happy ;):
date=1289854375]

I've always been happy  >:(

As soon as I figure out what I'm doing wrong  I'll add you to my XMas list.  I have my own "little" project that may be ready by then.
Title: Re: Export template: HTML List (English + German)
Post by: svenne on November 16, 2010, 11:01:44 am
Oh, don't be angry with me... the sort functionality was one small point you suggested, though a long time ago (http://www.videodb.info/forum_en/index.php?topic=1844.msg8977#msg8977)... the other ones are a little bit too complicated for now and perhaps easier to do with php? I fear that if I additionally exported everything into arrays... that might result in a very big file and further slow things down? The ideas for making everything more interactive were not bad, though. I'm looking forward to your project, does it have something to do with that?
Title: Re: Export template: HTML List (English + German)
Post by: mgpw4me@yahoo.com on November 16, 2010, 07:22:17 pm
Oh, don't be angry with me...

My fault...my sense of humor doesn't always come across as funny.

I noted the sort is quite slow with 5000 movies, so yes, I suppose a big file might slow things down even more.  Firefox isn't a speed demon to start with.  One thing that might be worth looking at:

- export your database
- rename the index.html file to index.hta
- add the following lines to the top of the hta file

Quote
<HEAD>
 <TITLE>Svenne's Monster Application</TITLE>
 <HTA:APPLICATION ID="oMyApp"
      BORDER="thin"
      BORDERSTYLE="normal"
      CAPTION="yes"
      MAXIMIZEBUTTON="yes"
      MINIMIZEBUTTON="yes"
      SHOWINTASKBAR="yes"
      SINGLEINSTANCE="no"
      SYSMENU="yes"
      VERSION="1.0"
      WINDOWSTATE="maximize">
</HEAD>

You now have full access to the windows scripting engine (vbscript or javascript).  There's supposed to be a PECL for PHP that can register PHP as a scripting language, but I haven't been able to get the PECL and PHP versions to match up yet.

I'm still working on getting good quality (~ 400px square) headshots of the people in my database.  My project will allow others to do the same.
Title: Re: Export template: HTML List (English + German)
Post by: svenne on November 16, 2010, 08:10:29 pm
The sort itself is quite fast. Restructuring and rendering the page is the slow thing... Internet Explorer is almost the same, even a bit slower...
Thanks for the info on HTA. It's something that I was completely unaware of. :-\ Sounds interesting! :)

Title: Re: Export templates: HTML List/Frames (English + German) + Print Layout
Post by: svenne on November 16, 2010, 09:36:46 pm
Due to compatibility problems I changed all fonts to standard sans serif... On most systems that's not much of a change, but on some it should look better now.
Title: Re: Export template: HTML List (English + German)
Post by: rick.ca on November 16, 2010, 11:10:54 pm
 8) Good work, as usual. Thanks!
Title: Re: Export template: HTML List (English + German)
Post by: mgpw4me@yahoo.com on November 29, 2010, 12:19:28 pm
The sort itself is quite fast. Restructuring and rendering the page is the slow thing... Internet Explorer is almost the same, even a bit slower...

Have you considered putting the listbox in a DIV and using InnerHTML to write the entire select at once?  Adding items to a list means the listbox has to be redrawn for each item....InnerHTML should render once.  Hmmm...are you even using a listbox?  I haven't looked.

I'm pulling 80,000 records from the database and putting them into a listbox in about 5 seconds.
Title: Re: Export template: HTML List (English + German)
Post by: svenne on December 07, 2010, 11:15:29 am
Thanks for the hints, I'm not using a listbox. Used an unordered list. I fetch all <li>-elements (have them in an array just as you get them with getelementsbytagname), sort them and put each one into place (without changing the <li>-elements themselves, so there would be no need to rerender those ...in theory). In fact, I thought browsers would wait with page rerendering until all elements are done cause by default page refresh is delayed until everything is in place... I will experiment to find the time consuming steps. Perhaps it's faster not to move the elements but to change their content with innerHTML. I will try a listbox, too. I can imagine you're right with that...
Title: Re: Export template: HTML List (English + German)
Post by: svenne on December 07, 2010, 01:08:09 pm
Ok, the whole unordered list is completely taken out of the page now, then sorted, and put back as new unordered list into the page. Although the code looks more time-consuming, it is about three times faster with Firefox. With IE it is not that much, but it's faster. The time consuming step now is the sort function itself. There is a lot of potential for getting that faster, too, since for each comparison the necessary part (title, year, or date added) is extracted from the list elements. But for the time being I'm quite happy with the result...
Thanks for your tips, mgpw4me!
Title: Re: Export template: HTML List (English + German)
Post by: mgpw4me@yahoo.com on December 09, 2010, 06:39:18 am
As rick.ca can tell you, the easiest thing in programming is to tell SOMEONE ELSE how to make something better.  ;D  It's the implementation that makes the magic.

I'm going to take a look at your code with the idea of adding it to my "smart browser" that will connect directly to the PVD database...for poster and people images.
Title: Re: Export template: HTML List (English + German)
Post by: rick.ca on December 09, 2010, 06:51:57 am
Quote
As rick.ca can tell you, the easiest thing in programming is to tell SOMEONE ELSE how to make something better.

That's true. The funny thing is, I couldn't code my way out of a wet paper bag. But most programmers are much better at solving problems than knowing what problems need to be solved. So we need each other. ;D
Title: Re: Export templates: HTML List/Frames (English + German) + Print Layout
Post by: svenne on December 09, 2010, 12:04:09 pm
Yes, it's always nice to have feedback... if it's good and does not cause lots of recoding... and especially if wishes can be served/problems can be solved in less then 2 minutes... give me more of that, it really is way too rare!! ;D
The info on HTA was very nice. I will surely take advantage of that if not here but some day somewhere...

I'm looking forward to seeing that "smart browser".

In the meanwhile I added the sort functionality to "HTML List", too (since it was only available in "HTML Frames" until now).
Title: Re: Export templates: HTML List/Frames (English + German) + Print Layout
Post by: svenne on February 24, 2011, 02:57:30 pm
Some kind of major update...  :)

Nostra is chained to the oars with version 1 development... I'd like to say thanks and, again, want to contribute something:

Changes in the "HTML Frames"-template:

- added: "category" will be exported
- added: if you click on the button "Further options" you now can switch between (localized) movie title and original movie title

But the major addition to the "HTML Frames"-template is a small executable called "pimpHTMLframesExport.exe". You will find it within the exported data in subfolder:
\[exported filename]_files\pimpHTMLframesExport\

If you run pimpHTMLframesExport.exe it will add additional features to the exported files.

Links will be added for genres, categories, countries, director names, actor names, and audio track languages, if different ones appear in two or more exported entries. So afterwards you can click an actor's name, for example, and get a list of all movies within your exported data where this name appears (as actor). This is not so very different to the behaviour in Personal Video Database itself.

Depending on the amount of exported data there will be a few thousand additional (but predominantly very small) HTML-files, all residing in the subfolder
\[exported filename]_files\.

Just one note:
If your database is really huge and with full actor lists, meaning a total of a trillionzillion different actors in your database, it might take a long time and lots of memory and virtual memory for pimpHTMLframesExport.exe to analyze the data. Try to be patient, but if you run into any problems (program crashes, stalls, etc.), please let me know. With my database containing more than 1200 entries and 15 to 30 actors per entry everything went fine and didn't take a long time. Theoretically it should withstand some 4 billion different(!) actor names in total. I would guess at some point earlier memory size and the size of Windows' swap file might become a limiting factor. But I'm completely unsure if someone could ever run into that. So if someone has a huge database... save all data, documents, and whatever you were working at, first ;) and give it a try. Then let me know what happened. (But don't make me responsible for exploded computers ;D)
 
Additional to that feature: filters will be added (to the "further options"-menu) for genre, category, and language, if there is sufficient data. (If you don't use category at all, for example, and the field stays empty throughout your database, a category filter would make no sense. So there must be two ore more categories, elsewise no category filter will be added.)

Some of the additional features will only appear if javascript is enabled in your browser.

pimpHTMLframesExport.exe should be run on freshly exported data (meaning only once on the exported data). Afterwards (or if you don't intend to run pimpHTMLframesExport.exe at all) you can safely delete the subfolder "pimpHTMLframesExport".
Title: Re: Export templates: HTML List/Frames (English + German) + Print Layout
Post by: svenne on March 02, 2011, 03:01:23 pm
- Internet Explorer had problems with script content declaration as utf-8, hence some javascript functions were broken in Internet Explorer. I fixed that...

- changed some minor things in pimpHTMLframesExport.exe...
Title: Re: Export template: HTML List (English + German)
Post by: rick.ca on March 02, 2011, 11:50:07 pm
Quote
Some kind of major update...

Very impressive! I created one for 929 movies in about six minutes—so the time is not an issue. And the links, once created, are very fast. It makes a handy "quick reference" for use in a browser. It's such a simple thing I hadn't thought of it before, but it's particularly useful having links only for items present in other records in the collection. The list I created is of feature films I own and/or have seen in the past—so most links mean "I've seen this (category, actor) before in..." I can create the same list in PVD using filters, but the links I see there don't have the same meaning.

[attachment deleted by admin]
Title: Re: Export template: HTML List (English + German)
Post by: ouafouaf on March 20, 2011, 10:56:39 pm
Hello there.
I tried this export template today for the first time, and was very pleased with the result.
I made some minor changes on the layout to suit my needs, but there are a couple of changes that I can't do myself. I don't want to mess with the codes (my knowledge about coding is very basic), and all the comments in the code are in german. I hope you guys could help me with it ?

I would love to modify the framed template to have both original and translated title in the film lift (and possibly original title first).
Also, I would like to have the films ordered by year as default setting.

Any chance you could help me with that ? I'd be very grateful.

edit: Also, the "Further Options" doesn't seem to work well. I haven't read all the posts in this thread, so I don't know if it has been reported by someone else. I a "Rebuilding List" popup, but then nothing happens. I have "only" 300 entries exported, and I let the "rebuilding" process run for a long time, but it doesn't seem to work. Tried on Firefox and IE. Does anyone else have this problem ?

*ouaf
Title: Re: Export template: HTML List (English + German)
Post by: ouafouaf on March 20, 2011, 11:37:03 pm
I should try a little harder before I ask for help. I figured out (after randomly changing stuff in the code ^^) everything I needed.
But yes, the "Further Options" is quite a problem. I used it with a smaller list (50 entries), it took about 30 seconds. For bigger lists, it's very slow. I suppose I'll just avoid using it ;)

And again, thank you for this very nice template. And so easy to use for noobs like me !
Title: Re: Export template: HTML List (English + German)
Post by: svenne on March 20, 2011, 11:49:22 pm
Hi ouaf,
default sort order is always the sort order you had in Personal Video Database itself at the time you exported your data. Sort in PVD by year and this will be the default sort order in the HTML list.
Concerning the "rebuilding"-popup: if it just stays there and nothing happens, it seems as if there was an error while executing the javascript code. The popup will not be removed, because javascript execution did stop. I don't have any problems with the javascript code, so I can't reproduce the error myself. To help me find the cause: In Firefox there is an "Error Console" in the "Tools"-menu. Please start it. In this console click "Clear" (in the upper right). Then (on the exported HTML page) choose "Further Options" and tell me, what errors are shown in the "Error Console".
What operating system do you have? WIndows XP, Vista, Linux, something else?
Thanks for your feedback.
Svenne

P.S.: I will tell you how to add the original title soon (so both localized title and the original will be shown)... won't be complicated. It shall be in the movie list, right? The truth is: It is already there, but hidden. You can switch between original title and localized title in the "Further Options" menu, but since that one doesn't do its job on your PC, it won't help you now... If possible, I will try to fix it...
Title: Re: Export template: HTML List (English + German)
Post by: svenne on March 20, 2011, 11:52:30 pm
Oh, ok, just saw your second reply... is your PC fast or slow in general? I tested "Further Options" with more than thousand entries and it takes only a few seconds (AMD Athlon 2.4GHz, WinXP)... maybe something goes terribly wrong in your case. As I said (see previous post), if you could give me some more information I could try to fix it.
Title: Re: Export template: HTML List (English + German)
Post by: ouafouaf on April 24, 2011, 08:28:02 pm
Sorry for letting your post unanswered. I don't come to the forums very often (only when I have something to whine about, really :p ).
I do have a very slow computer indeed. I tried the page on a newer computer, it works fine.
I might come around some day when I have time to play around with your template. I will probably come around then and bore you with my problems, seeing how poor my coding is  ;D
cheers.
Title: Re: Export template: HTML List (English + German)
Post by: arj0n on May 21, 2011, 09:00:46 am
Svenne,

Great template!

A question: when I add the Moviemeter rating  (%value=rating) to the report is shows zero for all records.
Is this option not available for this template?
Title: Re: Export template: HTML List (English + German)
Post by: svenne on May 21, 2011, 10:28:37 am
Hi Arj0n!

I think {%value=rating} represents your own, personal rating. There also is IMDB-rating ({%value=imdbrating}) and the Moviemeter rating is stored in "other rating": try {%value=orating}, that should work.

All this %value stuff is provided by the PVD interface and is independent from any specific template, it should work in every template there was, is, and will be, ;) mine included.
Title: Re: Export template: HTML List (English + German)
Post by: arj0n on May 21, 2011, 11:15:08 am
Thanx Svenne.

Stupid me, I thought 'rating' was representing the moviemeter-rating but like you said I should use 'orating' in stead of 'rating'...
My bad.

Thanx.
Title: Re: Export templates: HTML List/Frames (English + German) + Print Layout
Post by: svenne on September 12, 2011, 11:51:44 am
Just a minor change:
When the "original title" field was empty for an episode, then the "HTML Frames" template produced a pair of nasty empty brackets instead of omitting the field. Now the brackets are omitted in that case.

[attachment deleted by admin]
Title: Re: Export template: HTML List (English + German)
Post by: arj0n on September 25, 2011, 11:40:36 am
@Svenne:
In the pimp-readme is stated: "Links will be added for genres, categories, countries, director names, actor names, and languages of audio tracks"
But which template field is the "language of audio tracks"?

I added this line to movieiframe.ptm :  <h2>Language</h2><p id="langs">{%value=langs}</p> but it doesn't show up in the iframe at all. Probably cause I doesn't have it filled in my DB.
I added this line to movieiframe.ptm :  <h2>Language</h2><p id="origlang">{%value=origlang}</p> but it didn't got linked after the pimp.

Also:
Can you add fields to get linked by pimpHTMLframesExport.exe?
It would be nice if the entries in the 'producer' and 'writer' fields also get a link for example

Great template b.t.w.!
Title: Re: Export template: HTML List (English + German)
Post by: svenne on September 25, 2011, 12:26:47 pm
The template field is {%value=astreams params="full" template="HTML Frames\astreams.ptm"}. It's the line beginning with <h2>Audio</h2> in movieiframe.ptm and it refers to the subtemplate astreams.ptm. The language information is called by {%param=langs} in astreams.ptm.

Your browser would display something like this in the end (as long as in PWD the "languages"-field is not empty, of course):

 Audio:

    English (mp3, stereo)

pimpHTMLframesExport.exe will process this part of the exported file. Any additional lines with {%value=langs} or whatever are ignored. pimpHTMLframesExport.exe is just a bonus thing working with the existing template as is. You can add own lines and costumize the template to some extend and pimpHTMLframesExport.exe should still work fine, but it won't touch, link or mess around with the customized parts of the template.

Title: Re: Export template: HTML List (English + German)
Post by: arj0n on September 25, 2011, 02:19:26 pm
The template field is {%value=astreams params="full" template="HTML Frames\astreams.ptm"}. It's the line beginning with <h2>Audio</h2> in movieiframe.ptm and it refers to the subtemplate astreams.ptm. The language information is called by {%param=langs} in astreams.ptm.

Your browser would display something like this in the end (as long as in PWD the "languages"-field is not empty, of course):

 Audio:

   English (mp3, stereo)
Ah, added this to movieiframe.ptm:
<h2>Audio</h2><p id="astreams">{%value=astreams params="full" template="HTML Frames\astreams.ptm"}</p>

and it does show the field properly.
But... the items in that field shown in the browser still havem't got a link after running the pimper.

quoting from the pimper readme file:
"Links will be added for genres, categories, countries, director names, actor names, and languages of audio tracks, if those
appear in two or more database entries."

links are added after running the pimper: genres, categories, countries, director names, actor names
links are not added after running the pimper: languages of audio tracks.

So, do I still use the wrong field? or is it something else?

pimpHTMLframesExport.exe will process this part of the exported file. Any additional lines with {%value=langs} or whatever are ignored. pimpHTMLframesExport.exe is just a bonus thing working with the existing template as is. You can add own lines and costumize the template to some extend and pimpHTMLframesExport.exe should still work fine, but it won't touch, link or mess around with the customized parts of the template.

I understand but I was looking for an answer why I can't get the field "language of audio tracks" linked as stated in the readme of the pimper...

Thanx for the info.
Title: Re: Export template: HTML List (English + German)
Post by: svenne on September 25, 2011, 02:52:52 pm
pimpHTMLframesExport.exe looks for certain structures in the exported HTML-files. If these structures are not present (or different from the original template) it won't work. Did you try the original template to see, if it works there? The readme just explains what it does with files generated by the original template. It was never meant to be some kind of universal extention to the template script engine of Personal Video Database...

Also, links will be added only if there are two or more movies with identical language entries.

pimpHTMLframesExport.exe does not search for the structure <h2>Audio</h2><p id="astreams">...</p>. So it just ignores that line. pimpHTMLframesExport.exe searches for list elements belonging to a list with the classname "sound".

In the exported HTML files it looks like this:

Code: [Select]
 <h2>Audio</h2>
  <ul class="sound">
    <li>Spanish (AC3, stereo)</li>
  </ul>

or like this, if there are two audio streams:

Code: [Select]
 <h2>Audio</h2>
  <ul class="sound">
    <li>English (AC3, 6 channels)</li>
    <li>Italian (AC3, stereo)</li>
  </ul>


Title: Re: Export template: HTML List (English + German)
Post by: arj0n on September 25, 2011, 03:08:06 pm
Found something strange:
when having only 1 language: a link is added.
when having >1 language: no links are added.

In my test I always had 2 languages, separated by a comma. That way it seems not work.
I thought it was possible to have >1 language and getting links for all of them...
Title: Re: Export template: HTML List (English + German)
Post by: svenne on September 25, 2011, 03:18:21 pm
Quote
I thought it was possible to have >1 language and getting links for all of them...
That is right. But the entries must not be comma separated ("English, Spanish, French"), but within different list entries ("<li>English</li><li>Spanish</li><li>French</li>"). All within <ul class="sound">, as I mentioned before.
Title: Re: Export template: HTML List (English + German)
Post by: arj0n on September 25, 2011, 03:54:05 pm
Quote
I thought it was possible to have >1 language and getting links for all of them...
but within different list entries
Darn, I must have made a mistake causing the 2 same entries be not the same list.

something like ending up with 2 records having the same language but record 1 and 2 having this difference:
("<li>English</li>
and
("<li>english</li>

Sigh, sorry.

*slaps forehead*


Thanx for answering again Svenne,
Title: Re: Export template: HTML List (English + German)
Post by: arj0n on September 28, 2011, 04:27:18 pm
I made an export with 145 entries and the 3 filter buttons (genre, category and language) were working after pimping.
After adding more entries I made a new export (having 247 entries) but the 3 filter buttons aren't reacting anymore after pimping.

I used the original template files.
The file pimpHTMLframesExport runs with no errors.

What's wrong?

EDIT:
Removed some entries in the Languages list and somehow the 3 filter buttons work again.
It must have been one or more items in the Language list.
Still don't know which one was the 'bad entry'...
Are there any specific characters not allowed for such list(s)?
Title: Re: Export template: HTML List (English + German)
Post by: svenne on October 04, 2011, 12:58:08 am
Special characters could be an issue. I tried several special characters including chinese symbols... only space+"(" as well as "," (both without quotes) would give unexpected results, shortening or splitting up language entries. I will correct that soon. Nevertheless, the three filter buttons always did their job.
I could imagine some kind of "interference" if you choose the same export filename a second time or over and over again. Perhaps it might be only if you don't delete the old files first. But it's just a guess. The export would/should run fine and do a proper job. But your browser might have parts of the former file versions in its cache, causing some weird behaviour. Empty the browser's cache, that might help.
If it's not the browser's cache and if you can reproduce the error, tell me the details and I will eliminate the bug.
Title: Re: Export template: HTML List (English + German)
Post by: arj0n on October 04, 2011, 07:55:46 am
Special characters could be an issue. I tried several special characters including chinese symbols... only space+"(" as well as "," (both without quotes) would give unexpected results, shortening or splitting up language entries. I will correct that soon. Nevertheless, the three filter buttons always did their job.
Yes, I guess it must have been a comma or something...

I could imagine some kind of "interference" if you choose the same export filename a second time or over and over again. Perhaps it might be only if you don't delete the old files first. But it's just a guess.

I always delete the old export before making a new one, just in case.  ;)

The export would/should run fine and do a proper job. But your browser might have parts of the former file versions in its cache, causing some weird behaviour. Empty the browser's cache, that might help.
If it's not the browser's cache and if you can reproduce the error, tell me the details and I will eliminate the bug.
I haven't encountered that error anymore, so it must have been something in the 'special characters' corner.


Question:
Could you please add a fourth filter-button, one for for 'actors'?
Title: Re: Export template: HTML List (English + German)
Post by: arj0n on October 04, 2011, 07:57:07 am
Special characters could be an issue. I tried several special characters including chinese symbols... only space+"(" as well as "," (both without quotes) would give unexpected results, shortening or splitting up language entries. I will correct that soon. Nevertheless, the three filter buttons always did their job.
Yes, I guess it must have been a comma or something like "(".
I removed several things so I can't tell you what exactly caused this...

I could imagine some kind of "interference" if you choose the same export filename a second time or over and over again. Perhaps it might be only if you don't delete the old files first. But it's just a guess.

I always delete the old export before making a new one, just in case.  ;)

The export would/should run fine and do a proper job. But your browser might have parts of the former file versions in its cache, causing some weird behaviour. Empty the browser's cache, that might help.
If it's not the browser's cache and if you can reproduce the error, tell me the details and I will eliminate the bug.
I haven't encountered that error anymore, so it must have been something in the 'special characters' corner.


Question: could you please add a fourth filter-button, one for for 'Actors'?
Title: Re: Export template: HTML List (English + German)
Post by: svenne on October 04, 2011, 12:48:52 pm
"," and " (" won't be a problem in future versions.

A filter button/menu for actors is not practicable. In my database there are aproximately 12600 actors. And I only imported the most prominent actors from the first page for each movie in IMDB!
In a small database there might be a few thousand actors only, but even those could not be handled in such a menu. One major thing that keeps the exported HTML files from bloating to infinity is that I only link actors that occur in two or more movie entries.

Remember that all exported data is stored in HTML files. There is a lot of redundant information. As an example: movie entry x is listed in several files... for each actor that participates in it (+ at least in one other movie), in the file with the filmlist of the director, in the genre list, etc.
If you want to have a film list available for each actor without having a few ten thousand lists prestored as HTML files bringing your hard drive's file system to its knees... you will need to generate the lists on demand. It would take a lot of time to gather the corresponding data from all the exported movie sheets (pimpHTMLframesExport does so) on the fly. To be able to generate such lists fast you would need a genuine database... like Personal Video Database. ;)  By the way, javascript's access to the file system is very restricted, too. That can be changed (http://www.videodb.info/forum_en/index.php/topic,1844.msg11583.html#msg11583), but I wanted to keep the exported thing publishable on any PC and on the net.

If you want to have such features outside of Personal Video Database (which uses Firebird (http://www.firebirdsql.org/) as database): there are some approaches to get the data to mysql as a backend for web pages on common hosters and alikes:
PVD .9.9.21 Website Template Easy to Web scripts based on PK Template (http://www.videodb.info/forum_en/index.php/topic,2495.0.html)
(PK's MovieDB dynamic website template (http://www.videodb.info/forum_en/index.php/topic,1029.0.html))
Kroozbox - PVD to media theatre solution (http://www.videodb.info/forum_en/index.php/topic,1031.0.html)


Title: Re: Export template: HTML List (English + German)
Post by: mgpw4me on October 04, 2011, 03:53:54 pm
The database is directly accessible via HTML scripting (JavaScript / VbScript), if you install the Firebird driver...Internet Explorer version below:

<html>
<head><title>ActiveX Data Objects (ADO)</title></head>
<body BACKGROUND="CLDSHALF.JPG" TEXT="#000000">

<select size="40">

<script language="VBScript">

Dim cn, cmd, rs, i, dbpath, timein

dbpath ="Database=c:\program files\personal video database\movies 3.pvd"

Set cn = CreateObject ("ADODB.Connection")
cn.Open "DRIVER={Firebird/InterBase(r) driver};User=SYSDBA;Password=masterkey;" & dbpath & ";auto_commit=true"

set rs = cn.execute("select MOVIES.""title"", MOVIES.""year"", MOVIES.""mid"" from MOVIES order by MOVIES.""title"", MOVIES.""year""")

do while not rs.eof
   document.write ("<option value='" & rs("mid").value & "'>" & rs("title").value  & " (" & rs("year").value & ")")
   rs.movenext
loop

rs.close
cn.close

</script>

</select>

</body>
</html>
Title: Re: Export template: HTML List (English + German)
Post by: svenne on October 04, 2011, 04:35:11 pm
Thanks for the info. Nice to know. So, there are lots of opportunities...

All depends on what you want to do. Setting up a PC for customers in a video store? Or host a personal list of favourite movies on a third party internet server? Or do you want to share your DVD collection with friends, having the exported HTML files on an USB stick in your pocket? Or have a tiny list that you can attach to an email?
By the way, you can run Personal Video Database from your USB stick on any PC without having to install it there. There is a portable mode (http://www.videodb.info/forum_en/index.php/topic,661.0.html).

Concerning the HTML export templates: I want to keep them as "independent" as possible. They should not depend on a certain operating system or third party drivers and should stay apart from the original (comprehensive) database. They depend on a browser capable of javascript and iframes, of course. But that should be sufficient.
Title: Re: Export template: HTML List + HTML Frames (English + German)
Post by: svenne on October 05, 2011, 06:14:33 pm
New versions:
- HTML Frames: I changed the behaviour of the menus. Now they disappear if you click somewhere else on the page. Found it quite annoying that I could only get rid of them by choosing something or pressing the "Further options..." button again.
- writers, composers and producers will be exported if the fields in Personal Video Database are not empty
- pimpHTMLframesExport processes exported credits for writers, composers and producers
- nonalphanumeric characters in the language field should not be a problem anymore
Title: Re: Export template: HTML List (English + German)
Post by: beeman147 on October 23, 2011, 05:16:23 am
Hi...
I was planning (and had started) to write a modern standards based html/css export template myself...

But then I stumbled on this!

I was taking a similar approach but mine would not have been as good, so that saves me work I guess  ;D

I was asking a question, but I solved it myself...

Congrats on a great implementation  ;)

bee
   
Title: Re: Export template: HTML List (English + German)
Post by: svenne on October 28, 2011, 01:49:27 am
You're welcome! Thanks for the kudos!  :)
Title: Re: Export template: HTML List (English + German)
Post by: fejao on November 17, 2011, 12:40:02 am
Hi there svenne, Im a little lost right now I could give you a tip
Have you tried to avoid the duplication of the titles doing something like a little if()else ?

if(title=orig_title)
   write ("title");
else
   write ("title - orig_title");

It's kind of annoying having the title duplicated if you have the title as the same as the original title.

If you could point in which file I should try to modify this it could help

Thanks in advance
Title: Re: Export templates: HTML List/Frames (English + German) + Print Layout
Post by: svenne on November 17, 2011, 12:23:54 pm
Hi fejao,
if...else would be nice, of course...  ;)  However, things can be done with #StringReplace. It looks a little bit more complicated, though. The file of interest is movieiframe.ptm...
Code: [Select]
{#StringReplace '{#ConditionAddFirst <> '' '{#ConditionAdd <> '' '{%value=origtitle}' '</p>'}' '
  <h2>Original Title</h2><p id="otitle">'}' '
  <h2>Original Title</h2><p id="otitle">{%value=title}

The statement will be processed from inner to outer {}-brackets. Newlines within single quotes are treated just as newline characters.
#StringReplace... will replace the whole thing with an empty string if <h2>Original Title</h2><p id="otitle">{%value=origtitle}</p> equals <h2>Original Title</h2><p id="otitle">{%value=title}</p>.
#ConditionAdd... and #ConditionAddFirst... are for the case that the "original title" field is empty in the first place. Any HTML code that would be associated with it should then be omitted.

- I updated all of the templates: "HTML Frames", "HTML List", and "HTML Print Layout".
- I changed the behaviour of the menu in "HTML List" as I already did with "HTML Frames" (http://www.videodb.info/forum_en/index.php/topic,1844.msg13919.html#msg13919).
Title: Re: Export template: HTML List (English + German)
Post by: lch on January 16, 2012, 02:39:08 am
Hi svenne,

I love the print layout. Just what I was looking for.

I wonder if you could:
- include viewdate among the details
- allow to trim actors field (sometimes it's huge; two or three lines should do the trick)
- add an option to set the size of the poster (I would like to print a pdf file to be viewed
on my iphone

Thanks for the great work anyway.
Title: Re: Export template: HTML List (English + German)
Post by: svenne on January 17, 2012, 05:02:56 pm
Hi lch,

I added two additional functions to print layout now:

- you can set maximal poster dimensions (max-width, max-height)
- you can trim the actors lists to a maximal number of entries

I think I won't add the viewdate now (the idea rick mentioned was to include this and the personal rating, not too bad... but I'm short on time now. Perhaps I will add this in february, combined with a function that allows to show or hide it).

But if you tell me where you want the viewdate to show up (just below the title? Or below the file specs?) I will tell you where you'd have to add what line... It won't be complicated, I promise!  ;)
Title: Re: Export template: HTML List (English + German)
Post by: rick.ca on January 18, 2012, 03:15:00 am
You might have wisely ignored this...

Maybe you can persuade him to add [Viewed date] to the templates, along with an option to sort by that. If he's going to go to the trouble, it would make sense to include [Rating], and include both at or near the top of the information presented—perhaps right-justified opposite the title.

...but just to be clear, I now realize such sorting options are not really necessary. A list of movies viewed can be sorted by date viewed prior to export, and that's how they will be ordered in the report. If they've been re-sorted by one of the report options, a refresh will return them to the original order. Maybe the options dialog should include a note, "Refresh to return to original order." Or, to be clever, add an option to "Return to original order" that does the same thing. It would be a clue to the user that if the sort order they want isn't listed, they do have the option of exporting the list in the required order.

Quote
But if you tell me where you want the viewdate to show up (just below the title? Or below the file specs?) I will tell you where you'd have to add what line... It won't be complicated, I promise!

If been tinkering with movieiframe.ptm, and having difficulty understanding the conditional statements. Perhaps you could help by illustrating how to add just below the title [viewdate] (if there is one), followed by [rating] (if not 0) then [imdbrating] (if not 0). Thanks.
Title: Re: Export template: HTML List (English + German)
Post by: lch on January 18, 2012, 11:12:06 am
hello svenne,

thanks but i don't see any new options... it looks exactly like previos version.
what am i doing wrong?  where am i supposed to change poster size and actors limit?

Title: Re: Export template: HTML List (English + German)
Post by: svenne on January 18, 2012, 01:18:38 pm
After export (when opened in your browser) the functions are integrated into the menu on the right... Did you replace the old plugin in .\Plugins\Templates\?
Title: Re: Export template: HTML List (English + German)
Post by: lch on January 20, 2012, 02:37:46 pm
hello svenne,

yes it works. got confused with plugins folder instead of template folder.

thanks a bunch for the update: it's great.
 
now, could the viewdate be displayed as first detail
above original title (same font)?

as pointed out, sorting takes care of itself: so all is missing now is
viewdate!!
Title: Re: Export template: HTML List (English + German)
Post by: svenne on January 23, 2012, 12:38:31 pm
Hi!
To have the viewdate appear above 'Original Title' replace the following line (quite at the end of "HTML Print Layout.ptm", line 275)
Code: [Select]
      <h3 class="genre">Genre</h3><p class="genre">{#StringReplace '{%value=genre}' '{%value=genre}' '('}{#ConditionAdd <> '' '{%value=genre}' ')'}</p>{#StringReplace '{#ConditionAddFirst <> '' '{#ConditionAdd <> '' '{%value=origtitle}' '</p>'}' 'with
Code: [Select]
      <h3 class="genre">Genre</h3><p class="genre">{#StringReplace '{%value=genre}' '{%value=genre}' '('}{#ConditionAdd <> '' '{%value=genre}' ')'}</p>{#StringReplace '{#ConditionAddFirst <> '' '{#ConditionAdd <> '' '{%value=viewdate}' '</p>'}' '
      <h3>Seen Date</h3><p>'}' '
      <h3>Seen Date</h3><p>{%value=title}</p>' ''}{#StringReplace '{#ConditionAddFirst <> '' '{#ConditionAdd <> '' '{%value=origtitle}' '</p>'}' '
It looks complicated because of the StringReplace statements. I added those so that empty fields (including their headers) aren't displayed at all. Here, I made viewdate behave the same way now.
Title: Re: Export template: HTML List (English + German)
Post by: lch on January 26, 2012, 01:16:27 am
thx mate, works like a charm.
Title: Re: Export template: HTML List (English + German)
Post by: svenne on January 26, 2012, 09:40:28 am
You're welcome! :)

@rick.ca:
Quote
...movieiframe.ptm (...) conditional statements (...) [viewdate] (...) [rating] (...) [imdbrating]...
I didn't forget about that. Will be addressed soon...
Title: Re: Export template: HTML List (English + German)
Post by: rick.ca on January 26, 2012, 09:14:12 pm
Quote
I didn't forget about that. Will be addressed soon...

Thanks. No rush. I'm more interested in understanding the method of skipping empty fields, so I can make modifications as the need arises.
Title: Re: Export template: HTML List (English + German)
Post by: ouafouaf on February 03, 2012, 12:03:36 pm
Hello there!
Wanted to export my list using your template, which I hadnt used for many months, when a wild bug appeared.

The export goes well, no message, then the html page opens in firefox.
But the files folder wasnt created correctly, it is called "%fname%_files". So yeah nothing works.

Looking around in the template code, I tried to figure out a way around this. I managed to make the thing work by simply replacing all the call for "%fname%_files" as well as "{%value=233}_files" by simply "files". But the film images still wouldn't show up...
I believe the problem is not in the code but somewhere in my pvd config or my system ?

I use windows 7 x64 pro, and pvd 0.9.9.21.
Any idea ? :)
Title: Re: Export template: HTML List (English + German)
Post by: svenne on February 21, 2012, 04:27:42 pm
@rick.ca
The code looks confusing. But it is not as complicated as it seems. There also is a newline character that might add to confusion...
 
Ok, we want to have some HTML code exported along with a value (whenever it is not empty)...

The exported HTML code should look like this:

...\n
  <h2>Header a</h2><p>Value a</p>\n
  <h2>Header b</h2><p>Value b</p>\n
  <h2>Header c</h2><p>Value c</p>\n
...


Note that I added \n to visualize the newline characters.
The blue HTML code is the one associated with {%value=b}. It should be added to {%value=b} if not empty.

We can use ConditionAdd to add the trailing </p> to the value:
{#ConditionAdd <> '' '{%value=b}' '</p>'}

(<> '' = "if it is not empty")

If  {%value=b} is empty then the whole statement will result in an empty string. So we can use ConditionAddFirst with that statement in the same manner to add the other part of the HTML code:
{#ConditionAddFirst <> '' '{#ConditionAdd <> '' '{%value=b}' '</p>'}' '\n  <h2>Header b</h2><p>'}

Remember: \n is a newline character. So in fact the code looks like this:
Code: [Select]
{#ConditionAddFirst <> '' '{#ConditionAdd <> '' '{%value=b}' '</p>'}' '
  <h2>Header b</h2><p>'}


Let‘s add this to the example given in the beginning. It must be added directly to the previous HTML line:

...
  <h2>Header a</h2><p>{%value=a}</p>{#ConditionAddFirst <> '' '{#ConditionAdd <> '' '{%value=b}' '</p>'}' '
  <h2>Header b</h2><p>'}
  <h2>Header c</h2><p>{%value=c}</p>
...


The same code without colors:
Code: [Select]
  <h2>Header a</h2><p>{%value=a}</p>{#ConditionAddFirst <> '' '{#ConditionAdd <> '' '{%value=b}' '</p>'}' '
  <h2>Header b</h2><p>'}
  <h2>Header c</h2><p>{%value=c}</p>



@ouafouaf
Any idea what was changed since your last export?
Since {%value...} and %fname% was not replaced by PWD’s export engine there might be a more severe problem... not only affecting the files folder.
Aren't there problems with other export templates, too?
Title: Re: Export template: HTML List (English + German)
Post by: rick.ca on February 21, 2012, 11:05:58 pm
Quote
The code looks confusing. But it is not as complicated as it seems. There also is a newline character that might add to confusion...

Yes, that's it exactly. My brain had a hard time grasping that, with the #ConditionalAddFirst, the first part of the result came at the end of the statement—on a new line. Thanks for the clear explanation.
Title: Re: Export template: HTML List (English + German)
Post by: arj0n on February 28, 2012, 04:12:15 pm
Svenne, somehow the 'show newest 25 entries' option doesn't seem to work...
(using "HTML Frames + HTML List (English)" from the first post)
Title: Re: Export template: HTML List (English + German)
Post by: svenne on February 28, 2012, 09:14:05 pm
Are there problems in "HTML List" or "HTML Frames" or in both? Doesn't happen anything at all?
Both work fine for me on IE and firefox.
"Show newest 25 entries" should display the last 25 movie records added to your database (this refers to the field "Date added" in Personal Video Database).
Do you use firefox? Then type Ctrl+Shift+J. The error console pops up. Delete the log, retry "show all" and "show newest 25 entries" and tell me if errors show up.
Title: Re: Export template: HTML List (English + German)
Post by: arj0n on February 29, 2012, 09:37:45 am
I use the "HTML Frames" template in Firefox v10.0.2.
There's no difference in showing 'all' or 'the 25 newest', all records keep being shown.

Removed the log in the error console. When switching tabs in FF the console says:

Error: Components.classes['@mozilla.org/extensions/manager;1'] is undefined
Source File: chrome://imdb_preview/content/imdb_preview.js
Line: 1143

Edit:
* in IE9 the same problem occurs: no difference in showing 'all' or 'the 25 newest'.
* Tried running Firefox in safemode to disable all addons: problem still persists.
Title: Re: Export template: HTML List (English + German)
Post by: svenne on February 29, 2012, 12:09:09 pm
Ok, the error shown when switching tabs has nothing to do with the export template and I don't think it has an effect on it.
Try to reload the exported HTML page and see if there are errors in the error console (don't mind two or three warnings showing up). If there aro no additional errors the javascript part seems to work.

By the way, "Show newest 25 entries" would have no effect if "Date Added" (including the time stamp down to the second!) is the same for all exported database entries.
I changed the export templates now. With the new versions, even in this case, only 25 entries should be displayed. Try it. Can the list be trimmed down to 25 entries, now? Than at least the javascript does it's job. But the main problem (the javascript function still being not able to discriminate between newer and older entries) would persist. If you want to you might send me a PM with the exported list (for smaller size leave out the images folder) and I will try to identify the error.
Title: Re: Export template: HTML List (English + German)
Post by: arj0n on February 29, 2012, 01:06:54 pm
Quote
If you want to you might send me a PM with the exported list (for smaller size leave out the images folder) and I will try to identify the error.
Uploaded the result of the template that doesn't work with showing the 25 newest here (http://shutupload.com/dl/b6602c67364d/).

Quote
By the way, "Show newest 25 entries" would have no effect if "Date Added" (including the time stamp down to the second!) is the same for all exported database entries.
For most of the records the timestamp is the same except for the 'seconds' part of the timestamp.

Quote
I changed the export templates now. With the new versions, even in this case, only 25 entries should be displayed. Try it. Can the list be trimmed down to 25 entries, now?
Yes, the new version does trim down indeed to 25 records being shown.
Title: Re: Export template: HTML List (English + German)
Post by: svenne on February 29, 2012, 03:25:14 pm
Ok, got it! :)
The date's format seems to be dependent on system settings.  ::)  The template could only handle the format...
dd.mm.yyyy hh:mm:ss
...but not...
m/d/yyyy h:mm:ss [AM/PM]

Just saw that my templates also will not process the timestamp down to the second, but to the minute. But I think that should be sufficient.

So, here are the new versions. Hope it works fine now.
Title: Re: Export template: HTML List (English + German)
Post by: arj0n on February 29, 2012, 03:29:24 pm
Ok, got it! :)
The date's format seems to be dependent on system settings.  ::)  The template could only handle the format...
dd.mm.yyyy hh:mm:ss
...but not...
m/d/yyyy h:mm:ss [AM/PM]
That's quick!
So the template now can handle 'multi date formats'?

Just saw that my templates also will not process the timestamp down to the second, but to the minute. But I think that should be sufficient.
Down to the minute will be enough indeed.

So, here are the new versions. Hope it works fine now.
Works like charm, THANX!
Title: Re: Export template: HTML List (English + German)
Post by: svenne on February 29, 2012, 03:46:47 pm
Quote
So the template now can handle 'multi date formats'?
No, only the two formats mentioned.
It is too difficult to determine wether the format is dd/mm/yyyy or mm/dd/yyyy...  :-\
I will see if there is a possibility to read out the system's settings or to get the date from PVD as seconds since 1970 or something like that...
Title: Re: Export template: HTML List (English + German)
Post by: arj0n on February 29, 2012, 04:13:13 pm
mmhh, my region setting is:
Short date: d-M-yyyy (and long date: dddd d MMMM yyyy).

Still PVD seems to use: m/d/yyyy. Can't seem to find a setting within PVD to change it (maybe there isn't any?)
Title: Re: Export template: HTML List (English + German)
Post by: svenne on February 29, 2012, 04:28:21 pm
Yikes... the firebird database (PVD uses this) seems to have it's own set of standard date formats:
http://www.firebirdfaq.org/faq137/

So, if I would support the third one, too, would the template work all over the world then?

Nostra might know more about that... Nostra? HEELLLLLP!  ;)
Title: Re: Export template: HTML List (English + German)
Post by: arj0n on February 29, 2012, 04:34:36 pm
What format does your PVD uses?

Quote
So, if I would support the third one, too, would the template work all over the world then?
Well, we'll find out in the next "Export template: HTML List (English + German)" episode, stay tuned folks :-)
Title: Re: Export template: HTML List (English + German)
Post by: svenne on February 29, 2012, 04:38:34 pm
There are at least two... on my computer it's
dd.mm.yyyy hh:mm:ss
Title: Re: Export template: HTML List (English + German)
Post by: arj0n on February 29, 2012, 04:44:00 pm
There are at least two... on my computer it's
dd.mm.yyyy hh:mm:ss

This is odd, I'm 'your neighbour' (if you are german, which is so by looking at the name "Export template: HTML List (English + German)", from the netherlands.
My region is set to dutch/netherlands, so why should I have a different date format in PVD?
Or is the date format changeable within PVD?
(When installed I set the language in PVD to English.)
Title: Re: Export template: HTML List (English + German)
Post by: svenne on February 29, 2012, 04:54:31 pm
Yes, I'm from germany.
Quote
When installed I set the language in PVD to English
Me too.
Which PVD version do you use? 0.9.9.21 or Beta? Perhaps there's a difference? Elsewise it might be the Windows version or the Windows language version?
For now, I will have to do lots of other work... :( but soon I will test different system settings to see if they have an effect...
Title: Re: Export template: HTML List (English + German)
Post by: arj0n on February 29, 2012, 05:09:21 pm
My settings:

PVD: v0.9.9.21
PVD Language: English

OS: Windows 7 professional SP1, 64bit
Windows language: English
Region: Dutch/Netherlands

PVD date format: American (e.g: 2/29/2012 3:56:16 PM) (not adjustable?)
Title: Re: Export template: HTML Frames + HTML List (English + German)
Post by: svenne on May 23, 2012, 12:33:06 pm
Update...

HTML Frames:

- new feature: pimpHTMLframesExport.exe will scan the tag fields, too, and add a tag cloud now (which afterwards can be reached by a link "navigate by tag cloud..." on the initial HTML page of your exported data). Genres and categories are incorporated into the tag cloud as well. Additionally the most frequently appearing actors and directors will find their way into the tag cloud.
There are some options for tag cloud generation. You may alter them in file "tags.ptx":
processtags - if 0 then tags are ignored and not incorporated into the tag cloud
processgenres - if 0 then genres are ignored and not incorporated into the tag cloud
processcategories -  if 0 then categories are ignored and not incorporated into the tag cloud
numberofmostprominentactors - tells pimpHTMLframesExport.exe how many actors should show up in the tag cloud
numberofmostprominentdirectors - tells pimpHTMLframesExport.exe how many directors should show up in the tag cloud
prefixforpersons - you can add a prefix for actors and directors, default is "Person: " (so Alfred Hitchcock would appear as "Person: Alfred Hitchcock" in the tag cloud).

- bugfix: an unwanted ">" appeared with languages of audio streams (at least in the english template)

- bugfix: the menues sometimes did not disapear as they ought to (when clicking somewhere else)

HTML List and HTML Frames:

- date problem fixed (I hope so ;) ): resorting by "Date added" or "show newest 25 entries" could have unexpected results (since date format in Personal Video Database depends on your system settings and the export template could not handle them all). A better approach for recognizing different date formats is used now. Should be quite reliable, but if you still encounter some kind of strange sort behaviour, please let me know. By the way: Even with previous versions of the templates, if the exported HTML files work well on your computer they will work fine even if transferred to a computer with different regional settings, no matter what. Problems occured due to the regional settings at the time of export, only.



[attachment deleted by admin]
Title: Re: Export template: HTML List (English + German)
Post by: arj0n on May 23, 2012, 03:38:07 pm
It is probably asked before but I can't find it anywhere:

Is it somehow possible to use (something like) line breaks in fields like Description and/or Comments?
Title: Re: Export template: HTML List (English + German)
Post by: rick.ca on May 23, 2012, 10:16:10 pm
Quote
- new feature: pimpHTMLframesExport.exe will scan the tag fields, too, and add a tag cloud...

Awesome! 8)

You might want to add a link to toggle between the cloud and movie info panels. It seems the only way to get back to the cloud is to navigate Back, which isn't very convenient or intuitive.
Title: Re: Export template: HTML List + HTML Frames (English + German)
Post by: svenne on May 24, 2012, 10:16:48 pm
@arjon:
- bugfix ;): newlines were treated as white space...

@rick.ca:
- new feature ;D: when navigating on a list filtered by tag cloud a backlink to the tag cloud will appear on the upper right corner. It will disappear if tag cloud filter is not active anymore (after "show all entries", for example)
Title: Re: Export template: HTML List (English + German)
Post by: rick.ca on May 25, 2012, 02:38:15 am
Quote
when navigating on a list filtered by tag cloud a backlink to the tag cloud will appear on the upper right corner.

Thanks!
Title: Re: Export template: HTML List (English + German)
Post by: rick.ca on May 25, 2012, 03:24:32 am
Oops. I hate to say it—the backlink seemed so clever—but it's not a complete solution. Yes, now you can select a tag from the cloud, see a list of those movies, select a movie to see its details, then use the link to return to the cloud. But sooner or later, you'll want to return to a full list. To do that, you have to refresh or select 'show all entries'. After doing so, the link and tag cloud are gone for the session. The only way to get them back is to reload the page.

Wouldn't it be simpler and easier just to provide fixed radio buttons or links that force it one way or the other? Selecting the one that's already shown would do nothing, but I can't imagine anyone getting confused over that.
Title: Re: Export template: HTML List + HTML Frames + Print Layout (English + German)
Post by: svenne on May 25, 2012, 09:47:59 am
Ok, I just made the "tag cloud" backlink permanent...
Title: Re: Export template: HTML List (English + German)
Post by: rick.ca on May 25, 2012, 11:07:44 am
Quote
Ok, I just made the "tag cloud" backlink permanent...

That was fast. Thanks.

BTW, I'm now using this to create lists for a website. Nothing fancy, but maybe something I can direct a friend to for choosing a movie to watch. Or so they can see the movie they were going to suggest I've already seen and rated a 3. Anyway, while doing this I realized the 'Wish' tag was of no use, but what I really needed was a 'Bookmark' tag. I could use that for anything, including just marking items temporarily for the purpose of the list (e.g., to mark 'recommended' movies or 'chick flix'). I was surprise to find all I had to do was change 'wish' to 'bookmark' in HTML Frames.ptm.

So I'm happy, but you might want to add a green dot for bookmarked items, and support all three flags. Any categorization not available by other means could then be handled by bookmarking the items before exporting (and then changing the caption in empty.html). If you care to take that a step further, maybe get user input for the bookmark caption, and then place a legend under the list panel. Third party users (like those visiting my website) aren't likely to remember what the dots mean, even if they do read the explanation at the beginning.

Sorry, I have to make suggestions when something is this good.  :) 

Thanks again—I appreciate your work.
Title: Re: Export template: HTML List (English + German)
Post by: svenne on May 26, 2012, 01:54:57 pm
Quote
...aren't likely to remember what the dots mean
If you hover the mouse pointer over the dots a label tells what it is.

Quote
...you might want to add a green dot for bookmarked items
Bookmarking and setting the filter "bookmarked" in PVD is the best and easiest way to export a custom selection of movies. But in that case I won't like to have dots in front of all entries... :(

But if you want to have an additional green dot for bookmarks just add the following code directly after %HEAD% <li> in "HTML Frames.ptm"
Code: [Select]
{#StringReplace '{#StringReplace '{%value=bookmark}' '0' ''}' '-1' '<span style="color:#66FF66;font-weight:bold;" title="bookmarked!">&bull;&nbsp;</span>'}
In PVD you my also add a custom item with type "checkbox". If you called it "DOTTY" you would add the following code to "HTML Frames.ptm" to get a dot for that...
Code: [Select]
{#StringReplace '{#StringReplace '{%value=DOTTY custom="true"}' '0' ''}' '-1' '<span style="color:#66FF66;font-weight:bold;" title="DOTTY!">&bull;&nbsp;</span>'}I'm quite sure you don't want to call it "DOTTY"...  :)
Call it as you like and replace the two occurances of DOTTY within the code snippet with the name you chose.

Quote
...maybe get user input for the bookmark caption
For export templates all interaction possible with the user is the "Save as" dialog. Or am I wrong?
Title: Re: Export template: HTML List (English + German)
Post by: rick.ca on May 26, 2012, 09:14:25 pm
Quote
If you hover the mouse pointer over the dots a label tells what it is.

I never noticed. The dots aren't really big enough for hover tips. It doesn't matter, but I wonder if it's possible to highlight the list item and add a hover tip to it.

Quote
Bookmarking and setting the filter "bookmarked" in PVD is the best and easiest way to export a custom selection of movies.

If by 'custom' you mean 'ad hoc'. Otherwise, using Filters and Search (or Advanced Search) is more effective. But I see your point. I can still use bookmarking to select those I want the 'dotty flag' on. ;)

Quote
I'm quite sure you don't want to call it "DOTTY"...

Actually, I was going to suggest this, then I figured using bookmarking would be more convenient. I already have a [Flag] field—for which the caption shall be 'flagged' and the explanation 'Flagged: [reason]'. That works better than 'dottied'. ;)

Thanks for the code. Now I just have to decide which to use, or both...

Quote
For export templates all interaction possible with the user is the "Save as" dialog. Or am I wrong?

I'm sure you're not. I was thinking of the interaction provided in the Print List page, and assuming something might be possible. But obviously it's too late once the page is generated.

Is is possible to set a variable in the header section of the template (easily changed by editing the template) that could then be used in empty.html?
Title: Re: Export template: HTML List (English + German)
Post by: rick.ca on May 27, 2012, 03:41:44 am
Update

I couldn't get the 'dotty method' to work. I have no idea why—it seems straightforward enough. But the 'bookmark method' is working fine for what I need to do.  :-\

Quote
Is is possible to set a variable in the header section of the template (easily changed by editing the template) that could then be used in empty.html?

I no longer believe this is necessary. This is probably of no interest to anyone, but I have to express my happiness at being able to use the tools I already have to get a job done. The rather busy screenshot is meant to convey that after I export a report, I select it in Directory Opus, click a button, and empty.html opens in my editor at the same time the report is opened in my browser. At this point, I change the report title and tag captions to whatever I want them to be, and add any necessary comments. 8)

Since these are being launched from a website by users unfamiliar with the report or anything about PVD, I think I'll always want to fine-tune this to provide whatever explanation is necessary.

I do, of course, have another question. Can a button or link be added to return to empty.html? I have a button in Firefox that goes back to the first page opened, but I doubt other do (or would think to use it). I know the following works in Firefox...

Code: [Select]
javascript:window.history.go(-(window.history.length%20-%201))
...but haven't a clue whether it does in all browsers, or how to add it if it does. If I'm going to use the page this way, I think my users are likely to want to go back to it.

[attachment deleted by admin]
Title: Re: Export template: HTML Frames (English + German)
Post by: svenne on May 27, 2012, 04:45:22 pm
Quote
I couldn't get the 'dotty method' to work.
Hmmm, it should work. I use that myself. ??? (So if you or anyone else wants to customise the templates that way someday, I could try to assist.)

Update for HTML Frames:

- bugfix: with 25 or less exported entries it was impossible to reset filters

- added backlink to start page (where the legend for the colored dots can be found)

- optimised display behaviour of backlinks; and a bugfix, too... the backlink to the tag cloud vanished after reload
Title: Re: Export template: HTML List (English + German)
Post by: rick.ca on May 27, 2012, 11:01:38 pm
Quote
Hmmm, it should work. I use that myself. ??? (So if you or anyone else wants to customise the templates that way someday, I could try to assist.)

I know, I must have been doing something stupid and unable to see it. But the bookmark method works for now. I'll wait until I have a real problem because I can't use the flag method. That day may never come, because I can always set and use the flag as a basis for selection, then use bookmarks for tagging. ;)

It's for family and friends, but you may be interested in rix flix (http://www.rick1ca.webuda.com/) to see how I've made use of your templates. You'll see from the IMDb Top 100 report, I'm starting to get dangerous. 8)
Title: Re: Export template: HTML List (English + German)
Post by: svenne on June 13, 2012, 10:55:03 am
Really not bad! Neat way to share a nice hobby...
Title: Re: Export template: HTML List (English + German)
Post by: Ivek23 on June 13, 2012, 12:04:55 pm
It's for family and friends, but you may be interested in rix flix (http://www.rick1ca.webuda.com/) to see how I've made use of your templates. You'll see from the IMDb Top 100 report, I'm starting to get dangerous.
Really not bad! Neat way to share a nice hobby...

Nice, interesting and also instructive.
Title: Re: Export template: HTML List (English + German)
Post by: rick.ca on June 13, 2012, 08:38:09 pm
Thanks, both. It won't get much use, and I added the Analytics page to prove it. But I wanted to see how sharing the data might be done. I was surprised at how easy it was to set up a free website. And using this template has to be easier than other methods being used.
Title: Re: Export template: HTML List (English + German)
Post by: Ivek23 on June 14, 2012, 05:08:48 am
Thank you, Rick.
Title: Re: Export template: HTML List (English + German)
Post by: arj0n on December 02, 2012, 04:01:05 pm
Hi Svenne,

I installed Win8Pro and PVD and extracted the latest "HTML Frames + HTML List (English).zip" to C:\Program Files (x86)\Personal Video Database\Plugins\Templates\
When running the export it turns out in this browser message:
"Firefox can't find the file at /C:/Users/Arjon/My Personal Video Databases/Exp/_files/empty.html."

The export location is:  C:\Users\Arjon\My Personal Video Databases\Exp\
In that directory the file "PVDExport.html" has been created plus the directory "%fname%_files".

I guess there's the problem but I can't figure out for now why that directory is called "%fname%_files"...
Title: Re: Export template: HTML List (English + German)
Post by: svenne on December 03, 2012, 08:11:39 pm
%fname% should be the filename you chose in the "Save as..."-dialog. With Win8Pro something seems to go wrong. The filename seems not to be handed over to the export script. In your case "%fname%" should have been replaced with "PVDExport". You could rename the directory "%fname%_files" to "PVDExport_files" by hand. Also, you would have to rename every occurrence of "%fname%_files" (or maybe "_files") in PVDExport.html and within every movie*.html in the (renamed) directory "PVDExport_files"...

Perhaps the behaviour changes if you export to another location (desktop, C:\, USB-Stick, ect.)?

Nonetheless, this seems to be a bug of Personal Video Database in combination with Windows 8.
Maybe nostra can do something...

Title: Re: Export template: HTML List (English + German)
Post by: nostra on December 05, 2012, 12:16:31 pm
Can you reproduce the problem, svenne? Because I can't...
What PVD Version are you using? (I have tested it with my current 1.x build)
Title: Re: Export template: HTML List (English + German)
Post by: svenne on December 05, 2012, 12:32:01 pm
No, I can't. I don't have Windows 8...
Maybe someone else out there could try and see if it is reproducible?
Don't know which PVD-Verion arj0n works with.
Title: Re: Export template: HTML List (English + German)
Post by: arj0n on December 05, 2012, 01:22:21 pm
Hi Nostra,

I stumbled upon this issue using PVD v0.9.9.21 while running Win8Pro.

Here's how:

-My database was created using Win7Pro & PVD v0.9.9.21,
-OS upgraded to Win8Pro,
-Installed PVD v0.9.9.21,
-Extracted Svenne's latest "HTML Frames + HTML List (English).zip" to C:\Program Files (x86)\Personal Video Database\Plugins\Templates\,
-Reopened my database,
-Exported to C:/Users/Arjon/My Personal Video Databases/Exp/<exportname>,
-The underlying directory is named "%fname%_files" instead of the proper exportname...

I can try if it does work using PVD v1.0.2.3 Beta.
Will let you know.
Title: Re: Export template: HTML List (English + German)
Post by: arj0n on December 07, 2012, 11:34:57 am
This is odd:

Today I tried both the stable and the beta and now for both the HTML Frames export did work.
Don't know why this error occurred a few days ago, but it doesn't seem to be a bug now anymore.

Sorry and thanx for your time.
Title: Re: Export template: HTML List (English + German)
Post by: svenne on April 13, 2013, 03:52:14 pm
I had the same problem with a fresh installation of PVD 0.9.9.21 from the download page, now. Didn't get rid of it until I switched to version 1.0.2.x ???

By the way, I modified my export plugins to work with version 1.0.2.5 (RC) (http://www.videodb.info/forum_en/index.php/topic,3326.0.html). In previous versions link type ID pointed to the (hidden/internal) "Database Rocord ID" (aka MID) (http://www.videodb.info/forum_en/index.php/topic,3158.msg15409.html#msg15409). Now link type "ID" points to "Movie ID" (that is the one you can see and edit in PVD). Because the export plugins (including those that come with the 1.0.2.5 (RC) (http://www.videodb.info/forum_en/index.php/topic,3326.0.html) installation package) still resembled the old behaviour, ID links were broken when exported.

I fixed that. New files are attached...

If you want to create ID links that, again, behave as they used to in versions 0.9.x.x: use <link mid=... instead of <link id=... in PVD.

[attachment deleted by admin]
Title: Re: Export template: HTML List (English + German)
Post by: svenne on August 04, 2014, 01:59:51 am
Hi Nostra... why was the attachment deleted?
Title: Re: Export template: HTML List (English + German)
Post by: goddert on August 12, 2014, 11:02:14 am
May we know why the attachment was deleted or is it a secret? I was looking for it needing some sample code.
Thanks
Title: Re: Export template: HTML List (English + German)
Post by: svenne on August 15, 2014, 12:44:58 pm
Maybe it was by mistake. I'm sure there would be a comment if they fell in disgrace out of a sudden or something. Here they are again...
Title: Re: Export template: HTML List (English + German)
Post by: svenne on September 04, 2014, 07:32:28 pm
Some kind of major update... :-)

"HTML Frames" now supports...

- "IMDB Rating" and "Rating"
- "Connections"
- "Tags"

"Further options..." button now also provides sort by "IMDB Rating" or "Rating"

Additional features generated by "pimpHTMLframesExport" (after export this tiny executable can be found in subfolder "(filname)_files\pimpHTMLframesExport\") don't result in thousands of small HTML files anymore. Now, all the additional links act as filters (altering the movie list instead of linking to seperate pages). You can always get back to the full list by selecting "show all entries" (near the "Further options..." button)

Some minor bugs were fixed (and maybe some new ones generated... so let me know if you notice strange behaviour).

Have fun
Title: Re: Export template: HTML List (English + German)
Post by: svenne on September 06, 2014, 12:33:27 pm
...and some kind of minor update... ;-)

- the active movie link always lost focus after rearranging/filtering the list. That was a little bit annoying so I changed it.

- added some descent artwork
Title: Re: Export template: HTML List (English + German)
Post by: svenne on September 07, 2014, 11:23:42 pm
- added: search function
- bug fix: two coding issues handicapped speculative parsing by the browser

The search function does a full text search. It crawls through each and every movie page in the list (but only through visible entries), which means it is quite slow. Especially when running online (in that case it might take about 30 seconds for 100 movies). Do you like it nevertheless? What do you think? Should I take it out again or keep it?
I added a cache for this function. So if you search a second time (and it doesn't matter if it's for a different search phrase, of course) it will be a lot faster... The cache will persist unless you do a full reload in your browser.
Title: Re: Export template: HTML List (English + German)
Post by: OOmatrixOO on September 21, 2014, 10:42:52 am
Thanks for this update. Works good for me and i like the search function.
Title: Re: Export template: HTML List (English + German)
Post by: OOmatrixOO on December 18, 2015, 10:31:57 am
Hello.
Can i somehow disconnect the URLs that they are clickable?
I have 2 URLs per movie. When you export is it one URL but then it is not usable.


URL Code:
Code: [Select]
<h3 class="cat">URL</h3>
      <div class="descr"><span class="info2">URL:</span> <a href="{%value=url}"> {%value=url}</a></div>

(http://abload.de/thumb/screen_20151218_102631xyhx.png) (http://abload.de/image.php?img=screen_20151218_102631xyhx.png)
Title: Re: Export template: HTML List (English + German)
Post by: mgpw4me on December 19, 2015, 05:42:16 pm
You can insert some Javascript into the template. 

The following code supports 1 or more urls, separated by one or more spaces. Tested in Firefox.

Code: [Select]
<h3 class="cat">URL</h3>
 <div class="descr"><span class="info2">URL:</span>
  <Script>
   var url = '{%value=url}';
   var urls = url.split(" ");
   for (i in urls)
     if (urls[i].length > 1)
      document.write('&nbsp;<a href="' + urls[i] + '">' + urls[i] + '</a>&nbsp;' );
  </Script>
 </div>
Title: Re: Export template: HTML List (English + German)
Post by: OOmatrixOO on December 20, 2015, 10:11:35 am
Thats great. It works perfect. Thank you.
Title: Re: Export template: HTML List (English + German)
Post by: mgpw4me on December 22, 2015, 03:09:27 am
I'm glad it's what you wanted.  An improvement (?) might be to open the links in separate tabs.

Code: [Select]
document.write('&nbsp;<a href="' + urls[i] + '" target="_newtab' + i + '">' + urls[i] + '</a>&nbsp;' );
Title: Re: Export template: HTML List (English + German)
Post by: svenne on February 12, 2016, 09:02:25 pm
I think I will add this to the original scripts, too.
Title: Re: Export template: HTML List (English + German)
Post by: Lastdino on February 24, 2016, 02:15:12 pm
Hi! I'm using PVD for many years now and since I think that this is my first post on this forum, first I wanna thanks to the author and everyone else who contributed to this great piece of software. I''m using version 1.0.2.7 (I guess it's the last one) and I did some modifications on top of the HTML Frames export template (which I think is based on the work of svenne), basically some filters for movie year and genre, alphabet links, a search button for movies title only (which I see now that in the last version of the template exist a form of search too), duration, rating, genre of movies in the list of titles, and some others. So I thought to put a link here to a site with a collection of my movies with these modifications and if someone is interested to some of this I can upload the template of course.
I hope I don't offend anyone for posting here but since this is the thread of the HTML Frames export template I thought it's the right place to do it.
http://lastdino.cu.cc/HTML_frames_complet/HTML_frames.html (http://lastdino.cu.cc/HTML_frames_complet/HTML_frames.html)
Thanks everyone and keep up the good work!
Title: Re: Export template: HTML List (English + German)
Post by: svenne on February 27, 2016, 11:57:08 am
Not offended at all. Thanks for your contribution.  :)
Title: Re: Export template: HTML List (English + German)
Post by: afrocuban on March 11, 2017, 07:53:52 pm
Hello and thank you for this great template.

I don't know anything about Javascript, so I'm kindly asking you to explain to me where should I put, and which piece of code, in order to get "pvdid. Title" output in movie list in the left frame. I'd like to get the same for the chosen movie name in right frame.

I see <span class="pvdid"> (ID: {%value=num})</span> in "HTML Frames (English).ptm", but nowhere in the exported pages.

Thank you in advance!
Title: Re: Export template: HTML List (English + German)
Post by: svenne on March 21, 2017, 01:44:24 pm
Hi!
I only had the IDs implemented to keep references/links vivid (those links that can be generated within PVD in description or other fields and set to point to other movies in the list: right mouse-click on the part of the text you want to become a link and choose "Create Hyperlink").
The exported IDs are hidden via CSS.

If you want to see them edit
\HTML Frames\main.css
Search für pvdid (it only occurs once in line 158)
delete #list ul li a span.pvdid, within that line.

To put the ID in front of the title edit
HTML Frames (English).ptm
Find the long line starting with %HEAD% (should be line 51).
Find <span class="pvdid"> (ID: {%value=num})</span> and put that in front of <span class="mtitle"> within the same line. It should read now
...target="movie"><span class="pvdid"> (ID: {%value=num})</span><span class="mtitle">{%value=title}...
Feel free to change the ID portion as you like, perhaps
<span class="pvdid">No {%value=num} - </span>
or
<span class="pvdid">{%value=num}. </span>

Count the characters in front of {%value=num}. Originally there were 6 (including spaces: " (ID: "). To keep references/links working, edit
\HTML Frames\frame.js
and change line 68:
Code: [Select]
if (sl[i].firstChild && sl[i].className == "pvdid" && sl[i].firstChild.data.substring(6,(6+sx.length))==sx)As you see there is number 6 twice. Correct both. If you don't have any characters in front of {%value=num}, than it should be 0 here, of course:
Code: [Select]
if (sl[i].firstChild && sl[i].className == "pvdid" && sl[i].firstChild.data.substring(0,(0+sx.length))==sx)
Don't add {%value=num} to <h1 id="mtitle">...</h1> in file
\HTML Frames\movieiframe.ptm
It would break the javascript search function and certain filters.
You might add <h2 id="pvdid">{%value=num}</h2> to that line so it looks like...
Code: [Select]
  <h2 id="pvdid">{%value=num}</h2><h1 id="mtitle">{%value=title}</h1>{#StringReplace '{#ConditionAddFirst <> '' '{#ConditionAdd <> '' '{%value=origtitle}' '</p>'}' '
  <h2>Original Title</h2><p id="otitle">'}' '
  <h2>Original Title</h2><p id="otitle">{%value=title}</p>' ''}
Add the following code to \HTML Frames\frame.css and the ID will be inline and formatted the right way:
Code: [Select]
#pvdid
{
  float:left;
  padding-right:0.5em;
  margin:0px 0px 0.4em 0px;
  padding:0px 0.5em 0px 0px;
  font-size:1em;
}
#pvdid:after
{content:"";}
Title: Re: Export template: HTML List (English + German)
Post by: afrocuban on March 25, 2017, 08:38:27 pm

Dear svenne,

Thank you so much! This was best ever guide for dummies. I did it at first following your tips and it was exactly, exactly, exactly I was looking for. Thank you once again.

Now, I wouldn't want this to become a Javascript training course, but I did my best, using logic of course, to change movieiframe.ptm to change the order of fields that suits me best, but had no luck.  I have succeeded with moving actors by simply cutting/pasting the line, but not with other fields.

May I kindly ask you (how) to arrange the code so I could achive this order of fields:

year, director, genre, imdb rating, orating, rating, duration, actors, description, comments, writers, composers, producers, filesize, video, audio, subtitles, category, tags

I promise, I won't bother you anymore after this. Thank you so much in advance.
Title: Re: Export template: HTML List (English + German)
Post by: svenne on March 29, 2017, 10:59:28 am
You may bother me whenever you want.

Just a short anwer for the time being. I can give more detailed code snippets later this week.
But perhaps this is already sufficient.
This is not JavaScript. It consists of PVD's own functions, see help section:
http://www.videodb.info/help/hlp_export.html

In movieiframe.ptm there are two kinds of code sections, one is very simple and looks like this:
Code: [Select]
  <h2>Country</h2><p id="country">{%value=country}</p>
It starts with a newline.
It will always show up in the exported file, even if the country field in PVD is empty. In the latter case the exported source code will look like this:
Code: [Select]
  <h2>Country</h2><p id="country"></p>

The other kind looks like this:
Code: [Select]
{#ConditionAddFirst <> '' '{#ConditionAdd <> '' '{%value=writers}' '</p>'}' '
  <h2>Writer</h2><p id="writers">'}
This code snippet always starts without newline with {#ConditionAddFirst... and ends with ...} in the following line (also without newline at the end).
It is used to omit fields completely if they are empty. The corresponding HTML tags are only written to the exported file (with ConditionAddFirst and ConditionAdd) if {%value=writers} is not empty. It looks more complicated than it is. The newline before <h2> is part of the statement, it is in quotation marks. See last character in the preceding line. This newline is within the ConditionAdd statement.


Title: Re: Export template: HTML List (English + German)
Post by: afrocuban on April 02, 2017, 08:13:49 pm
Dear svenne,

As usual, great guide! Thank you so much and keep up good working.

I was just wondering ow is it possible to add custom fields to your template (namely, Rottentomatoes rating(s) and links to IMDb, AllMovie and Rottentomatoes), but it is a SF to me at the moment, so I'm asking Lastdino to upload his template so we could further customize it, if svenne has nothing against it of course.

This is for my family and friends who doesn't want to install PVD to see my collection, so once again many thanks to svenne.

Kind regards,
afrocuban
Title: Re: Export template: HTML List (English + German)
Post by: svenne on April 05, 2017, 02:03:39 pm
You should be able to add custom fields with this code...

Code: [Select]
{#ConditionAddFirst <> '' '{#ConditionAdd <> '' '{%value=XYZ custom="true"}' '</p>'}' '
  <h2>XYZ</h2><p>'}

Put your custom field's name instead of XYZ (case sensitive, I think, but I'm not sure).
Feel free to play around with my template.

Kind regards,
svenne
Title: Re: Export template: HTML List (English + German)
Post by: afrocuban on May 15, 2017, 11:02:27 pm
Being away for a while, but I'm really grateful. Thank you so much, svenne!
Title: Re: Export template: HTML List (English + German)
Post by: Lastdino on June 22, 2017, 12:33:40 pm
I just recently saw that you wanted to experiment with my template afrocuban. If it's of any interest to you or anyone else here it is
Title: Re: Export template: HTML List (English + German)
Post by: Lastdino on June 22, 2017, 01:14:48 pm
I noticed that the link from my signature isn't working anymore and until I can fix it I'm uploading here a printscreen to see how my template looks now.
Title: Re: Export template: HTML List (English + German)
Post by: afrocuban on June 27, 2020, 03:25:31 pm
They say it's never too late - thank you Dino!
Title: Re: Export template: HTML List (English + German)
Post by: afrocuban on July 19, 2020, 12:39:37 am
Unfortunately, I'm having some issues with Lastdino's template:

This is what happens after exporting (https://pvdgojko.github.io/index.html).

Can someone help please?