Kodi Community Forum
MediaFrontPage - Web interface with widget type architecture to control multiple apps - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: Supplementary Tools for Kodi (https://forum.kodi.tv/forumdisplay.php?fid=116)
+--- Thread: MediaFrontPage - Web interface with widget type architecture to control multiple apps (/showthread.php?tid=83304)



- steve1977 - 2011-07-17

DejaVu Wrote:Have you cleared your browser cache after doing this?
Mine's working top notch now...

Mmh, would love to get it working exactly like in your youtube video. Not sure what is still wrong with my config. I am using subsonic on Win7x32. Could it be related to this? Also, besides main.jsp (which I changed), there are 2 similar (main_jsp.java and main_jsp.class), which I left untouched.

Any other thoughts?


- gugahoi - 2011-07-17

Dougedey Wrote:@ dejavu: I changed wNowPlaying.php so the thumbnail check became this



PHP Code:
if (!empty($items['thumbnail'])) {
                                
$thumb $items['thumbnail'];
                        } else {
                                if(!empty(
$items['fanart'])){  
                                
$handle = @fopen($items['fanart'],'r');
                                if(
$handle !== false){
                                   
$thumb $items['fanart']; 
                                }
                                }
                        } 

Basically I check to see if the fanart can be opened, if it can't it falls back to the standard image

That look like a good change actually. Will put it up soon

steve1977 Wrote:Thanks, sounds promising. I tried your repo before config.ini existed and it didn't work with reverse-proxy. It didn't pull it from the navbar properly and just returned site-not-found error. There was someone else reporting same issue back then.

But let me give it a try with the latest repo to see wheter this may work again now.

Separate question (seeing that you are using subsonic) - did you succeed to play music "underneath" your navbar? In other words, does subsonic fully work if you do not open it in a new window/tab, but as part of MFP?

Try not using '/' in the reverse proxies. Just the name - xbmc, tv, movies, etc...


- gugahoi - 2011-07-17

rflores2323 Wrote:why dont you guys add an auto update function to mediafrontpage like sickbeard and couch potato have? that way when you go the webpage you can check if there is a new version in the repo to download and compare the version.

Just a thought as I dont know if this is possible or not.

sraue Wrote:please dont do this via git or svn like there... thats a very ugly way because git is no tool for update, and if you add a autoupdate function make it fully optional via a configfile (so it cant be enabled via the browser)

I've looked into that before but as Deja said it will probably not be in MFP for a little while. Still need to finish up this last batch of changes.

BTW Sraue, how do you recommend we do the updates then?


- gugahoi - 2011-07-17

Dougedey Wrote:I looked into it a lot more last night, the feedback from the JSON RPC calls to get the active playlist items are extremely inconsistent, sometimes there'll be a plot, sometimes not, sometimes it'll give a non-existant file (like the fanart) sometimes it won't.

It's not a bug with MFP, but I just made a workaround for the inconsistencies.

I'm raising an XBMC bug now

Ye, it is not very reliable the RPC yet, but I haven't run into this problem.

DejaVu Wrote:Going by the information gives us nothing to work with.
What OS are you using and try and explain your setup a little.

Undefined variables in wIndex (Index Widget?!) in the nav.php, using terminology like Call Stack or Time Memory Function Location sounds pretty serious and is unlikely to be anything to do with MFP. Unless it's configured incorrectly.

This sounds to me, like it's more of a server configuration issue.

Line 40 of Nav.php is a foreach statement -

Code:
        foreach( $wIndex as $wId => $widget ) {
            renderWidgetHeaders($widget);    
        }
        if(!empty($customStyleSheet)) {
            echo "\t\t<link rel=\"stylesheet\" type=\"text/css\" href=\"".$customStyleSheet."\">\n";
        }
This has nothing to do with MFP, I believe it's the server it's running on.
It's a new error for me (and being that I'm a self confessed n00b - and also intoxicated at the moment!), it maybe a little over my head. Once I sober up in the morning, I'll take another look! Wink

Deja, this was actually what I pointed to you days ago. You can get rid of that for each loop in there, it only need to load on the Widgets page otherwise it will certainly throw errors. It's not that big a deal tho, but it's definitely not supposed to be in nav.php


- gugahoi - 2011-07-17

rflores2323 Wrote:
Code:
xbmc@xbmc-desktop:/opt/lampp/htdocs/mediafrontpage$ cd /opt/lampp/htdocs/mediafrontpagenew
xbmc@xbmc-desktop:/opt/lampp/htdocs/mediafrontpagenew$ sudo git pull
[sudo] password for xbmc:
remote: Counting objects: 287, done.
remote: Compressing objects: 100% (214/214), done.
remote: Total 263 (delta 142), reused 164 (delta 48)
Receiving objects: 100% (263/263), 624.09 KiB, done.
Resolving deltas: 100% (142/142), completed with 18 local objects.
From https://github.com/DejaVu77/mediafrontpage
* [new branch]      DejaVu     -> origin/DejaVu
* [new branch]      INI        -> origin/INI
+ 93599cd...df75470 master     -> origin/master  (forced update)
error: Untracked working tree file 'config.php' would be overwritten by merge.  Aborting

how do I fix this so that when I do a git pull it will update but not overwrite my config and layout files?

Sorry but new to this and I greatly appreciate the help. MFP rocks! Big Grin

This is probably because MFP auto generated config.php for you in the past. Apache is probably the owner of the file so git doesn't have permissions to overwrite it. A chmod should fix that, but if not, just re git because the changes were quite significant.

Dougedey Wrote:Thanks for the updates DejaVu, is there anyway to disable the notifcations when it saves each page? Atm I get two notifications (one appears to be the update URL)

Also: the EXTRAS json, does that need to be used for XBMC Dharma 10.1, or is the normal one fine?

That folder is actually not needed anymore like that. You should get the EXTRAS from my repo since I've updated it and it now contains info on how to set up XBMC to work over reverse proxies.


@DejaVu you should also have a look around my repo because I've noticed I've updated some files that you missed like the EXTRAS folder. Also, as mentioned before, the save button in the CSS Settings page is out of frame. You may need to change it to a two row layout.

Also wanted to say that I really like the changes you've been doing. Keep up the good work. I haven't gotten very far on my settings page in the last few days tho, been a bit busy with other stuff.


- rflores2323 - 2011-07-17

DejaVu Wrote:Right, to get my Repo working, you should clone it as master from scratch.

I have just cloned it and everything seems to working fine. (As stated on the ReadMe on my Repo).
Backup your MFP folder if you wish. Then delete it completely including the folder it lives in.

In command line type -
Code:
sudo git clone git://github.com/DejaVu77/mediafrontpage.git <Path to Installation>
In your case rflores2323
Code:
sudo git clone git://github.com/DejaVu77/mediafrontpage.git /opt/lampp/htdocs/mediafrontpage
Then from the command line type -
Code:
sudo chmod 777 /opt/lampp/htdocs/mediafrontpage/*
Then visit Localhost and you will be greeted with the ServerCheck, which should all pass fine. Then click Continue and you will be sent to the config page.

Fill all the details in relative to your setup.
You can click Save on each page, but it's not necessary as all the settings Save at once.

Once that's done, let me know if the error still exists. It should'nt do.

I am still getting the message errors below. its only when I navigate to another program while inside MFP like sickbeard, CP, Sab, etc..

Notice: Undefined variable: wIndex in /opt/lampp/htdocs/mediafrontpagexbmc/nav.php on line 40

Warning: Invalid argument supplied for foreach() in /opt/lampp/htdocs/mediafrontpagexbmc/nav.php on line 40

I am also now getting this message on the harddrive widget

Code:
Warning: disk_total_space() [function.disk-total-space]: No such file or directory in /opt/lampp/htdocs/mediafrontpagexbmc/widgets/wHardDrives.php on line 26

Warning: disk_free_space() [function.disk-free-space]: No such file or directory in /opt/lampp/htdocs/mediafrontpagexbmc/widgets/wHardDrives.php on line 27

Warning: disk_total_space() [function.disk-total-space]: No such file or directory in /opt/lampp/htdocs/mediafrontpagexbmc/functions.php on line 30

Warning: disk_free_space() [function.disk-free-space]: No such file or directory in /opt/lampp/htdocs/mediafrontpagexbmc/functions.php on line 30

Warning: disk_total_space() [function.disk-total-space]: No such file or directory in /opt/lampp/htdocs/mediafrontpagexbmc/functions.php on line 34

Warning: Division by zero in /opt/lampp/htdocs/mediafrontpagexbmc/functions.php on line 34

Warning: disk_total_space() [function.disk-total-space]: No such file or directory in /opt/lampp/htdocs/mediafrontpagexbmc/functions.php on line 30

Warning: disk_free_space() [function.disk-free-space]: No such file or directory in /opt/lampp/htdocs/mediafrontpagexbmc/functions.php on line 30

Warning: disk_total_space() [function.disk-total-space]: No such file or directory in /opt/lampp/htdocs/mediafrontpagexbmc/functions.php on line 34

Warning: Division by zero in /opt/lampp/htdocs/mediafrontpagexbmc/functions.php on line 34

Warning: disk_total_space() [function.disk-total-space]: No such file or directory in /opt/lampp/htdocs/mediafrontpagexbmc/functions.php on line 30

Warning: disk_free_space() [function.disk-free-space]: No such file or directory in /opt/lampp/htdocs/mediafrontpagexbmc/functions.php on line 30

Warning: disk_total_space() [function.disk-total-space]: No such file or directory in /opt/lampp/htdocs/mediafrontpagexbmc/functions.php on line 34

Warning: Division by zero in /opt/lampp/htdocs/mediafrontpagexbmc/functions.php on line 34



- steve1977 - 2011-07-17

gugahoi Wrote:Try not using '/' in the reverse proxies. Just the name - xbmc, tv, movies, etc...

Wow, this is cool and working. A few things that do not work (with dejavu's latest repo), but I assume they are most likely independent of the reverse-proxy settings:

1) CSS modifications cannot be saved and thus do not work

2) Headphone and Subsonic do not work from navbar yet. I assume this is just not implemented yet. I added "programs.php?p=HeadPhones" in the conf GUI and also added the reverse-proxy setting in the config.ini directly, but I assume there is some coding needed to make it actually work?

3) The reverse-proxy still needs to be manually edited in the config.ini file, which I don't mind at all

4) Changing RSS feeds has some bug, which leads to config.ini not being usable anymore (e.g., you can replicate the error by changing the order of the RSS feeds through the config GUI


Thanks again!!!


- DejaVu - 2011-07-17

gugahoi Wrote:Deja, this was actually what I pointed to you days ago. You can get rid of that for each loop in there, it only need to load on the Widgets page otherwise it will certainly throw errors. It's not that big a deal tho, but it's definitely not supposed to be in nav.php
So moving the foreach statement to my index.php (mediafrontpage.php) is a better option and should stop the errors?
I dont really want to remove the CSS statement as it's used to skin the Nav bar.

gugahoi Wrote:@DejaVu you should also have a look around my repo because I've noticed I've updated some files that you missed like the EXTRAS folder. Also, as mentioned before, the save button in the CSS Settings page is out of frame. You may need to change it to a two row layout.
I forked from your (INI_CONFIG) Repo on 8th July and you've had no commits since. I thought I was all upto speed with the changes.
Have you managed to sort out removing any of the saving alerts in settings.php yet?

CSS Save Button must be with peeps with low resolutions. Mine runs at 1680x1050 and is there. Will fix this.

--EDIT--
Oh SHIT! I've been watching your repo, you've been working on the Official Repo... Oops! Smile
https://github.com/MediaFrontPage/mediafrontpage/tree/INI

I'm going to try a Pull Request from it into my Repo and see if it all goes pear shaped. If it does, I'll start again. Smile
gugahoi Wrote:Also wanted to say that I really like the changes you've been doing. Keep up the good work. I haven't gotten very far on my settings page in the last few days tho, been a bit busy with other stuff.

Glad you approve, going to probably re-fork today and add my changes to it again. Seems the easiest option.

--EDIT--
I edited the files manually, but on save, it states there is a problem and to contact the Dev's, yet the config.ini does actually save, but only one section at a time! Huh

Code:
function ajaxRequest(params){
//    alert(params);
    $.ajax({
        type: 'GET',
        url: "settings.php?" + params,
        success: function(data) { // successful request; do something with the data
            //$("#result").html(data); //$("#result").html('Saved');
      if(data == 1){
        alert('Settings saved.');
      } else {
        alert('An error occured please try again or contact the developers.');
      }
    },
        error: function() { // failed request; give feedback to user
            alert("Error saving settings.");
        }
    });
Huh If the settings save - Say Saved. If not saved - Whinge Huh
It's whinging and saving! lol


- gugahoi - 2011-07-17

DejaVu Wrote:So moving the foreach statement to my index.php (mediafrontpage.php) is a better option and should stop the errors?
I dont really want to remove the CSS statement as it's used to skin the Nav bar.


I forked from your (INI_CONFIG) Repo on 8th July and you've had no commits since. I thought I was all upto speed with the changes.
Have you managed to sort out removing any of the saving alerts in settings.php yet?

CSS Save Button must be with peeps with low resolutions. Mine runs at 1680x1050 and is there. Will fix this.

--EDIT--
Oh SHIT! I've been watching your repo, you've been working on the Official Repo... Oops! Smile
https://github.com/MediaFrontPage/mediafrontpage/tree/INI

I'm going to try a Pull Request from it into my Repo and see if it all goes pear shaped. If it does, I'll start again. Smile


Glad you approve, going to probably re-fork today and add my changes to it again. Seems the easiest option.

--EDIT--
I edited the files manually, but on save, it states there is a problem and to contact the Dev's, yet the config.ini does actually save, but only one section at a time! Huh

Code:
function ajaxRequest(params){
//    alert(params);
    $.ajax({
        type: 'GET',
        url: "settings.php?" + params,
        success: function(data) { // successful request; do something with the data
            //$("#result").html(data); //$("#result").html('Saved');
      if(data == 1){
        alert('Settings saved.');
      } else {
        alert('An error occured please try again or contact the developers.');
      }
    },
        error: function() { // failed request; give feedback to user
            alert("Error saving settings.");
        }
    });
Huh If the settings save - Say Saved. If not saved - Whinge Huh
It's whinging and saving! lol

That's weird but I was going to say anyway that it is still full of bugs. I havent done anything in the last few days...


- gugahoi - 2011-07-17

Ok, good news. I think it's 99% ready. Have look and let me know what you think.


- DejaVu - 2011-07-17

The settings page appears to be fixed now.
Do you reckon it's usable and ready for me to restart my changes?

Should not take too long to get to where I was...?

I'll remove my Repo now and re-fork it again and start over.


- _Mikie_ - 2011-07-17

Quick question. The coming episode widgets. Minimal poster and minimal banner. Whats it meant to display?

Series name ?
Season-Episode
Episode name
Banner/Poster
Description ?

Does anyone have a script that will fetch images from outside the webroot?

Does anyone have the code for the slide bar in coming episode widget so I don't have to go digging for it?

Thanks


- DejaVu - 2011-07-17

In wComingEpisodes.php

This sets the Divs.

Code:
// START Container for Scroller bar (Wraps comingepisodeswrapper before it created).    
    echo "<div id=\"mcs3_container\">";
    echo "<div class=\"customScrollBox\">";
    echo "<div class=\"container\">";
    echo "<div class=\"content\">";
// END Container for Scroller bar (Wraps comingepisodeswrapper before it created).

    echo "\t<div id=\"comingepisodeswrapper\"></div>\n";

//START Container for Scroller bar (Close Divs and add Dragger).
    echo "</div></div><div class=\"dragger_container\"><div class=\"dragger\"></div></div></div></div>";
//END Container for Scroller bar (Close Divs and add Dragger).

In mediafrontpage.php towards the end and activates it.
Code:
        <!-- START: JQuery Scrollbar for Coming Episodes Widget, Javascript Entries -->
<script>
    $(window).load(function() {
            mCustomScrollbars();
});

function mCustomScrollbars(){
    /*
    malihu custom scrollbar function parameters:
    1) scroll type (values: "vertical" or "horizontal")
    2) scroll easing amount (0 for no easing)
    3) scroll easing type
    4) extra bottom scrolling space for vertical scroll type only (minimum value: 1)
    5) scrollbar height/width adjustment (values: "auto" or "fixed")
    6) mouse-wheel support (values: "yes" or "no")
    7) scrolling via buttons support (values: "yes" or "no")
    8) buttons scrolling speed (values: 1-20, 1 being the slowest)
    */
    $("#mcs3_container").mCustomScrollbar("vertical",900,"easeOutCirc",1.05,"auto","yes","no",0);
}

/* function to fix the -10000 pixel limit of jquery.animate */
$.fx.prototype.cur = function(){
    if ( this.elem[this.prop] != null && (!this.elem.style || this.elem.style[this.prop] == null) ) {
      return this.elem[ this.prop ];
    }
    var r = parseFloat( jQuery.css( this.elem, this.prop ) );
    return typeof r == 'undefined' ? 0 : r;
}
</script>
        <script src="js/scrollbar.js"></script>
        <!-- END: JQuery Scrollbar for Coming Episodes Widget, Javascript Entries -->

You need to embed the scrollbar.css too. Wink


- _Mikie_ - 2011-07-17

DejaVu Wrote:In wComingEpisodes.php

This sets the Divs.

Code:
// START Container for Scroller bar (Wraps comingepisodeswrapper before it created).    
    echo "<div id=\"mcs3_container\">";
    echo "<div class=\"customScrollBox\">";
    echo "<div class=\"container\">";
    echo "<div class=\"content\">";
// END Container for Scroller bar (Wraps comingepisodeswrapper before it created).

    echo "\t<div id=\"comingepisodeswrapper\"></div>\n";

//START Container for Scroller bar (Close Divs and add Dragger).
    echo "</div></div><div class=\"dragger_container\"><div class=\"dragger\"></div></div></div></div>";
//END Container for Scroller bar (Close Divs and add Dragger).

In mediafrontpage.php towards the end and activates it.
Code:
        <!-- START: JQuery Scrollbar for Coming Episodes Widget, Javascript Entries -->
<script>
    $(window).load(function() {
            mCustomScrollbars();
});

function mCustomScrollbars(){
    /*
    malihu custom scrollbar function parameters:
    1) scroll type (values: "vertical" or "horizontal")
    2) scroll easing amount (0 for no easing)
    3) scroll easing type
    4) extra bottom scrolling space for vertical scroll type only (minimum value: 1)
    5) scrollbar height/width adjustment (values: "auto" or "fixed")
    6) mouse-wheel support (values: "yes" or "no")
    7) scrolling via buttons support (values: "yes" or "no")
    8) buttons scrolling speed (values: 1-20, 1 being the slowest)
    */
    $("#mcs3_container").mCustomScrollbar("vertical",900,"easeOutCirc",1.05,"auto","yes","no",0);
}

/* function to fix the -10000 pixel limit of jquery.animate */
$.fx.prototype.cur = function(){
    if ( this.elem[this.prop] != null && (!this.elem.style || this.elem.style[this.prop] == null) ) {
      return this.elem[ this.prop ];
    }
    var r = parseFloat( jQuery.css( this.elem, this.prop ) );
    return typeof r == 'undefined' ? 0 : r;
}
</script>
        <script src="js/scrollbar.js"></script>
        <!-- END: JQuery Scrollbar for Coming Episodes Widget, Javascript Entries -->

You need to embed the scrollbar.css too. Wink

Thanks! Forgot about the scrollbar.css. In the coming episode widget what does widgetComingEpisodesHeader function do exactly?

Where do I put the content code. After before in between?


- DejaVu - 2011-07-17

I'm going to start this post by thanking Gugahoi for finishing the Settings Branch (INI) Modifications. Nice one buddy!

My Repo got completely wiped out earlier today and I re-added all the modification I've made over the past few days - today!

Reverse Proxies is now implemented
but will need testing by others as I am still unable to get my Apache to play nice.

Previous wIndex errors should now be solved and no longer occur.

CSS Save Button is now in view.

SubSonic & HeadPhones are fully supported - but edits to files within SubSonic are required.

Files that need editing to get SubSonic to stop jumping out of the iFrame.

PlayAddDownload.jsp, top.jsp & main.jsp.

(Do NOT touch and Class or Java files)

PlayAddDownload.jsp
Change -
Code:
<a href="javascript:noop()" onclick="top.playlist.onAdd('${path}');">
To -
Code:
<a href="javascript:noop()" onclick="parent.playlist.onAdd('${path}');">

top.jsp
Change -
Code:
<a href="j_acegi_logout" target="_top">
To -
Code:
<a href="j_acegi_logout" target="_parent">

main.jsp
Change -
Code:
<a href="javascript:noop()" onclick="top.playlist.onPlay('${path}')"><fmt:message key="main.playall"/></a> |
        <a href="javascript:noop()" onclick="top.playlist.onPlayRandom('${path}', 10)"><fmt:message key="main.playrandom"/></a> |
        <a href="javascript:noop()" onclick="top.playlist.onAdd('${path}')"><fmt:message key="main.addall"/></a>
To -
Code:
<a href="javascript:noop()" onclick="parent.playlist.onPlay('${path}')"><fmt:message key="main.playall"/></a> |
        <a href="javascript:noop()" onclick="parent.playlist.onPlayRandom('${path}', 10)"><fmt:message key="main.playrandom"/></a> |
        <a href="javascript:noop()" onclick="parent.playlist.onAdd('${path}')"><fmt:message key="main.addall"/></a>

login.jsp
Change -
Code:
<script type="text/javascript">
        if (window != window.top) {
            top.location.href = location.href;
        }
    </script>
To -
Code:
<!--    <script type="text/javascript">
        if (window != window.top) {
            top.location.href = location.href;
        }
    </script> -->

Feel free to refresh your install from my Repo. You should be able to keep your previous config.ini file and the settings should get picked up. But I suggestion starting from scratch again.

Any issues, let me know.

I shall be re-doing my ReadMe.md file for a while now. Smile