Media Companion
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Media Companion

Discussion and development board for the program Media Companion.
 
HomeHome  Latest imagesLatest images  SearchSearch  RegisterRegister  Log inLog in  

 

 HTML Output Suggestion/Question

Go down 
+6
noticen24
Wizerd
StormyKnight
billyad2000
dbareis
esra
10 posters
Go to page : 1, 2  Next
AuthorMessage
esra
Junior Member
Junior Member



Posts : 45
Join date : 2009-05-08

HTML Output Suggestion/Question Empty
PostSubject: HTML Output Suggestion/Question   HTML Output Suggestion/Question Icon_minitimeTue Sep 08, 2009 5:36 am

Always wondered, is it possible to have the HTML file show more than just the title?

I mean the link to IMdb is great, but could you have it say show the poster and the brief outline/summary for the movie also?

i was just thinking it would be great to be able to use this fle as a way of telling friends and family what movies i have so they can borrow.

And, this is probably going too far, but is there a way to have it maybe split by genre or day added etc?

Anyway just an idea seeing as the information is there in the lists etc anyway.

Thanks for the hard work.
Back to top Go down
dbareis
Senior Member
Senior Member
dbareis


Posts : 223
Join date : 2008-12-08

HTML Output Suggestion/Question Empty
PostSubject: Re: HTML Output Suggestion/Question   HTML Output Suggestion/Question Icon_minitimeTue Sep 08, 2009 12:19 pm

esra wrote:
Always wondered, is it possible to have the HTML file show more than just the title?

I mean the link to IMdb is great, but could you have it say show the poster and the brief outline/summary for the movie also?

i was just thinking it would be great to be able to use this fle as a way of telling friends and family what movies i have so they can borrow.

And, this is probably going too far, but is there a way to have it maybe split by genre or day added etc?

Anyway just an idea seeing as the information is there in the lists etc anyway.

Thanks for the hard work.

It would also be great if we could supply template html for start/end and for each item. It would be very nice if we could refer to anything stored within thye XML .NFO via an XPATH or similar...

Bye,
Dennis
Back to top Go down
http://dennisbareis.com
billyad2000
Admin
billyad2000


Posts : 1326
Join date : 2008-09-20

HTML Output Suggestion/Question Empty
PostSubject: Re: HTML Output Suggestion/Question   HTML Output Suggestion/Question Icon_minitimeTue Sep 08, 2009 3:35 pm

I would like to do more with the HTML output, but there are two things stopping me right now,

Firstly and most importantly, I don't know html, I created the current system by creating a page with a few movies, linked to IMDB, and had a look at the HTML, I am not sure how a template system would work.

Secondly, only limited information from the movie is actually held in memory.
The actual list is
These are:
title
year
IMDB ID
genre
rating
top250
playcount

Any additional information would need to be loaded from the nfo file. This would not be difficult, but it would take longer to create the HTML list as each movie nfo was loaded.

As for art, this would slow things down more as MC found the path for the poster or fanart, and I am not certain how that would work, would the images be linked directly from their current location, or would thumbnails be made and stored with the HTML file.

What I need is guidance on how to achieve what people want, accessing the XML elements would not be an issue, its just a case of knowing how to add the elements to the html.
Back to top Go down
http://billyad2000.co.uk
dbareis
Senior Member
Senior Member
dbareis


Posts : 223
Join date : 2008-12-08

HTML Output Suggestion/Question Empty
PostSubject: Re: HTML Output Suggestion/Question   HTML Output Suggestion/Question Icon_minitimeMon Nov 09, 2009 11:37 am

billyad2000 wrote:
What I need is guidance on how to achieve what people want, accessing the XML elements would not be an issue, its just a case of knowing how to add the elements to the html.

Sorry meant to answer this ages ago...

One way of generated HTML would be via style sheets but that is perhaps too advanced for most, what I'd suggest is that you provide template HTML for the start/end of the htm and also for each item. The user can override any of these. It is basically html as you must have now with some form of replacement syntax for example "...<b><<SomeXpathWhichI'veForgottenWhatTheyLookLike>></b> so if you find "<<" you look for ">>" and what is in between is an XPATH, you may want to support a more advanced syntax but that would be be basics, I chose "<<" and ">>" as that wouldn't be allowed in normal html and so there would be no mistaking a user's intention.

You could allow variations where its not an xpath but a friendly name like "title" so users only need xpaths for more unusual elements.

Bye,
Dennis
Back to top Go down
http://dennisbareis.com
StormyKnight
VIP
VIP



Posts : 556
Join date : 2008-10-08
Location : Australia

HTML Output Suggestion/Question Empty
PostSubject: Re: HTML Output Suggestion/Question   HTML Output Suggestion/Question Icon_minitimeMon Nov 09, 2009 12:26 pm

Yep basically Billy, you would define some tokens like <<TITLE>> & <<RUNTIME>>.

A text file will have the html code plus the tokens at the appropriate places....All you need to do is creat a temp .html file with the tokens replaced with the real data & then send the temp file off the the web browser to display it.


In addition there will be some other commands that you will need to include to allow a header section, a body section & a footer section.


Something like this perhaps...

<<MC HTML Page>> {this will not be forwarded to the html file, but used to confirm that a "valid" file is trying to be used by MC
<<Header>> {Start of header - not copied to html}
-----Code in here is copied to html, but tokens are replaced (only some tokens are valid in the header section like current date etc)
e.g. html code to display "Movie Title Runtime"
<</Header>> {End of Header - not copied to html}

<<Body>> {Start of body, not copied to html file but used by MC to know that this is the body section }
-----Html Code with tokens in here &
e.g html code to show <<TITLE>> <<RUNTIME>>
again only some tokens are valid in the body
<</Body>> {End of body section, MC repeats body section until all movies are done}

<<Footer>>
----Html code in here for the footer information
e.g. html code to display "Movie Count=<<MOVIE COUNT>>" "Total Runtime=<<TOTAL RUNTIME>>"
again only some tokens are valid in the footer
<</Footer>>

In the example above you would end up with something like this...

Code:

Movie Title                            Runtime
Title 1                                  1:00
Title 2                                  2:00
Title 3                                  3:00
Movie Count = 3            Total Runtime=6:00

The advantage of this method is the file above can be created by the end users, thus allowing the imagination & creativity to flow thru. Using the above method, html code like tables can be used to format the final display making them look better. Pictures/thumbnails would easly be added too!
Back to top Go down
billyad2000
Admin
billyad2000


Posts : 1326
Join date : 2008-09-20

HTML Output Suggestion/Question Empty
PostSubject: Re: HTML Output Suggestion/Question   HTML Output Suggestion/Question Icon_minitimeMon Nov 09, 2009 10:03 pm

That all seems do-able

but how are images handled, some people want to be able to include a thumbsize poster with the movie details, how is this achieved. It would be a simple matter to display the image via the path, but for portability would not the thumbs need to be resized and stored in a location relative to the html file.
Back to top Go down
http://billyad2000.co.uk
StormyKnight
VIP
VIP



Posts : 556
Join date : 2008-10-08
Location : Australia

HTML Output Suggestion/Question Empty
PostSubject: Re: HTML Output Suggestion/Question   HTML Output Suggestion/Question Icon_minitimeTue Nov 10, 2009 1:17 am

billyad2000 wrote:
That all seems do-able

but how are images handled, some people want to be able to include a thumbsize poster with the movie details, how is this achieved. It would be a simple matter to display the image via the path, but for portability would not the thumbs need to be resized and stored in a location relative to the html file.

Yes this is correct.....

For portability, the created html code & associated media that is linked in that code would have to be exported together with the correct relative paths.....
Back to top Go down
dbareis
Senior Member
Senior Member
dbareis


Posts : 223
Join date : 2008-12-08

HTML Output Suggestion/Question Empty
PostSubject: Re: HTML Output Suggestion/Question   HTML Output Suggestion/Question Icon_minitimeTue Nov 10, 2009 4:29 am

billyad2000 wrote:
but how are images handled, some people want to be able to include a thumbsize poster with the movie details, how is this achieved.

I'd be happy to keep images out of it at least for starters but if you wanted to support thumbs then you'd need to do the resizing also and my syntax need not just cause text replacement, it could be for instructions for example "<<$CreateThumb:40x30,...>>"...
Back to top Go down
http://dennisbareis.com
StormyKnight
VIP
VIP



Posts : 556
Join date : 2008-10-08
Location : Australia

HTML Output Suggestion/Question Empty
PostSubject: Re: HTML Output Suggestion/Question   HTML Output Suggestion/Question Icon_minitimeTue Nov 10, 2009 5:47 am

dbareis wrote:
....it could be for instructions for example "<<$CreateThumb:40x30,...>>"...

Yes thats a valid point, the tokens really are codes to perform some sort of function, but I guess it would depend on the degree of complexity required....

In the header you could define thumbs as being 40x30 for example as in your example, if the token wasn't there then the defaults would be assumed so latter on in the text when <<MovieThumb>> was mentioned, the thumbs would be created and the relative path calculated & subtituted for the token.

However, if the thumbs were not required, then the time to create them would also not be required.....


I guess the key in the early stages, is to make it so that complexity can be added if deemed necessary, without having to break the syntax used in the earlier stages....although that cannot always be avoided....

I guess we need to have a think about what would be the end result we would aim for in terms of data manipulation?

e.g. Do we want to be able to refer it specific movies?
e.g. Do we want to define the sort order from the text code?
e.g. Do we want to define rules about whats listed & whats not?
e.g. Do we want to be able to color code depending on returned information?
e.g. Do we want to be able to create multiple page web sites, by using frames etc where one frame has a list of movies, the other frame displays the artwork & a 3rd displays the details of the selected movie for example?
e.g. Weblinks to trailers?

Most of what I listed above would be the addition of new tokens to tell MC what to do with the data & could be added on at a later stage if deemed necessary.

As a start if we could list the movies in a table, that would be what the majority would need, the actual html code would be able to clean it up & make it a little more presentable however with the addition of backgrounds, colours & text alignments.

Cheers
Back to top Go down
billyad2000
Admin
billyad2000


Posts : 1326
Join date : 2008-09-20

HTML Output Suggestion/Question Empty
PostSubject: Re: HTML Output Suggestion/Question   HTML Output Suggestion/Question Icon_minitimeTue Nov 10, 2009 1:09 pm

I'll try to get a basic implementation of this added for the next build
Back to top Go down
http://billyad2000.co.uk
StormyKnight
VIP
VIP



Posts : 556
Join date : 2008-10-08
Location : Australia

HTML Output Suggestion/Question Empty
PostSubject: Re: HTML Output Suggestion/Question   HTML Output Suggestion/Question Icon_minitimeTue Nov 10, 2009 1:51 pm

Thanks Billy! Very Happy
Back to top Go down
billyad2000
Admin
billyad2000


Posts : 1326
Join date : 2008-09-20

HTML Output Suggestion/Question Empty
PostSubject: Re: HTML Output Suggestion/Question   HTML Output Suggestion/Question Icon_minitimeTue Nov 10, 2009 4:38 pm

I've just setup a basic implementation of this, although their is no support for posters (yet)

The template for the current simple list looks like this;
<<MC HTML Page>>
<<header>>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
<h1 align="center"><font size="6"><b>XBMC Media Companion</b></font></h1>
<h2 align="center"><font size="5"><b>HTML Output</b></font></h2>
<h3 align="center"><<moviecount>> movies</h3>
<p align=""center"">&nbsp;</p>
<</header>>
<<body>>
<p align="center"><b><a href="<<imdb_url>>"><<movietitleandyear>></a></b></p>
<</body>>
<<footer>><</footer>>
<</MC HTML Page>>

The current supported tags are:
<<moviecount>>
<<title>>
<<movietitleandyear>>
<<movieyear>>
<<runtime>>
<<rating>>
<<outline>>
<<imdb_url>>
<<fullpathandfilename>>

I will add more to the list if they are needed, it should be noted that these tags are stored in the basic movie list and are quick to list, other tags, such as plot, while can be easily added would need to be loaded one at a time from the movie nfo file, the speed of this process depends on many things such as system and network speed.

I just need to set up a method for allowing multiple templates and selection between them.
Back to top Go down
http://billyad2000.co.uk
StormyKnight
VIP
VIP



Posts : 556
Join date : 2008-10-08
Location : Australia

HTML Output Suggestion/Question Empty
PostSubject: Re: HTML Output Suggestion/Question   HTML Output Suggestion/Question Icon_minitimeWed Nov 11, 2009 2:59 am

Looks good Billy, have you thought of how your going to handle errors? Such as an invalid token or invalid token syntax? I think you just need to keep that in mind when programming if you want to let the user know of an issue. The usual method is to report the error & the line number of the file that it found the error on.

The other method is to simply ignore, & let the end user work out why something isn't being displayed as intended on the html output

Both methods have merit ofcourse!
Back to top Go down
billyad2000
Admin
billyad2000


Posts : 1326
Join date : 2008-09-20

HTML Output Suggestion/Question Empty
PostSubject: Re: HTML Output Suggestion/Question   HTML Output Suggestion/Question Icon_minitimeWed Nov 11, 2009 3:35 am

At the moment invalid tags are just ignored and as such will be added to the html, should be fairly obvious just by looking at the html where the error is.

The only other issue I could think of is nfos that are missing fields, it is conceivable that in a large collection a person may have one or two incompleted fields, in this instance the information is just not added, no error will occur and the overall html should not be affected.

btw, at the moment the list is generated according to the filtered list, so if any filters (text or genre) are applied then they will be applied to the output html, this also applies to the sortorder.
Back to top Go down
http://billyad2000.co.uk
dbareis
Senior Member
Senior Member
dbareis


Posts : 223
Join date : 2008-12-08

HTML Output Suggestion/Question Empty
PostSubject: Re: HTML Output Suggestion/Question   HTML Output Suggestion/Question Icon_minitimeWed Nov 11, 2009 4:28 am

billyad2000 wrote:
At the moment invalid tags are just ignored and as such will be added to the html, should be fairly obvious just by looking at the html where the error is.

The only other issue I could think of is nfos that are missing fields, it is conceivable that in a large collection a person may have one or two incompleted fields, in this instance the information is just not added, no error will occur and the overall html should not be affected.

btw, at the moment the list is generated according to the filtered list, so if any filters (text or genre) are applied then they will be applied to the output html, this also applies to the sortorder.

You would probably want/need to convert the "<" to "&lt;" etc. But outputting it (perhaps with a reason for failure) is probably the best way to handle it.
Back to top Go down
http://dennisbareis.com
dbareis
Senior Member
Senior Member
dbareis


Posts : 223
Join date : 2008-12-08

HTML Output Suggestion/Question Empty
PostSubject: Re: HTML Output Suggestion/Question   HTML Output Suggestion/Question Icon_minitimeThu Nov 12, 2009 12:26 am

Hi,

To be able to create some more advanced pages I'd want at least a movie counter which is different for each movie, this will allow me to create anchors and named objects for javascript manipulation etc (clicking on movie expanding details etc).

Thanks,
Dennis
Back to top Go down
http://dennisbareis.com
billyad2000
Admin
billyad2000


Posts : 1326
Join date : 2008-09-20

HTML Output Suggestion/Question Empty
PostSubject: Re: HTML Output Suggestion/Question   HTML Output Suggestion/Question Icon_minitimeThu Nov 12, 2009 2:12 am

dbareis wrote:
Hi,

To be able to create some more advanced pages I'd want at least a movie counter which is different for each movie, this will allow me to create anchors and named objects for javascript manipulation etc (clicking on movie expanding details etc).

Thanks,
Dennis

I'm sorry, but your going to have to spell it out for me, i'm not sure what you mean. The imdbid is different for each movie.
Back to top Go down
http://billyad2000.co.uk
dbareis
Senior Member
Senior Member
dbareis


Posts : 223
Join date : 2008-12-08

HTML Output Suggestion/Question Empty
PostSubject: Re: HTML Output Suggestion/Question   HTML Output Suggestion/Question Icon_minitimeThu Nov 12, 2009 7:12 am

billyad2000 wrote:
dbareis wrote:
Hi,

To be able to create some more advanced pages I'd want at least a movie counter which is different for each movie, this will allow me to create anchors and named objects for javascript manipulation etc (clicking on movie expanding details etc).

Thanks,
Dennis

I'm sorry, but your going to have to spell it out for me, i'm not sure what you mean. The imdbid is different for each movie.

For the first movie you might return 1 for "<<MovieNumber>>", 2 for the next etc, all the rest is my hard work :-)

I'd generate something like:

Code:
...<div id='DIV_MOVE_1' style='display:block'>...

Add a bit of javascript an onclick events referring to the "id" and away you go :-)
Back to top Go down
http://dennisbareis.com
StormyKnight
VIP
VIP



Posts : 556
Join date : 2008-10-08
Location : Australia

HTML Output Suggestion/Question Empty
PostSubject: Re: HTML Output Suggestion/Question   HTML Output Suggestion/Question Icon_minitimeThu Nov 12, 2009 10:43 am

Dennis & Billy,

I found the following link which I think demostrates the concept of what you are trying to do....

http://teamtutorials.com/web-development-tutorials/hide-and-show-a-div-using-javascript

Billy, I think all that MC needs to do is provide an incrementing number that is returned for each movie as it is written to the html.....However I think that the IMDB number would also work here as it is different for every movie anyway & doesn't require any additional code.

One thing I read was that the Div ID 'shouldn't' start with a number but a letter to be html compliant.....I don't know if this will cause an issue on current browsers though...

Cheers
Back to top Go down
dbareis
Senior Member
Senior Member
dbareis


Posts : 223
Join date : 2008-12-08

HTML Output Suggestion/Question Empty
PostSubject: Re: HTML Output Suggestion/Question   HTML Output Suggestion/Question Icon_minitimeThu Nov 12, 2009 10:57 am

StormyKnight wrote:
Dennis & Billy,

I found the following link which I think demostrates the concept of what you are trying to do....

http://teamtutorials.com/web-development-tutorials/hide-and-show-a-div-using-javascript

Billy, I think all that MC needs to do is provide an incrementing number that is returned for each movie as it is written to the html.....However I think that the IMDB number would also work here as it is different for every movie anyway & doesn't require any additional code.

One thing I read was that the Div ID 'shouldn't' start with a number but a letter to be html compliant.....I don't know if this will cause an issue on current browsers though...

Thanks for the link but I already do it (I will have a look later, maybe it does it better, can't hurt to look).

The IMDB number is not unique and can be "" (hence the MC duplicate search function and the exceptions for this).

Given a number I can generate any number of requirements so doesn't need to conform with anything. This is just a number incremented with each movie, no need for any consistancy between generations of html.
Back to top Go down
http://dennisbareis.com
billyad2000
Admin
billyad2000


Posts : 1326
Join date : 2008-09-20

HTML Output Suggestion/Question Empty
PostSubject: Re: HTML Output Suggestion/Question   HTML Output Suggestion/Question Icon_minitimeTue Nov 17, 2009 3:23 pm

The current supported tags are:
<<moviecount>> - this is the total movies
<<title>>
<<movietitleandyear>>
<<movieyear>>
<<runtime>>
<<rating>>
<<outline>>
<<imdb_url>>
<<fullpathandfilename>>
<<count>> - incremental counter
<<plot>> - This works, but needs to be loaded from each nfo so will be considerably slower than creating a html without it.

Templates must be saved in .txt format and be located within a folder called "html_templates" located in the MC root. At startup these templates are loaded into a HTML output submenu

I have created 2 demo templates that work and demonstrate the format
Code:
<title>Basic Movie List</title>
<<MC HTML Page>>
<<header>>
<meta  content="text/html;  charset=UTF-8"  http-equiv="Content-Type">
<h1 align="center"><font size="6"><b>XBMC Media Companion</b></font></h1>
<h2 align="center"><font size="5"><b>HTML Output</b></font></h2>
<h3 align="center"><<moviecount>> movies</h3>
<p align=""center"">&nbsp;</p>
<</header>>
<<body>>
<p align="center"><b><a href="<<imdb_url>>"><<movietitleandyear>></a></b></p>
<</body>>
<</MC HTML Page>>

Code:
<title>Basic List with Plot</title>
<<MC HTML Page>>
<<header>>
<meta  content="text/html;  charset=UTF-8"  http-equiv="Content-Type">
<h1 align="center"><font size="6"><b>XBMC Media Companion</b></font></h1>
<h2 align="center"><font size="5"><b>HTML Output</b></font></h2>
<h3 align="center"><<moviecount>> movies</h3>
<p align="center">&nbsp;</p>
<</header>>
<<body>>
<p align="center"><b><a href="<<imdb_url>>"><<movietitleandyear>></a></b></p>
<p align="center"><<fullplot>></p><hr/>
<</body>>
<</MC HTML Page>>

The features of this will be extended as the need arises.

The <title> tag must be included, and be individual to the template, this is how it will be listed in the HTML output submenu. If anyone wants to present templates for testing then please feel free.
Back to top Go down
http://billyad2000.co.uk
StormyKnight
VIP
VIP



Posts : 556
Join date : 2008-10-08
Location : Australia

HTML Output Suggestion/Question Empty
PostSubject: Re: HTML Output Suggestion/Question   HTML Output Suggestion/Question Icon_minitimeWed Nov 18, 2009 11:03 am

Good work Billy, um...when can we have a play ?
Back to top Go down
billyad2000
Admin
billyad2000


Posts : 1326
Join date : 2008-09-20

HTML Output Suggestion/Question Empty
PostSubject: Re: HTML Output Suggestion/Question   HTML Output Suggestion/Question Icon_minitimeWed Nov 18, 2009 12:35 pm

StormyKnight wrote:
Good work Billy, um...when can we have a play ?

Still tweaking a few things, but there will be a new build by the end of the week
Back to top Go down
http://billyad2000.co.uk
StormyKnight
VIP
VIP



Posts : 556
Join date : 2008-10-08
Location : Australia

HTML Output Suggestion/Question Empty
PostSubject: Re: HTML Output Suggestion/Question   HTML Output Suggestion/Question Icon_minitimeWed Nov 18, 2009 2:18 pm

No worries Smile
Back to top Go down
StormyKnight
VIP
VIP



Posts : 556
Join date : 2008-10-08
Location : Australia

HTML Output Suggestion/Question Empty
PostSubject: Re: HTML Output Suggestion/Question   HTML Output Suggestion/Question Icon_minitimeTue Nov 24, 2009 2:07 am

Pr.Sinister wrote:
Just one request if possible, can you add a tag for fullpath without
the filename please? This would allow us to use the posters and
fanart in our HTML output if we wish to do so.

-Pr.

Just extending on what Pr.Sinister wrote in the announcements section re V3.168, if we had a tag for the location of MC, & a tag for just the IMDB number we could "locate" the cached thumbnails & as such display them in the html with little extra effort in the programming.

<<MCFullPath>>/Settings/postercache/<<IMDBNumber>>.jpg

Cheers
Back to top Go down
Sponsored content





HTML Output Suggestion/Question Empty
PostSubject: Re: HTML Output Suggestion/Question   HTML Output Suggestion/Question Icon_minitime

Back to top Go down
 
HTML Output Suggestion/Question
Back to top 
Page 1 of 2Go to page : 1, 2  Next
 Similar topics
-
» 3.268 HTML output
» Posters to html output?
» HTML Output Sharing
» Easy access to HTML output.
» Output Movie List to HTML bug?

Permissions in this forum:You cannot reply to topics in this forum
Media Companion :: Media Companion :: HTML Templates-
Jump to: