Author |
Message |
Registered: March 15, 2007 | Reputation: | Posts: 5,459 |
| Posted: | | | | As requested in this topic, here is an HTML window that looks at a DVD's certificate and some code in the Notes field to display various ratings logos. In order to get it to work you have to add the images in the other topic to your HTML window. There are 5 certificate and 6 rating logos in total. UPDATE: The code has been re-worked to include the "9" logo, and now checks the notes section for <cert=#> for any non-Dutch profiles (eg. <cert=9> or <cert=AL> ). <cert=#> can also be used to override the certificate on Dutch profiles. Quote:
<HTML> <HEAD>
<SCRIPT TYPE="text/javascript"> <!-- <DP NAME="HEADER_VARS" Language="JavaScript" Comments="True" IncludeCast="False" IncludeCrew="False"> //--> </SCRIPT>
</HEAD> <BODY>
<span id="sixteen"><img src="$DPIMAGES.16.gif" ALIGN="center"></span> <span id="AL"><img src="$DPIMAGES.AL.gif" ALIGN="center"></span> <span id="twelve"><img src="$DPIMAGES.12.gif" ALIGN="center"></span> <span id="six"><img src="$DPIMAGES.6.gif" ALIGN="center"></span> <span id="nine"><img src="$DPIMAGES.9.gif" ALIGN="center"></span> <span id="disc"><img src="$DPIMAGES.Discrimination.gif" ALIGN="center"></span> <span id="drug"><img src="$DPIMAGES.Drugs.gif" ALIGN="center"></span> <span id="fear"><img src="$DPIMAGES.Fear.gif" ALIGN="center"></span> <span id="prof"><img src="$DPIMAGES.Profanity.gif" ALIGN="center"></span> <span id="sex"><img src="$DPIMAGES.Sex.gif" ALIGN="center"></span> <span id="viol"><img src="$DPIMAGES.Violence.gif" ALIGN="center"></span>
<SCRIPT LANGUAGE="JavaScript"> var local = '<DP NAME="LOCALITY">'; var cert = DP_Notes.indexOf('<cert='); if (cert == "-1") cert = ""; cert = DP_Notes.substring(cert, DP_Notes.indexOf(">", cert)); cert = cert.replace("<cert=", "");
if (local == 'Netherlands' && cert == '') cert = '<DP NAME="RATING">'; var rate = DP_Notes.indexOf('<rating='); if (rate == "-1") rate = ""; rate = DP_Notes.substring(rate, DP_Notes.indexOf(">", rate)); rate = rate.replace("<rating=", "");
sixteen.style.display = 'none'; AL.style.display = 'none'; twelve.style.display = 'none'; six.style.display = 'none'; nine.style.display = 'none'; disc.style.display = 'none'; drug.style.display = 'none'; fear.style.display = 'none'; prof.style.display = 'none'; sex.style.display = 'none'; viol.style.display = 'none';
if (cert=="16") sixteen.style.display = ''; if (cert=="AL") AL.style.display = ''; if (cert=="6") six.style.display = ''; if (cert=="9") nine.style.display = ''; if (cert=="12") twelve.style.display = '';
if (rate.match("A")) fear.style.display = ''; if (rate.match("H")) drug.style.display = ''; if (rate.match("D")) disc.style.display = ''; if (rate.match("S")) sex.style.display = ''; if (rate.match("T")) prof.style.display = ''; if (rate.match("G")) viol.style.display = '';
</SCRIPT> </BODY> </HTML>
To get the ratings logos, add this to your Notes section: <rating=ASHDTG> Where A = fear, S = sex, H = drugs, D = discrimination/racism T = profanity, G = violence For non-Dutch profiles, simply add <cert=#> to the Notes section. | | | Last edited: by northbloke |
|
Registered: March 13, 2007 | Reputation: | Posts: 3,436 |
| Posted: | | | | Thanks for that! I liked Martin's idea and may use it myself... Quoting northbloke: Quote: In order to get it to work you have to add the images in the other topic to your HTML window, or at the very least have them in your "Application Data\DVD Profiler\Temp\Design" folder. I am not sure the \Temp\Design folder is a good idea, doesn't that get deleted when changing layouts...? | | | Achim [諾亞信; Ya-Shin//Nuo], a German in Taiwan. Registered: May 29, 2000 (at InterVocative) |
|
Registered: March 13, 2007 | Posts: 646 |
| Posted: | | | | Quoting northbloke: Quote:
rate = DP_Notes.substring(8, DP_Notes.indexOf('>'));
I belive the above should be corrected so it looks like this: Quote:
rate = DP_Notes.substring((rate+8), DP_Notes.indexOf('>'));
This would allow the Notes field to contain more than just the <rating=*> tag. For instance: <videos myspacetv=xxxxx /> <rating=A> | | | Last edited: by xyrano |
|
Registered: March 15, 2007 | Reputation: | Posts: 5,459 |
| Posted: | | | | Quoting ya_shin: Quote: I am not sure the \Temp\Design folder is a good idea, doesn't that get deleted when changing layouts...? I'll take your word for that but I haven't a clue to be honest! |
|
Registered: March 15, 2007 | Reputation: | Posts: 5,459 |
| Posted: | | | | Quoting xyrano: Quote:
I belive the above should be corrected so it looks like this:
Quote:
rate = DP_Notes.substring((rate+8), DP_Notes.indexOf('>'));
'Tis Done! Edit: doesn't work. As it finds the ">" from the first line, not the rating line. I'll have to have a play and see how I can counter that... Edit2: I think I've fixed it, let me know if it works. | | | Last edited: by northbloke |
|
Registered: March 13, 2007 | Posts: 646 |
| Posted: | | | | Quoting northbloke: Quote: Quoting xyrano:
Quote:
I belive the above should be corrected so it looks like this:
Quote:
rate = DP_Notes.substring((rate+8), DP_Notes.indexOf('>'));
'Tis Done!
Edit: doesn't work. As it finds the ">" from the first line, not the rating line. I'll have to have a play and see how I can counter that... From the Gallery Viewer: var ims = DP_Notes.substring(int, DP_Notes.indexOf(">" , int)); Quote:
rate = DP_Notes.substring((rate+8), DP_Notes.indexOf('>', rate));
Might be helpful - indexOf? | | | Last edited: by xyrano |
|
Registered: March 14, 2007 | Posts: 2,366 |
| Posted: | | | | While I am very happy with the script, I made some adjustments so I'm able to change Dutch age ratings and to add the (unofficial) age 9 rating, and to add Dutch ratings to foreign profiles: Quote: <HTML> <HEAD>
<SCRIPT TYPE="text/javascript"> <!-- <DP NAME="HEADER_VARS" Language="JavaScript" Comments="True" IncludeCast="False" IncludeCrew="False"> //--> </SCRIPT>
</HEAD> <BODY>
<span id="all"><img src="$DPIMAGES.AL.gif" ALIGN="center"></span><span id="six"><img src="$DPIMAGES.6.gif" ALIGN="center"></span><span id="nine"><img src="$DPIMAGES.9.gif" ALIGN="center"></span><span id="twelve"><img src="$DPIMAGES.12.gif" ALIGN="center"></span><span id="sixteen"><img src="$DPIMAGES.16.gif" ALIGN="center"></span><span id="viol"><img src="$DPIMAGES.Violence.gif" ALIGN="center"></span><span id="fear"><img src="$DPIMAGES.Fear.gif" ALIGN="center"></span><span id="sex"><img src="$DPIMAGES.Sex.gif" ALIGN="center"></span><span id="disc"><img src="$DPIMAGES.Discrimination.gif" ALIGN="center"></span><span id="drug"><img src="$DPIMAGES.Drugs.gif" ALIGN="center"></span><span id="prof"><img src="$DPIMAGES.Profanity.gif" ALIGN="center"></span>
<SCRIPT LANGUAGE="JavaScript"> var cert = '<DP NAME="RATING">'; var local = '<DP NAME="LOCALITY">'; if (local != 'Nederland') cert = ''; var rate = DP_Notes.indexOf('<kw='); if (rate == "-1") rate = ""; rate = DP_Notes.substring(rate, DP_Notes.indexOf(">", rate)); rate = rate.replace("<kw=", "");
all.style.display = 'none'; six.style.display = 'none'; nine.style.display = 'none'; twelve.style.display = 'none'; sixteen.style.display = 'none'; viol.style.display = 'none'; fear.style.display = 'none'; sex.style.display = 'none'; disc.style.display = 'none'; drug.style.display = 'none'; prof.style.display = 'none';
if (cert=="AL" && rate.match("1")) all.style.display = ''; else if (cert=="AL" && rate.match("2")) six.style.display = ''; else if (cert=="AL" && rate.match("3")) nine.style.display = ''; else if (cert=="AL" && rate.match("4")) twelve.style.display = ''; else if (cert=="AL" && rate.match("5")) sixteen.style.display = ''; else if (cert=="AL") all.style.display = ''; else if (rate.match("1")) all.style.display = '';
if (cert=="6" && rate.match("1")) all.style.display = ''; else if (cert=="6" && rate.match("2")) six.style.display = ''; else if (cert=="6" && rate.match("3")) nine.style.display = ''; else if (cert=="6" && rate.match("4")) twelve.style.display = ''; else if (cert=="6" && rate.match("5")) sixteen.style.display = ''; else if (cert=="6") six.style.display = ''; else if (rate.match("2")) six.style.display = '';
if (cert=="9" && rate.match("1")) all.style.display = ''; else if (cert=="9" && rate.match("2")) six.style.display = ''; else if (cert=="9" && rate.match("3")) nine.style.display = ''; else if (cert=="9" && rate.match("4")) twelve.style.display = ''; else if (cert=="9" && rate.match("5")) sixteen.style.display = ''; else if (cert=="9") nine.style.display = ''; else if (rate.match("3")) nine.style.display = '';
if (cert=="12" && rate.match("1")) all.style.display = ''; else if (cert=="12" && rate.match("2")) six.style.display = ''; else if (cert=="12" && rate.match("3")) nine.style.display = ''; else if (cert=="12" && rate.match("4")) twelve.style.display = ''; else if (cert=="12" && rate.match("5")) sixteen.style.display = ''; else if (cert=="12") twelve.style.display = ''; else if (rate.match("4")) twelve.style.display = '';
if (cert=="16" && rate.match("1")) all.style.display = ''; else if (cert=="16" && rate.match("2")) six.style.display = ''; else if (cert=="16" && rate.match("3")) nine.style.display = ''; else if (cert=="16" && rate.match("4")) twelve.style.display = ''; else if (cert=="16" && rate.match("5")) sixteen.style.display = ''; else if (cert=="16") sixteen.style.display = ''; else if (rate.match("5")) sixteen.style.display = '';
if (rate.match("G")) viol.style.display = ''; if (rate.match("A")) fear.style.display = ''; if (rate.match("S")) sex.style.display = ''; if (rate.match("D")) disc.style.display = ''; if (rate.match("H")) drug.style.display = ''; if (rate.match("T")) prof.style.display = '';
</SCRIPT> </BODY> </HTML> | | | Martin Zuidervliet
DVD Profiler Nederlands | | | Last edited: by Daddy DVD |
|
Registered: March 15, 2007 | Reputation: | Posts: 5,459 |
| Posted: | | | | I've updated the top code. Hopefully it should now be a lot more flexible. |
|
Registered: March 14, 2007 | Posts: 55 |
| Posted: | | | | I noticed a big problem with the box ratings, they are oft VERY different from the officiial Kijkwijzer rating. Beside that it isn't always the full rating and also noticed that there are sometimes ratings on boxes where the title isn't listed in the official "kijkwijzer" dbase. So i edited the following code. Would be nice if it could pick directly the direct link out of the page but i didnt manage to get that working.... Anyone ideas on this ? But this code - based on the wiki page shower - will do show always the official Dutch "Kijkwijzer" rating. Also possible to put an search text into the notes window between <kijk>Searchtext</kijk> CODE: Quote:
<HTML> <HEAD> <SCRIPT TYPE="text/javascript"> <!-- <DP NAME="HEADER_VARS" Language="JavaScript" Comments="True" IncludeCast="False" IncludeCrew="False">
function kijk() { var kijkURL = 'http://www.kijkwijzer.nl/classificaties.php?search=extended&original_title='; var kijkURLb = '&director=&release_year=&productietypen=&genre=&x=33&y=14'; var kijkCode = ""; var kijkLink = "";
var kijkStart = DP_Notes.toLowerCase().search("\<kijk\>") + 6; var kijkEnd = DP_Notes.toLowerCase().search("\</kijk\>"); if (kijkEnd > 1) { kijkCode = DP_Notes.slice(kijkStart, kijkEnd); var kijkLink = (kijkURL + kijkCode + kijkURLb); } else { if (DP_OriginalTitle == "") { kijkLink = (kijkURL + DP_Title + kijkURLb); } else { kijkLink = (kijkiURL + DP_OriginalTitle + kijkURLb); } } window.location.href = kijkLink; }
//--> </SCRIPT> </HEAD> <BODY onload="kijk();" scroll="auto"> </BODY> </HTML> | | | Last edited: by ArnoBD |
|
Registered: March 14, 2007 | Posts: 3,830 |
| Posted: | | | | Do keep in mind there are DVD releases (same Title same EAN) with different ratings on the cover of those DVD's, even with different ratings on the cover and when playing the DVD | | | Sources for one or more of the changes and/or additions were not submitted. Please include the sources for your changes in the contribution notes, especially for cast and crew additions. |
|
Registered: May 27, 2007 | Posts: 691 |
| Posted: | | | | When I put in <cert=AL> I do get the image for the All category, but also the spider. | | | Unfortunately, I can't use DVDprofiler at the moment due to lack of a Windows computer. |
|
Registered: May 27, 2007 | Posts: 691 |
| Posted: | | | | Got it working, sort of, hower this (Das Boat, uncut) has more then one icon, so I put in <cert="12 G A T">, but it doesn't give the '12' icon. The others do show. | | | Unfortunately, I can't use DVDprofiler at the moment due to lack of a Windows computer. |
|
Registered: March 14, 2007 | Posts: 3,830 |
| Posted: | | | | If you use that link, only those who have that profile online, can see the profile. if you use this method and the cover is clickable. | | | Sources for one or more of the changes and/or additions were not submitted. Please include the sources for your changes in the contribution notes, especially for cast and crew additions. |
|
Registered: May 27, 2007 | Posts: 691 |
| Posted: | | | | Finding this topic again All of a sudden the HTML that Daddy DVD posted here, doesn't seem to work for me anymore It looks like the path to the rating images is somehow gone. When I look at the HTML, there is this $DPIMAGES in it, but.. how can I find out what the $DPIMAGES means? What path does it follow? | | | Unfortunately, I can't use DVDprofiler at the moment due to lack of a Windows computer. |
|
Registered: March 14, 2007 | Posts: 2,366 |
| Posted: | | | | $DPIMAGES are the images which are part of a saved and active layout. If you use a different layout which does not contain the images or the script the rating logos will not appear. | | | Martin Zuidervliet
DVD Profiler Nederlands |
|
Registered: May 27, 2007 | Posts: 691 |
| Posted: | | | | Thanks. I guess I have to look to find a layout that does contain the $DPIMAGES. | | | Unfortunately, I can't use DVDprofiler at the moment due to lack of a Windows computer. |
|