Author Topic: Export template: HTML List (English + German)  (Read 188243 times)

0 Members and 5 Guests are viewing this topic.

Offline svenne

  • Power User
  • ****
  • Posts: 145
    • View Profile
Re: Export template: HTML List (English + German)
« Reply #160 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
« Last Edit: September 07, 2014, 11:25:05 pm by svenne »

Offline svenne

  • Power User
  • ****
  • Posts: 145
    • View Profile
Re: Export template: HTML List (English + German)
« Reply #161 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.
« Last Edit: September 10, 2014, 07:26:22 pm by svenne »

Offline OOmatrixOO

  • User
  • ***
  • Posts: 41
    • View Profile
Re: Export template: HTML List (English + German)
« Reply #162 on: September 21, 2014, 10:42:52 am »
Thanks for this update. Works good for me and i like the search function.

Offline OOmatrixOO

  • User
  • ***
  • Posts: 41
    • View Profile
Re: Export template: HTML List (English + German)
« Reply #163 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>


mgpw4me

  • Guest
Re: Export template: HTML List (English + German)
« Reply #164 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>

Offline OOmatrixOO

  • User
  • ***
  • Posts: 41
    • View Profile
Re: Export template: HTML List (English + German)
« Reply #165 on: December 20, 2015, 10:11:35 am »
Thats great. It works perfect. Thank you.

mgpw4me

  • Guest
Re: Export template: HTML List (English + German)
« Reply #166 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;' );
« Last Edit: December 22, 2015, 03:12:17 am by mgpw4me »

Offline svenne

  • Power User
  • ****
  • Posts: 145
    • View Profile
Re: Export template: HTML List (English + German)
« Reply #167 on: February 12, 2016, 09:02:25 pm »
I think I will add this to the original scripts, too.

Offline Lastdino

  • Member
  • *
  • Posts: 4
    • View Profile
    • Personal Movies Database
Re: Export template: HTML List (English + German)
« Reply #168 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
Thanks everyone and keep up the good work!

Offline svenne

  • Power User
  • ****
  • Posts: 145
    • View Profile
Re: Export template: HTML List (English + German)
« Reply #169 on: February 27, 2016, 11:57:08 am »
Not offended at all. Thanks for your contribution.  :)

Offline afrocuban

  • Moderator
  • *****
  • Posts: 476
    • View Profile
Re: Export template: HTML List (English + German)
« Reply #170 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!

Offline svenne

  • Power User
  • ****
  • Posts: 145
    • View Profile
Re: Export template: HTML List (English + German)
« Reply #171 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:"";}
« Last Edit: March 21, 2017, 01:53:13 pm by svenne »

Offline afrocuban

  • Moderator
  • *****
  • Posts: 476
    • View Profile
Re: Export template: HTML List (English + German)
« Reply #172 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.

Offline svenne

  • Power User
  • ****
  • Posts: 145
    • View Profile
Re: Export template: HTML List (English + German)
« Reply #173 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.


« Last Edit: March 29, 2017, 11:02:57 am by svenne »

Offline afrocuban

  • Moderator
  • *****
  • Posts: 476
    • View Profile
Re: Export template: HTML List (English + German)
« Reply #174 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

Offline svenne

  • Power User
  • ****
  • Posts: 145
    • View Profile
Re: Export template: HTML List (English + German)
« Reply #175 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

Offline afrocuban

  • Moderator
  • *****
  • Posts: 476
    • View Profile
Re: Export template: HTML List (English + German)
« Reply #176 on: May 15, 2017, 11:02:27 pm »
Being away for a while, but I'm really grateful. Thank you so much, svenne!

Offline Lastdino

  • Member
  • *
  • Posts: 4
    • View Profile
    • Personal Movies Database
Re: Export template: HTML List (English + German)
« Reply #177 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

Offline Lastdino

  • Member
  • *
  • Posts: 4
    • View Profile
    • Personal Movies Database
Re: Export template: HTML List (English + German)
« Reply #178 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.

Offline afrocuban

  • Moderator
  • *****
  • Posts: 476
    • View Profile
Re: Export template: HTML List (English + German)
« Reply #179 on: June 27, 2020, 03:25:31 pm »
They say it's never too late - thank you Dino!

 

anything