Welcome to the Invelos forums. Please read the forum rules before posting.

Read access to our public forums is open to everyone. To post messages, a free registration is required.

If you have an Invelos account, sign in to post.

    Invelos Forums->DVD Profiler: Layouts and Reports Page: 1  Previous   Next
Help with HMTL window feature needed
Author Message
DVD Profiler Desktop and Mobile RegistrantStar ContributorPantheon
Registered: March 14, 2007
Reputation: High Rating
United Kingdom Posts: 1,819
Posted:
PM this userView this user's DVD collectionDirect link to this postReply with quote
Hello

I want to add a small window that is linked to Tags.

I'm thinking of using tags to indicate if I have the soundtrack/book of films I own.  But, what I would really like is an html window that would display something like this if the tag is ticked:

Own:
Book
Soundtrack

If no tags are ticked I would like the box to simply be left blank (or a link to a graphic I have locally).
I want to be able to customise the background colour and fonts.
I would like the text to be centred in the box.

Any 'prettying' of the idea would be great.

All help much appreciated.

Thanks

Neil
DVD Profiler Desktop and Mobile Registrantmediadogg
Aim high. Ride the wind.
Registered: March 18, 2007
Reputation: Highest Rating
United States Posts: 6,461
Posted:
PM this userVisit this user's homepageDirect link to this postReply with quote
How would you like to take a shot at it yourself?

Try this:

(1) Use MS Word (or equiv) to make a dummy layout - just as pretty as you want - fonts, colors, etc.
(2) Use easy to find dummy text such as "sampletext1" to fill in places where data from profiler will go
(3) Save As ... HTML to get the layout in HTML format
(4) Create a new HTML section in Profiler
(5) Cut and paste (replace) the HTML section contents with your layout contents
(6) Preview your pretty stuff and save it as HTML
(7) Now edit your HTML section and insert this immediatley following the <head> tag:

<SCRIPT TYPE="text/javascript">
<!--
<DP NAME="HEADER_VARS" Language="JavaScript" Comments="True" IncludeCast="False" IncludeCrew="False">
//-->
</SCRIPT>

This makes the DVD Profiler data available to the HTML page

(8) Preview again and save again. Nothing should have changed to your eyes.
(9) Come back when you are finished and paste your complete HTML in a post. Then we will tell you exactly what to change to make the Profiler data show up instead of the dummy data.

How's that?
Thanks for your support.
Free Plugins available here.
Advanced plugins available here.
Hey, new product!!! BDPFrog.
DVD Profiler Unlimited RegistrantStar Contributornorthbloke
Registered: March 15, 2007
Reputation: High Rating
United Kingdom Posts: 5,459
Posted:
PM this userDirect link to this postReply with quote
I'm currently have a bit of trouble get DP_TAGS to behave in HTML windows, if I can work out what I'm doing wrong I'll give it a go...
DVD Profiler Unlimited Registrantxyrano
41215.reg 70320.urk
Registered: March 13, 2007
Sweden Posts: 646
Posted:
PM this userView this user's DVD collectionDirect link to this postReply with quote
<SCRIPT TYPE="text/javascript">
<!--
<DP NAME="HEADER_VARS" Language="JavaScript" Comments="True" IncludeCast="False" IncludeCrew="False">
//-->
for (var i = 0;  i < DP_Tags.length;  i++) {

    if (DP_Tags[i].toLowerCase() == "Own:/Book".toLowerCase()) document.write("has book");
    if (DP_Tags[i].toLowerCase() == "Own:/Soundtrack".toLowerCase()) document.write("has soundtrack");
}
</SCRIPT>
DVD Profiler Unlimited RegistrantStar Contributornorthbloke
Registered: March 15, 2007
Reputation: High Rating
United Kingdom Posts: 5,459
Posted:
PM this userDirect link to this postReply with quote
That's great thanks - I was tearing my hair out trying to get it to work! 
Turns out I was trying to use IndexOf and IE doesn't recognise it - I mean it's only been around a few years now...   

Panth,
to get the coding exact we'll need to know exactly what your Tags are called and if they are Child Tags of any other category(ies).
DVD Profiler Desktop and Mobile RegistrantStar ContributorPantheon
Registered: March 14, 2007
Reputation: High Rating
United Kingdom Posts: 1,819
Posted:
PM this userView this user's DVD collectionDirect link to this postReply with quote
The tags are simply:
Book
Soundtrack

Neither is a child tag.

I've actually decided that what I want to do is have a graphic/picture display if the tag is ticked. I going to find the graphic so all I need is for the html window to display the graphic centred or centred & side-by-side if both tags are ticked.

Thanks north/xyrano.
 Last edited: by Pantheon
DVD Profiler Unlimited Registrantxyrano
41215.reg 70320.urk
Registered: March 13, 2007
Sweden Posts: 646
Posted:
PM this userView this user's DVD collectionDirect link to this postReply with quote
Quoting northbloke:
Quote:
That's great thanks - I was tearing my hair out trying to get it to work! 
Turns out I was trying to use IndexOf and IE doesn't recognise it - I mean it's only been around a few years now...   

Panth,
to get the coding exact we'll need to know exactly what your Tags are called and if they are Child Tags of any other category(ies).

While IndexOf might not work, indexOf does.
The names of all javascript functions are case sensitive.
Syntax
stringObject.indexOf(searchvalue, fromindex)
This method returns -1 if the string value to search for never occurs.
Example
"Book".indexOf("Book") returns 0
"book".indexOf("Book") returns -1
"book".indexOf("ok") returns 2
"book".indexOf("ok", 2) returns 0
DVD Profiler Unlimited Registrantxyrano
41215.reg 70320.urk
Registered: March 13, 2007
Sweden Posts: 646
Posted:
PM this userView this user's DVD collectionDirect link to this postReply with quote
Quoting Pantheon:
Quote:
The tags are simply:
Book
Soundtrack

Neither is a child tag.

I've actually decided that what I want to do is have a graphic/picture display if the tag is ticked. I going to find the graphic so all I need is for the html window to display the graphic centred or centred & side-by-side if both tags are ticked.

Thanks north/xyrano.

<html>
<head>
<script type="text/javascript">
<!--
<DP NAME="HEADER_VARS" Language="JavaScript" Comments="True" IncludeCast="False" IncludeCrew="False">
//-->
</script>
</head>
<body style="text-align: center;">
<script type="text/javascript">
for (var i = 0;  i < DP_Tags.length;  i++) {

    if (DP_Tags[i].toLowerCase() == "Book".toLowerCase()) document.write('<img  src="book.jpg">');
    if (DP_Tags[i].toLowerCase() == "Soundtrack".toLowerCase()) document.write('<img  src="soundtrack.jpg">');
}
</script>
</body>
</html>
If you have a book tag AND a Book tag and you want to use both but for seperate things, you may wish to remove the toLowerCase functions in the expressions of both if statements. Like so:
if (DP_Tags[i] == "Book") doc...

The source of the images above are not complete thus the images will not show. They need the full path all the way down to the harddrive letter.

I also belive the images above will end up in a vertical alignment and not in a horisontal alignment.
That can be fixed lateron.

[spelledit] Thx northbloke 
 Last edited: by xyrano
DVD Profiler Unlimited RegistrantStar Contributornorthbloke
Registered: March 15, 2007
Reputation: High Rating
United Kingdom Posts: 5,459
Posted:
PM this userDirect link to this postReply with quote
Great work thanks.
Though you may want to edit your post - you've got <scipt twice instead of <script.

I tried this and the 2 images (well, 2 red crosses) appear side by side.

I looked again at the indexOf and for some strange reason it will work on strings but not on arrays, but all the info I can find on the web is that it should work on arrays too.
I was trying to use DP_Tags.indexOf('Book') to see if it returned -1 or not.
DVD Profiler Desktop and Mobile RegistrantStar ContributorPantheon
Registered: March 14, 2007
Reputation: High Rating
United Kingdom Posts: 1,819
Posted:
PM this userView this user's DVD collectionDirect link to this postReply with quote
Thanks for the help.

I can't seem to get the pictures to display.

Here's what I've got in the source:

  if (DP_Tags[i].toLowerCase() == "Book".toLowerCase()) document.write('<img  src="C:\Users\Neil\Documents\DVD Profiler\CD and Book Graphic\book.jpg">');
    if (DP_Tags[i].toLowerCase() == "Soundtrack".toLowerCase()) document.write('<img  src="C:\Users\Neil\Documents\DVD Profiler\CD and Book Graphic\soundtrack.jpg">');
}

Do I need to change anything?
DVD Profiler Unlimited Registrantxyrano
41215.reg 70320.urk
Registered: March 13, 2007
Sweden Posts: 646
Posted:
PM this userView this user's DVD collectionDirect link to this postReply with quote
Quoting northbloke:
Quote:
Great work thanks.
Though you may want to edit your post - you've got <scipt twice instead of <script.

I tried this and the 2 images (well, 2 red crosses) appear side by side.

I looked again at the indexOf and for some strange reason it will work on strings but not on arrays, but all the info I can find on the web is that it should work on arrays too.
I was trying to use DP_Tags.indexOf('Book') to see if it returned -1 or not.

Thats great, that the images apeared next to eachother
I wounder if DVDP use javascript 1.6 cauz thats where indexOf on arrays was implemented.
array.indexOf and
new in js1.6

I am not even sure DVDP use IE fully since we can not use or should I say are not allowed to use, the LINK tag.

Anyway... glad you got it working...
DVD Profiler Unlimited Registrantxyrano
41215.reg 70320.urk
Registered: March 13, 2007
Sweden Posts: 646
Posted:
PM this userView this user's DVD collectionDirect link to this postReply with quote
Quoting Pantheon:
Quote:
Thanks for the help.

I can't seem to get the pictures to display.

Here's what I've got in the source:

  if (DP_Tags[i].toLowerCase() == "Book".toLowerCase()) document.write('<img  src="C:\Users\Neil\Documents\DVD Profiler\CD and Book Graphic\book.jpg">');
    if (DP_Tags[i].toLowerCase() == "Soundtrack".toLowerCase()) document.write('<img  src="C:\Users\Neil\Documents\DVD Profiler\CD and Book Graphic\soundtrack.jpg">');
}

Do I need to change anything?

You may want to add another \ to every \ in the paths. "\" -> "\\".
DVD Profiler Desktop and Mobile RegistrantStar ContributorPantheon
Registered: March 14, 2007
Reputation: High Rating
United Kingdom Posts: 1,819
Posted:
PM this userView this user's DVD collectionDirect link to this postReply with quote
Quoting xyrano:
Quote:
Quoting Pantheon:
Quote:
Thanks for the help.

I can't seem to get the pictures to display.

Here's what I've got in the source:

  if (DP_Tags[i].toLowerCase() == "Book".toLowerCase()) document.write('<img  src="C:\Users\Neil\Documents\DVD Profiler\CD and Book Graphic\book.jpg">');
    if (DP_Tags[i].toLowerCase() == "Soundtrack".toLowerCase()) document.write('<img  src="C:\Users\Neil\Documents\DVD Profiler\CD and Book Graphic\soundtrack.jpg">');
}

Do I need to change anything?

You may want to add another \ to every \ in the paths. "\" -> "\\".


That worked.

How do I change the background colour?
 Last edited: by Pantheon
DVD Profiler Unlimited RegistrantStar Contributornorthbloke
Registered: March 15, 2007
Reputation: High Rating
United Kingdom Posts: 5,459
Posted:
PM this userDirect link to this postReply with quote
Add body bgcolor="#000000" to <body>
So instead of <body style="text-align: center;"> you'd get <body bgcolor="#000000" style="text-align: center;">

This will give you a black background. Change the #000000 to the hex code for your preferred colour.
There's a website here with a list: http://www.december.com/html/spec/color.html

Or if it's one of the basic Windows colours, simply type the name instead of the code (eg. bgcolor="red")
 Last edited: by northbloke
DVD Profiler Desktop and Mobile RegistrantStar ContributorPantheon
Registered: March 14, 2007
Reputation: High Rating
United Kingdom Posts: 1,819
Posted:
PM this userView this user's DVD collectionDirect link to this postReply with quote
That did it.

Thanks for all the help.
    Invelos Forums->DVD Profiler: Layouts and Reports Page: 1  Previous   Next