[19. April 2013] A-400 Advanced Network Setup now available | [11 Jan. 2013] Customize your A-400 Home Screen

Firmware: A-400 [13 May 2013] | C-300 [30 Nov. 2012] | A-300 [30 Nov. 2012] | C-200 [21 Jan. 2013] | A-200/A-210 [10 Aug. 2012]

Just got your NMT | WIKI has the answers | Search the forum | Forum Rules/Policy | Firmware & Official NMT News | Popcornhour manuals



User(s) browsing this thread: 1 Guest(s)
Post Reply 
oversight macro & variable doubt
05-01-2012, 07:02 PM
Post: #1
oversight macro & variable doubt
Setzer Wrote:Sorry for bother you again, im playing with oversight skins

i'm trying evaluate this expression, and need page_max like a variable:

[:IF([:PAGE_MAX:]>$?p+1):]

< a href="http://192.168.1.50:8883/oversight/oversight.cgi?p=[:EVAL($?p+1):]">Siguiente</a>

[:ENDIF:]

i can't get the sintax, thinked about drop pass page_max to a javascript variable, then process it, but don't see it well done, and don't know if oversight have a way to get the output of a macro in a expression.
parser said: <!-- ERROR: missing ) for [IF($?p+1>[] -->):]

sure is my fault, bc i don't have knowledge in programming.
don't know if i explined well, srry for my english.

ty for you time, see you

Hi, It might be better to post in the forums so other can advise. esp with javascript.
It looks like Javascript will be the simplest solution.
Also page_max is calculated from nubmer of items / rows * cols - and I thnik these are all available as $xx variables so you can do simple arithmetic on them?

Oversight: Jukebox | FeedTime: Automatic nzbs
Find all posts by this user
Add Thank You Quote this message in a reply
05-01-2012, 10:53 PM (This post was last modified: 05-04-2012 03:56 PM by Setzer.)
Post: #2
RE: oversight macro & variable doubt
ok, i'll paste here solution for future references:

The idea is build two links for our skin, back and next for move in the grid, when we are in the 0 and last page, link dessapear. a solution using javascript is:

Code:
<script type="text/javascript">
            var maxp = [:PAGE_MAX:];
            var pagsig = [:PAGE:];        
                var pagant = pagsig - 2;
            if (pagant>-1) {
                url = '<a class=menutitle href="oversight.cgi?p=';
                url = url + pagant;
                url = url + '">Anterior</a>&nbsp;&nbsp;&nbsp;';
                document.write(url);
            }
            if (pagsig<maxp) {
                url='<a class=menutitle href="oversight.cgi?p=';
                url = url + pagsig;
                url = url + '">Siguiente</a>';
                document.write(url);
            }
        </script>

I used the macro [:PAGE_MAX:], now whe know where the grid ends.
Macro [:PAGE:] will tell us in what page we are.
With both variables, we can build the links to move to Back and Next page. Remember, the grid start at page 0.
Find all posts by this user
Add Thank You Quote this message in a reply
[+] 1 user says Thank You to Setzer for this post
05-04-2012, 06:58 PM
Post: #3
RE: oversight macro & variable doubt
I again, have a new question.

I want add a new page to my skin, an example mynewfile.template. There are a way to Oversight process it?

was thinking, like other solution, in a [:if:] in menu.template, evaluating via url, but don't know if oversight have a way to do it directly.

ty, regards.
Find all posts by this user
Add Thank You Quote this message in a reply
05-04-2012, 08:27 PM
Post: #4
RE: oversight macro & variable doubt
Not quite sure what you mean. You want to include a file so its output is merged with the current file?
Or you want to link to something?

Oversight: Jukebox | FeedTime: Automatic nzbs
Find all posts by this user
Add Thank You Quote this message in a reply
05-04-2012, 09:00 PM
Post: #5
RE: oversight macro & variable doubt
i want link to a file, and parse it with oversight.
i'll try explain it :)

for example i created a new file called test.template

<html>
<head></head>
<body>[:GRID:]</body>
</html>

And i put a link in menu.template pointing to test.template
Then i want parse it through oversight for get a grid in test.template.
Find all posts by this user
Add Thank You Quote this message in a reply
05-04-2012, 10:00 PM
Post: #6
RE: oversight macro & variable doubt
You mean INCLUDE_TEMPLATE ?

menu.template
PHP Code:
<html>
<
body>
[
INCLUDE_TEMPLATE(test):]
</
body>
</
html

test.template
PHP Code:
[:GRID:] 

Note the end result should be a proper html page so included templates would not usually have <html> tags. but a fragments/pieces of a page.

Oversight: Jukebox | FeedTime: Automatic nzbs
Find all posts by this user
Add Thank You Quote this message in a reply
05-04-2012, 10:55 PM
Post: #7
RE: oversight macro & variable doubt
sorry again, i'm dull explaining Smile

i'm trying avoid include.

i'm working in this skin http://www.subirimagenes.com/otros-oldci...73162.html , where you see Test is a link what must load test.template ,forgetting main.template, and if test.template have macros, must be processed.

maybe there are a way or macro to do it, i tryed too [:TEMPLATE_URL:], but it give me a direct link to the file.
don't know if oversight can do something like http://your-ip:8883/oversight/oversight.cgi?loadtemplate=test.template and then instead load main.template, oversight show me the new file. if have a macro, process it.
Find all posts by this user
Add Thank You Quote this message in a reply
05-05-2012, 12:29 AM
Post: #8
RE: oversight macro & variable doubt
Ah the closest to that is LINK this will link back to oversight.cgi with new parameter list...

eg.

[:LINK(view=menu&a=b,Test):]

However the only values for view are tv, movie, tvboxset, movieboxset , menu , person and admin

So I think you need one control file for each view. eg..

menu.template
PHP Code:
[:IF($?menu=1):]
[:
INCLUDE_TEMPLATE(menu1):]
[:ELSEIF($?
menu=2):]
[:
INCLUDE_TEMPLATE(menu2):]
[:ELSE:]
normal menu here
[:LINK(view=menu&menu=2):]
[:ENDIF:] 

then

menu2.template
PHP Code:
stuff for menu 2. 

Not pretty. I , I'll put up a new version with a template name parameter (tn) so you can do [:LINK(view=menu&tn=menu2):]
Note the links have history stored in the query string to to get back you just need a Back button.

Oversight: Jukebox | FeedTime: Automatic nzbs
Find all posts by this user
Add Thank You Quote this message in a reply
05-05-2012, 02:27 AM
Post: #9
RE: oversight macro & variable doubt
Done r2316 has template name query parameter - eg tn=test

[:LINK(tn=info,Info):] will create a text link <a href="..?tn=nfo>Info</a>

Otherwise you can mannually add to a href directly in the code.
<a href="[:URL_BASE:]/oversight.cgi?tn=test"><img src="/some/image"/></a>

There is also [:BANNER_URL:] to get the new TV Banners.
<img src="[:BANNER_URL:]" />

Oversight: Jukebox | FeedTime: Automatic nzbs
Find all posts by this user
Add Thank You Quote this message in a reply
[+] 1 user says Thank You to lordy for this post
05-05-2012, 09:47 AM (This post was last modified: 05-05-2012 09:47 AM by Setzer.)
Post: #10
RE: oversight macro & variable doubt
genial, that's exactly what i was looking :)

thanks for your efforts!
Find all posts by this user
Add Thank You Quote this message in a reply
Post Reply 


Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Does oversight needs an upgrade after nzbget 11 ?? Slevin 2 318 05-18-2013 08:40 PM
Last Post: bgoldie
  Oversight to work with new NZBGet post processing script? mmccking 13 1,381 05-05-2013 10:06 AM
Last Post: Damester24
  Can't run Oversight after upgrading A400 pmcd 6 327 04-29-2013 09:38 AM
Last Post: pmcd
  Sabnzbd/Sickbeard Updating Oversight RXP 44 3,762 04-18-2013 04:39 PM
Last Post: espresso
  Oversight -> Eversion - r2312 - direct - alpha testing - feedback lordy 199 30,200 04-13-2013 08:31 PM
Last Post: espresso
  Oversight changes the PCH font sventamyra 0 280 04-13-2013 12:09 PM
Last Post: sventamyra
  Oversight -> Eversion: Genres not working Micki 0 444 03-28-2013 08:51 AM
Last Post: Micki
  slickskin [OVERSIGHT-gaya] jonny555 392 41,049 03-28-2013 12:58 AM
Last Post: Sproglet
  oversight - no detailed page for some films tombaz 3 567 03-20-2013 07:02 PM
Last Post: Setzer
  oversight to use the themoviedb.org vaidyasr 8 760 03-12-2013 08:49 PM
Last Post: Sproglet

Forum Jump: