Author |
Message |
Registered: March 13, 2007 | Posts: 350 |
| Posted: | | | | for the text in white: <body bgcolor="#000053" text="white"> If the images are still not showing up, it might be the space in the path name (I'm currently running on my Mac at work (shhh don't tell anyone) and that is the sort of thing that doesn't always get emulated properly). The document.write() that I suggested was meant as a pointer to making changes in the <img>-tag parts of the code. so for example: Quote: if (counts['extras'] != 0) document.write('<tr><td class=f3>Review (extras):</td>' +'<td class=f2><img src="'+imgLoc+'Extras'+counts['extras'] +'.gif" alt="'+counts['extras']+' / 10">' +'</td></tr>'); should use a file named Extras5.gif, for example ... | | | -fred |
|
Registered: March 14, 2007 | Reputation: | Posts: 1,819 |
| Posted: | | | | Text is now the correct colour. Thanks!
However, still not displaying the graphic.
Should I have graphics from 0 to 10, eg. Film0, Film1 etc? At the moment I only have them from 2 onwards (as that's all Profiler displays). |
|
Registered: March 13, 2007 | Posts: 350 |
| Posted: | | | | Does it display the alt text? Can you right click properties for the image placeholder to see what the window thinks the image that it is trying to load is named? | | | -fred |
|
Registered: March 14, 2007 | Reputation: | Posts: 1,819 |
| Posted: | | | | Here's what I've got now.... But, when I preview it in the edit html section I get the following error:
Line: 50 Character: 39 Error: Expected ')' Code: 0 URL: file:///C:/Users/Neil/App Data/Roming/DVD%20Profiler/Temp/Design/6107B18DE7E5752121F5A92AC4324CB7/index.html
<html> <head> <META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=iso-8859-1"> <title><DP NAME="SORTTITLE"></title> </head> <body bgcolor="#000053" text="white"> <form style="display:none"> <textarea id="reviews"><DP NAME="REVIEW" WIDTH="240"></textarea> </form> <script type="text/javascript"> var ShowGraph = false; var imgLoc='C:\\Users\\Neil\\Documents\\DVD Profiler\\Stars'; var ReviewNames=new Array(); ReviewNames['#0080FF'] = 'movie'; ReviewNames['#00FF80'] = 'video'; ReviewNames['#FF8080'] = 'audio'; ReviewNames['#FFFF80'] = 'extras'; var counts=new Array(); counts['movie'] = 0; counts['video'] = 0; counts['audio'] = 0; counts['extras'] = 0;
var TheReview=document.getElementById('reviews').value; var t=TheReview.split('<'); var divisor=1, numreviews=4;
for (var i in t) { if (t[i].substr(0,3) == 'TD ') { a = t[i].split(' '); if (a.length == 3) { z = a[1].split('='); width=z[1]; z = a[2].split('"'); color=z[1]; width++; if (divisor == 1) { divisor = width/2; numreviews = (2*24)/width; } counts[ReviewNames[color]] += width/divisor; } } }
if (ShowGraph) document.write(TheReview); document.write('<table>'); if (counts['movie'] != 0) document.write('<tr><td class=f3>Review (movie):</td>' +'<td class=f2><img src="'+imgLoc+movie+counts['movie'] +'.gif" alt="'movie+counts['movie']+' / 10">' +'</td></tr>'); if (counts['video'] != 0) document.write('<tr><td class=f3>Review (video):</td>' +'<td class=f2><img src="'+imgLoc+Video+counts['video'] +'.gif" alt="'video+counts['video']+' / 10">' +'</td></tr>'); if (counts['audio'] != 0) document.write('<tr><td class=f3>Review (audio):</td>' +'<td class=f2><img src="'+imgLoc+Audio+counts['audio'] +'.gif" alt="'audio+counts['audio']+' / 10">' +'</td></tr>'); if (counts['extras'] != 0) document.write('<tr><td class=f3>Review (extras):</td>' +'<td class=f2><img src="'+imgLoc+Extras+counts['extras'] +'.gif" alt="'extras+counts['extras']+' / 10">' +'</td></tr>'); document.write('</table>'); </script> </body> </html> |
|
Registered: March 14, 2007 | Reputation: | Posts: 1,819 |
| Posted: | | | | Quoting FredLooks: Quote: Does it display the alt text? Can you right click properties for the image placeholder to see what the window thinks the image that it is trying to load is named? It thinks it's trying to display a Stars/8.gif (as an example). It's obviously not recognising the Extras (etc) before the number. |
|
Registered: March 13, 2007 | Posts: 350 |
| Posted: | | | | OK, fixed some problems for you ... - the path in imgLoc has to end with a separator - you missed the quotes around the 'Movie', 'Video', etc. in the output - you missed added those things into the alt text, where they aren't needed, and you missed a couple of + signs - i removed some extra class= junk i missed when i extracted the code ... shouldn't hurt, though The files will be named "Movie5.gif" and so on, and should be found in the specified location correctly and now i've tested it and it works Try this: Quote: <html> <head> <META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=iso-8859-1"> <title><DP NAME="SORTTITLE"></title> </head> <body bgcolor="#000053" text="white"> <form style="display:none"> <textarea id="reviews"><DP NAME="REVIEW" WIDTH="240"></textarea> </form> <script type="text/javascript"> var ShowGraph = false; var imgLoc='C:\\Users\\Neil\\Documents\\DVD Profiler\\Stars\\'; var ReviewNames=new Array(); ReviewNames['#0080FF'] = 'movie'; ReviewNames['#00FF80'] = 'video'; ReviewNames['#FF8080'] = 'audio'; ReviewNames['#FFFF80'] = 'extras'; var counts=new Array(); counts['movie'] = 0; counts['video'] = 0; counts['audio'] = 0; counts['extras'] = 0;
var TheReview=document.getElementById('reviews').value; var t=TheReview.split('<'); var divisor=1, numreviews=4;
for (var i in t) { if (t[i].substr(0,3) == 'TD ') { a = t[i].split(' '); if (a.length == 3) { z = a[1].split('='); width=z[1]; z = a[2].split('"'); color=z[1]; width++; if (divisor == 1) { divisor = width/2; numreviews = (2*24)/width; } counts[ReviewNames[color]] += width/divisor; } } }
if (ShowGraph) document.write(TheReview); document.write('<table>'); if (counts['movie'] != 0) document.write('<tr><td>Review (movie):</td>' +'<td><img src="'+imgLoc+'Movie'+counts['movie'] +'.gif" alt="'+counts['movie']+' / 10">' +'</td></tr>'); if (counts['video'] != 0) document.write('<tr><td>Review (video):</td>' +'<td><img src="'+imgLoc+'Video'+counts['video'] +'.gif" alt="'+counts['video']+' / 10">' +'</td></tr>'); if (counts['audio'] != 0) document.write('<tr><td>Review (audio):</td>' +'<td><img src="'+imgLoc+'Audio'+counts['audio'] +'.gif" alt="'+counts['audio']+' / 10">' +'</td></tr>'); if (counts['extras'] != 0) document.write('<tr><td>Review (extras):</td>' +'<td><img src="'+imgLoc+'Extras'+counts['extras'] +'.gif" alt="'+counts['extras']+' / 10">' +'</td></tr>'); document.write('</table>'); </script> </body> </html>
| | | -fred |
|
Registered: March 14, 2007 | Reputation: | Posts: 1,819 |
| Posted: | | | | Yep! That did it. Working fine now. Many thanks for the help. While I'm here...... .......I'm fiddling around with the other things from the General Info tab; and so far I've put in the title, genres and runtime. What's the code to place these in certain positions? '<center>' seems to be working but I don't know how to make it display things in columns etc. Thanks |
|
Registered: March 15, 2007 | Reputation: | Posts: 5,459 |
| Posted: | | | | I use a table to keep things tidy.
<table> <tr> (start of row) <td> (start of cell) </td> (end of cell) repeat <td> </td> for each cell then </tr> to end that row and <tr> again to start a new row. When you're done </table> to end the table.
For example, in the general info window I was building I used a table with 4 cells to a row (giving you four columns) one cell for the label, the next for the data, two sets side by side.
More advanced settings: if you use: <table border="0"> you get no lines drawn round your cells. if you use: <td valign="top"> all your text aligns to the top of the cell, not the centre (default) which can look a bit odd with lists. | | | Last edited: by northbloke |
|
Registered: March 14, 2007 | Reputation: | Posts: 1,819 |
| Posted: | | | | Quoting northbloke: Quote: I use a table to keep things tidy.
<table> <tr> (start of row) <td> (start of cell) </td> (end of cell) repeat <td> </td> for each cell then </tr> to end that row and <tr> again to start a new row. When you're done </table> to end the table.
For example, in the general info window I was building I used a table with 4 cells to a row (giving you four columns) one cell for the label, the next for the data, two sets side by side.
More advanced settings: if you use: <table border="0"> you get no lines drawn round your cells. if you use: <td valign="top"> all your text aligns to the top of the cell, not the centre (default) which can look a bit odd with lists. Many thanks! I'm going to have a play around with this and see how I get on! Neil |
|
Registered: March 14, 2007 | Reputation: | Posts: 1,819 |
| Posted: | | | | Below is the code for the window I have created with my preferences for the General Info window.
As it stands it works fine.
However, I would like there to be more space between the cells in the table. Preferably I would like the Genres, Runtime and Region to align to the left of the screen and the Released column to align to the right.
Also, it was mentioned that it is possible to have the locked icon showing in an html window. How would I do this?
Many thanks for all the help!
Neil
<html> <head> <META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=iso-8859-1"> <title><DP NAME="SORTTITLE"></title> </head> <body bgcolor="#b5cff2"> <center> <font size="+1" face="Monotype Corsiva"><DP NAME="TITLE"><br> <HR color="#e0e0e0"> <table><tr><td>Genres: <DP NAME="GENRES"></td><td>Released: <DP NAME="RELDATE"></td></tr> <tr><td>Runtime: <DP NAME="RUNTIME"></td><td>Purchased: <DP NAME="PURCHDATE"> <DP NAME="PURCHPLACE"></td></tr> <tr><td>Region: <DP NAME="REGIONS"><td>Case Type: <DP NAME="CASETYPE"></td></tr></table> <HR color="#e0e0e0"> <center><form style="display:none"> <textarea id="reviews"><DP NAME="REVIEW" WIDTH="240"></textarea> </form> <script type="text/javascript"> var ShowGraph = false; var imgLoc='C:\\Users\\Neil\\Documents\\DVD Profiler\\Stars\\'; var ReviewNames=new Array(); ReviewNames['#0080FF'] = 'film'; ReviewNames['#00FF80'] = 'video'; ReviewNames['#FF8080'] = 'audio'; ReviewNames['#FFFF80'] = 'extras'; var counts=new Array(); counts['film'] = 0; counts['video'] = 0; counts['audio'] = 0; counts['extras'] = 0;
var TheReview=document.getElementById('reviews').value; var t=TheReview.split('<'); var divisor=1, numreviews=4;
for (var i in t) { if (t[i].substr(0,3) == 'TD ') { a = t[i].split(' '); if (a.length == 3) { z = a[1].split('='); width=z[1]; z = a[2].split('"'); color=z[1]; width++; if (divisor == 1) { divisor = width/2; numreviews = (2*24)/width; } counts[ReviewNames[color]] += width/divisor; } } }
if (ShowGraph) document.write(TheReview); document.write('<table>'); if (counts['film'] != 0) document.write('<tr><td class=f3>Movie:</td>' +'<td class=f2><img src="'+imgLoc+'film'+counts['film'] +'.gif" alt="'+counts['film']+' / 10">' +'</td></tr>'); if (counts['video'] != 0) document.write('<tr><td class=f3>Review (video):</td>' +'<td class=f2><img src="'+imgLoc+'video'+counts['video'] +'.gif" alt="'+counts['video']+' / 10">' +'</td></tr>'); if (counts['audio'] != 0) document.write('<tr><td class=f3>Review (audio):</td>' +'<td class=f2><img src="'+imgLoc+'audio'+counts['audio'] +'.gif" alt="'+counts['audio']+' / 10">' +'</td></tr>'); if (counts['extras'] != 0) document.write('<tr><td class=f3>Extras:</td>' +'<td class=f2><img src="'+imgLoc+'extras'+counts['extras'] +'.gif" alt="'+counts['extras']+' / 10">' +'</td></tr>'); document.write('</table>'); </script>
</body> </html> |
|
Registered: March 15, 2007 | Reputation: | Posts: 5,459 |
| Posted: | | | | The first few bits are easy:
Instead of <table> use <table cellspacing="10"> to add a buffer between the cells. I found 10 was quite spacey without things looking too far apart, but you can adjust it to your will.
To right-justify cells use <td align="right"> instead of <td> for each cell you want to align on the right.
If I find out how to add the lock icon, I'll get back to you. |
|
Registered: March 14, 2007 | Reputation: | Posts: 1,819 |
| Posted: | | | | Quoting northbloke: Quote: The first few bits are easy:
Instead of <table> use <table cellspacing="10"> to add a buffer between the cells. I found 10 was quite spacey without things looking too far apart, but you can adjust it to your will.
To right-justify cells use <td align="right"> instead of <td> for each cell you want to align on the right.
If I find out how to add the lock icon, I'll get back to you. Good to know about the 'cellspacing' thing....but it didn't have the desire effect. Instead of putting space between the 'columns' it put spaces between the lines. Also, the 'align right' worked to an extent, but the 'P' of Purchase Date and the 'R' of Release date no longer lined up. I literally want the first letters of Genre, Runtime and Region to line up on the left of my window and the first letters of Release Date, Purchase Date and Case Type to line up but be further over to the right. Hope that makes sense. |
|
Registered: March 15, 2007 | Reputation: | Posts: 5,459 |
| Posted: | | | | It sounds like it's displaying differently on your PC than on mine as when I copy & pasted the code into my Profiler, there were no lines! In that case, we need to use something called cell padding. That should add a space around the text, but not between the lines. If you also want the columns more spaced out I would suggest that you allow the table to spread out over the whole of the HTML window. You do this by adding width. So try this instead of <table>: <table cellpadding="10" width="100%"> And to get all the labels to line up under the 1st letter, simply replace all <td> with <td align="left"> Let me know if that's any closer to what you want. Edit: and just in case you didn't know, you can add the word "from" to your Purchase line by using this: <DP NAME="PURCHPLACE" Prefix="from "> (note the space after the word) in your code. Obviously if you left it off deliberately, don't use it! | | | Last edited: by northbloke |
|
Registered: March 15, 2007 | Reputation: | Posts: 5,459 |
| Posted: | | | | Another variable I've just tried is to add an empty, fixed width column between the two containing the info. In this code, I've used a width of 98 pixels, but you might want to try different ones, just remember to change all 3 widths.
Try replacing your table section with this:
<table cellpadding="5" border="0"><tr> <td align="left">Genres: <DP NAME="GENRES"></td> <td width="98"></td> <td align="left">Released: <DP NAME="RELDATE"></td></tr> <tr><td align="left">Runtime: <DP NAME="RUNTIME" HoursOnly="true"> hr <DP NAME="RUNTIME" MinsOnly="true"> min</td> <td width="98"></td> <td align="left">Purchased: <DP NAME="PURCHDATE"> <DP NAME="PURCHPLACE" Prefix="from "></td></tr> <tr><td align="left">Region: <DP NAME="REGIONS"></td> <td width="98"></td> <td align="left">Case Type: <DP NAME="CASETYPE"></td></tr> </table>
I've also made changes to the run time and purchase info to display slightly differently. | | | Last edited: by northbloke |
|
Registered: March 14, 2007 | Reputation: | Posts: 1,819 |
| Posted: | | | | That worked with a little adjusting of numbers. Many thanks. While I'm here - How do I center something so it appears in the middle of the screen/window? Also, would it be possible to have an HTML window display the Watched History? Thanks! Neil P.S. I am actually making notes of everything I'm being told so I, hopefully, won't have to ask again. | | | Last edited: by Pantheon |
|
Registered: March 15, 2007 | Reputation: | Posts: 5,459 |
| Posted: | | | | I looked for the Watched History and currently only Last Watched is available via an HTML window. I'm guessing any more detailed info would have to come via a plugin. For centreing the table, try adding align="center" to your <table> entry. Or trying adding <p align="center"> in front of what you want centred. | | | Last edited: by northbloke |
|