Author |
Message |
Registered: June 9, 2007 | Posts: 1,208 |
| Posted: | | | | Is it possible to make a HTML window to house a link to a file on my pc? I currently do this with <A HREF="F:\TRAILERS\napoleon_dynamite_m480.mov">Play Trailer</A> in the notes but I would rather have a HTML window that could be made smaller. |
|
Registered: June 9, 2007 | Posts: 1,208 |
| Posted: | | | | I guess what I'm wondering is how can I get the html window to read the path from the notes section and then make a link out of that. |
|
Registered: March 13, 2007 | Posts: 793 |
| Posted: | | | | Take a look at either the Tagline, Wikipedia or IMDb threads, they should tell you how to extract your code from the notes. Then it's only a matter of placing it at the right place in the html code. |
|
Registered: March 15, 2007 | Reputation: | Posts: 5,459 |
| Posted: | | | | Not sure if this is what you're after, but try this code:
<HTML> <HEAD>
<SCRIPT TYPE="text/javascript"> <!-- <DP NAME="HEADER_VARS" Language="JavaScript" Comments="True" IncludeCast="False" IncludeCrew="False"> //--> </SCRIPT>
</HEAD> <BODY> <script> var sint = DP_Notes.indexOf('<A HREF=') if (sint == -1){ var link = ''} else { link = DP_Notes.substring(sint, DP_Notes.indexOf('</A>', sint)); } document.write(link) </script> </BODY> </HTML>
See if that does what you want it to do. | | | Last edited: by northbloke |
|
Registered: June 9, 2007 | Posts: 1,208 |
| Posted: | | | | That works nicely, cheers. Just one small problem. The bit of code at the end now also contains the link. Quote: <HTML> <HEAD> <style type="text/css"> <!-- * { color: black; font-family: verdana; font-size: 9pt; } html, body { margin: 0; padding: 0; background-color: rgb(255, 204, 102); } body { background-repeat: repeat-x; background-image:url($DPIMAGES.bgimage.jpg); } .title { font-size: 12pt; font-weight: bold; margin-top: 15pt; margin-bottom: 15pt; width: 100%; text-align: center; } .images { padding: 5; } span { margin: 5; background-color: black; border-width: 5px; border-style: double; } span.off { border-color: gray; } span.on { border-color: white; } img { cursor: hand; } --> </style>
<SCRIPT TYPE="text/javascript"> <!-- <DP NAME="HEADER_VARS" Language="JavaScript" Comments="True" IncludeCast="False" IncludeCrew="false"> //--> </SCRIPT>
</HEAD> <BODY>
<DP NAME="LAYERS" Dual="** DUAL LAYER **" Single=""> <BR><BR>
<B><DP NAME="TITLE"></B> <BR><BR>
<DP NAME="PURCHDATE" Prefix="Added- "> <BR><BR>
<DP NAME="DISCS" SubDivider=" - " ShowDescriptions="true" Divider="<BR><BR>" ShowSlots="true" ShowLocations="true"> <BR><BR>
<script> var sint = DP_Notes.indexOf('<A HREF=') if (sint == -1){ var link = ''} else { link = DP_Notes.substring(sint, DP_Notes.indexOf('</A>', sint)); } document.write(link) </script> <BR><BR>
<script language="JavaScript"> last_watch_on = "<DP NAME="LAST_WATCHED_ON">";
if ( last_watch_on.length != 0 ){ document.write("Last watched: " + last_watch_on); } </script>
</BODY> </HTML> Also is it possible to make the link with a collection number? So I could name all the trailers the collection number then there would be no need for anything in notes at all. Or would the fact that there isnt a default path be a problem? Most trailers are in 'F:\trailers' but some are in a subfolder of their own (video_ts) as they are ripped from dvd. |
|
Registered: March 15, 2007 | Reputation: | Posts: 5,459 |
| Posted: | | | | You could change the code to go by collection number instead so it didn't have to check notes, but not having all your trailers in one place would be a big problem!
Using this code instead:
<script> link = "F:\\Trailers\\" + DP_CollectionNumber + ".mov" document.write("<A href=" + link + ">Play Trailer</a>") </script>
Will create a link to the Trailers folder using the collection number as the name of the movie file. But all trailers will have to be in the same place. |
|
Registered: June 9, 2007 | Posts: 1,208 |
| Posted: | | | | cheers will give that a go. Cant help the trailers being in a different place I'm afraid. They wont play if not in their own folder.
Would it not be possible to have 2 lots of code, 1 for the normal .mov trailers all in 'f:\trailers' then another for the dvd trailers. The latter would be 'f:\trailers\coll#\video_ts.ifo? And use a tag to determine which code to use? | | | Last edited: by MarEll |
|
Registered: June 9, 2007 | Posts: 1,208 |
| Posted: | | | | How do I use a tag as a condition in a HTML window? I think once I know this I could do a fair bit of what I want myself.
Edit: OK I no longer need to keep the trailers in different locations. I just need to use the tags to determine what the file extension is. | | | Last edited: by MarEll |
|
Registered: March 14, 2007 | Reputation: | Posts: 1,029 |
| Posted: | | | | Quoting MarEll: Quote: How do I use a tag as a condition in a HTML window? I think once I know this I could do a fair bit of what I want myself. The fully qualified tags for the current profile are in the DP_Tags array, provided you use HEADER_VARS. So you have to check the array for the tags that indicate your condition, e.g. var i; for (i = 0; i < DP_Tags.length; i++) { switch (DP_Tags[i]) { case "mysupertag/mysubtag1": // Do something break; case "mysupertag/mysubtag2": // Do something else break; case "mysupertag/mysubtag3": // Do something different break; } } | | | Matthias |
|
Registered: June 9, 2007 | Posts: 1,208 |
| Posted: | | | | How do I use that though? I tried it like this (I know its not right but..)
var i; for (i = 0; i < DP_Tags.length; i++) { switch (DP_Tags[i]) { case "ztrailer/WMV": <script> link = "F:\\Trailers\\" + DP_CollectionNumber + ".wmv" document.write("<A href=" + link + ">Play Trailer</a>") </script>
break; case "ztrailer/MOV": <script> link = "F:\\Trailers\\" + DP_CollectionNumber + ".mov" document.write("<A href=" + link + ">Play Trailer</a>") </script>
break; case "ztrailer/VOB": <script> link = "F:\\Trailers\\" + DP_CollectionNumber + "vob" document.write("<A href=" + link + ">Play Trailer</a>") </script>
break; } } | | | Last edited: by MarEll |
|
Registered: March 14, 2007 | Reputation: | Posts: 1,029 |
| Posted: | | | | Try this: Quote:
<HTML> <HEAD> <SCRIPT language=javascript> <DP NAME="HEADER_VARS" Language="JavaScript" Comments="False" IncludeCast="False" IncludeCrew="False"> </SCRIPT>
<SCRIPT language=javascript> window.onload = window_onload; function window_onload() { var i; myloop: for (i = 0; i < DP_Tags.length; i++) { switch (DP_Tags[i]) { case "ztrailer/WMV": idPlay.href = "F:\\Trailers\\" + DP_CollectionNumber + ".wmv"; break myloop; case "ztrailer/MOV": idPlay.href = "F:\\Trailers\\" + DP_CollectionNumber + ".mov"; break myloop; case "ztrailer/VOB": idPlay.href = "F:\\Trailers\\" + DP_CollectionNumber + ".vob"; break myloop; } } if (i >= DP_Tags.length) { // Remove link if there is no trailer tag idPlay.removeNode(true); } } </SCRIPT> </HEAD> <BODY> <A id=idPlay href="#">Play Trailer</A> </BODY> </HTML>
| | | Matthias |
|
Registered: June 9, 2007 | Posts: 1,208 |
| Posted: | | | | That works perfectly. Full page looks like this now. Quote: <HTML> <HEAD> <style type="text/css"> <!-- * { color: black; font-family: verdana; font-size: 9pt; } html, body { margin: 0; padding: 0; background-color: rgb(255, 204, 102); } body { background-repeat: repeat-x; background-image:url($DPIMAGES.bgimage.jpg); } .title { font-size: 12pt; font-weight: bold; margin-top: 15pt; margin-bottom: 15pt; width: 100%; text-align: center; } .images { padding: 5; } span { margin: 5; background-color: black; border-width: 5px; border-style: double; } span.off { border-color: gray; } span.on { border-color: white; } img { cursor: hand; } --> </style>
<SCRIPT TYPE="text/javascript"> <!-- <DP NAME="HEADER_VARS" Language="JavaScript" Comments="True" IncludeCast="False" IncludeCrew="false"> //--> </SCRIPT>
<SCRIPT language=javascript> window.onload = window_onload; function window_onload() { var i; myloop: for (i = 0; i < DP_Tags.length; i++) { switch (DP_Tags[i]) { case "ztrailer/WMV": idPlay.href = "F:\\Trailers\\" + DP_CollectionNumber + ".wmv"; break myloop; case "ztrailer/MOV": idPlay.href = "F:\\Trailers\\" + DP_CollectionNumber + ".mov"; break myloop; case "ztrailer/VOB": idPlay.href = "F:\\Trailers\\" + DP_CollectionNumber + ".vob"; break myloop; } } if (i >= DP_Tags.length) { // Remove link if there is no trailer tag idPlay.removeNode(true); } } </SCRIPT>
</HEAD> <BODY>
<DP NAME="LAYERS" Dual="** DUAL LAYER **" Single=""> <BR><BR>
<B><DP NAME="TITLE"></B> <BR><BR>
<DP NAME="PURCHDATE" Prefix="Added- "> <BR><BR>
<DP NAME="DISCS" SubDivider=" - " ShowDescriptions="true" Divider="<BR>" ShowSlots="true" ShowLocations="true"> <BR><BR>
<A id=idPlay href="#">Play Trailer</A> <BR><BR>
<script language="JavaScript"> last_watch_on = "<DP NAME="LAST_WATCHED_ON">";
if ( last_watch_on.length != 0 ){ document.write("Last watched: " + last_watch_on); } </script>
</BODY> </HTML>
Gotta say I'm veru happy with it now. Do you think this could be made to work if a film had multiple trailers? Not terribly important tho. Thanks for everyones help | | | Last edited: by MarEll |
|
Registered: June 9, 2007 | Posts: 1,208 |
| Posted: | | | | Just one other thing, how would I put another one of these- Quote:
<SCRIPT language=javascript> window.onload = window_onload; function window_onload() { var i; myloop: for (i = 0; i < DP_Tags.length; i++) { switch (DP_Tags[i]) { case "ztrailer/WMV": idPlay.href = "F:\\Trailers\\" + DP_CollectionNumber + ".wmv"; break myloop; case "ztrailer/MOV": idPlay.href = "F:\\Trailers\\" + DP_CollectionNumber + ".mov"; break myloop; case "ztrailer/VOB": idPlay.href = "F:\\Trailers\\" + DP_CollectionNumber + ".vob"; break myloop; } } if (i >= DP_Tags.length) { // Remove link if there is no trailer tag idPlay.removeNode(true); } } </SCRIPT>
-into the window? Everytime I try it it messes the whole thing up. |
|