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)



- DPickles - 2011-03-12

steve1977 Wrote:Separate note, have you "opened up" access to MFP to the world outside your personal LAN? If so, can you point me to a description how to do this in the safest manner. Thanks!!!

I'm interested in this as well. Has anyone been able to do this with Live? Keeping mfp on my live installation just works better for me atm until i build a server. I tried installing no-ip but i couldn't get it to update my ip. Could have something to do with my router configuration though. I'll keep playing.


- gugahoi - 2011-03-12

steve1977 Wrote:Using Win7x32 with XAMPP. I am in the progress to make a fresh install of XAMPP and will then use your fork of MFP. Fingers crossed.

Separate note, have you "opened up" access to MFP to the world outside your personal LAN? If so, can you point me to a description how to do this in the safest manner. Thanks!!!

DPickles Wrote:I'm interested in this as well. Has anyone been able to do this with Live? Keeping mfp on my live installation just works better for me atm until i build a server. I tried installing no-ip but i couldn't get it to update my ip. Could have something to do with my router configuration though. I'll keep playing.

Answering to both of you. If you want to open mfp up to "the outside world"
then you have to know a few things about your internet connection. First thing is do you have a STATIC or DYNAMIC IP.

Most people have a dynamic ip which means you will have to set up a Domain Name Server (DNS). I personally use DynDNS.com, it is free for a couple of domains I think, and since I only use it for MFP then it works fine for me. This service basically translates your ip to a known "word based" address (eg.: yourname.homeip.net). Then make sure you install their auto-updater so that your address will automatically be updated with the new ip every time it changes (Some routers support DNS built in).

After that, just make sure to activate port-forwarding in your router to the port and ip address that your Web Server will be in and remember to check the firewall so that the port is actually open.

Lastly, to make sure no one else has access to your mfp page, you should create HTACCES password security. This might be a good tutorial if you need.

And just to clarify - I have made no major changes in my fork so if mine works then the original one should work as well. I'm just updating some widgets to suit my needs ( for now Search widget). And in the future I have ideas for new ones.

So there it is. It is easier than it sounds so don't be hesitant to do this if you want to access mfp from anywhere. If I haven't been clear at any point then ask again so I can try and clarify further. Hope I could be of help. Cheers


Clean XBMC Video Library - RaNaMaster - 2011-03-12

does anyone has Clean XBMC Video Library widget working
Code:
$shortcut["Clean XBMC Video Library"] = array("xbmcsend" => 'CleanLibrary(video)'); // Optionally add 'host' => 'localhost', 'port' => 9777 to connect to a different machine.
im not sure how i can configer this can someone help me my http server is on a remote pc its not on the xbmc pc
http server address 192.168.1.100 xbmc 192.168.1.4


- hernandito - 2011-03-15

First of all thank you for MFP. It has already become my management screen.

I have been trying to get this to work, and I finally got it working, sort of...

On my home screen, I can see my SABNzbd, Coming Episodes, Hard Drives, RSS Feeds.

What I cannot see are Recent Movies, Recent TV, and XBMC Library.

On the XBMC Library widget, I get the following error:

Code:
XBMC's JSON API did not respond.

Check your configuration (config.php) and that the JSON
service variable is configured correctly and that the Service
is running.

I have XBMC Dharma 10.0 on an ATV2. My media, and centralized MySQL files, and Thumbnails are on an unRAID server. I also have MFP being served from the unRAID server.

On XBMC, I have configured my Web Interface as "Default". The above items do not show up. I changed the Web Interface to "JSON RPC Debug", they still do not work.

Below are the contents of my config.php


Code:
<?php
// Only set the $mfpsecured variable to true if you have secured
// MediaFrontPage with a password via .htaccess or some other method
// use at your own risk as this can create a security vulnerability in
// the wControl widget.
$mfpsecured = false;

// Alternativly you can set a unique key here.
$mfpapikey = '';  //

// enter hostname and port of the xbmc json service here. By default 8080
$xbmcjsonservice = 'http://192.168.0.198:2323'; //remove 'USER:PASSWORD@' if your xbmc install does not require a password.
$xbmcimgpath = 'http://192.168.0.198:2323/vfs/'; //leave as default if unsure

$xbmcdbconn = array(
        'video' => array('dns' => 'sqlite:/home/xbmc/.xbmc/userdata/Database/MyVideos34.db', 'username' => '', 'password' => '', 'options' => array()),
        'music' => array('dns' => 'sqlite:/home/xbmc/.xbmc/userdata/Database/MyMusic7.db', 'username' => '', 'password' => '', 'options' => array()),
    );
//Example of mysql connections
/*
$xbmcdbconn = array(
        'video' => array(
            'dns' => 'mysql:host=192.168.0.201;dbname=xbmc_video',
            'username' => 'xbmc',
            'password' => 'xbmc',
            'options' => array(PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES utf8")
        ),
        'music' => array(
            'dns' => 'mysql:host=192.168.0.201;dbname=xbmc_music',
            'username' => 'xbmc',
            'password' => 'xbmc',
            'options' => array(PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES utf8")
        ),
        
    );
*/

// enter path to sickbeards's coming episodes page
$sickbeardcomingepisodes = 'http://192.168.0.201:8081/comingEpisodes/';
$sickbeardurl = "http://192.168.0.201:8081/home/";

// enter SABnzbd+ URL and API key
$saburl = 'http://192.168.0.201:88/';  // The full URL you use to access SABnzbd.
$sabapikey = 'REMOVED FOR SAFETY';                             // SABnzbd's API Key found in Config>General.

//enter NZBmatrix login
$nzbusername = 'Removed for safety';        //username
$nzbapi = 'Removed for safety';            //api

// enter navigation bar links
$navlink;
$navlink["Sickbeard"] = "http://192.168.0.201:8081/";
$navlink["Couch Potato"] = "http://192.168.0.201:5000/movie/";
//$navlink["TV Headend"] = "/tvheadend";
$navlink["Sabnzbd"] = "http://192.168.0.201:88/#/dv1/";
$navlink["Tower"] = "http://tower/main.htm";
$navlink["unMenu"] = "http://tower:8080/";
$navlink["XBMC"] = "http://192.168.0.198:2323/";

// enter shortcut links for control section
$shortcut;
$shortcut["Shutdown XBMC"] = array("cmd" => 'shutdown');
$shortcut["Update XBMC Video Library"] = array("cmd" => 'vidscan');
//$shortcut["Clean XBMC Video Library"] = array("xbmcsend" => 'CleanLibrary(video)'); // Optionally add 'host' => 'localhost', 'port' => 9777 to connect to a different machine.
$shortcut["Update XBMC Audio Library"] = array("json" => '{"jsonrpc": "2.0", "method": "AudioLibrary.ScanForContent", "id" : 1 }');
$shortcut["Google"] = "http://www.google.com/";
/*
$shortcut["Input - XBMC"] = "/input/xbmc";
$shortcut["Input - Pay TV"] = "/input/cable";
$shortcut["Input - Games"] = "/input/games";
$shortcut["Now Playing"] = "/nowplaying";
$shortcut["Turn TV On"] = "/tv/on";
$shortcut["Turn TV Off"] = "/tv/off";
$shortcut["Turn Xbox On"] = "/xbox/on";
$shortcut["Turn Xbox Off"] = "/xbox/off";
*/

// enter directories for hard drive section
$drive;
$drive["unRAID 1"] = "/mnt/disk1/";
$drive["unRAID 2"] = "/mnt/disk2/";
$drive["unRAID 3"] = "/mnt/disk3/";
$drive["unRAID 4"] = "/mnt/disk4/";
$drive["unRAID 5"] = "/mnt/disk5/";
$drive["Cache"] = "/mnt/cache/";



// enter rss feeds. Ensure sabnzbd > config > index sites is set. Supports cat, pp, script, priority as per the sabnzbd api.
//$rssfeeds["NZBMatrix - TV Shows (DivX)"]    = array("url" => "http://rss.nzbmatrix.com/rss.php?subcat=6", "cat" => "tv");
$rssfeeds["NZBMatrix - Movies (HD x264)"]   = array("url" => "http://rss.nzbmatrix.com/rss.php?subcat=42", "cat" => "movies");
$rssfeeds["NZBMatrix - TV Shows (HD x264)"] = array("url" => "http://rss.nzbmatrix.com/rss.php?subcat=41", "cat" => "tv");
//$rssfeeds["NZBMatrix - Movies (DivX)"]      = array("url" => "http://rss.nzbmatrix.com/rss.php?subcat=2", "cat" => "movies");

//$rssfeeds["NZBMatrix - Music (MP3)"]        = array("url" => "http://rss.nzbmatrix.com/rss.php?subcat=22", "cat" => "music");
//$rssfeeds["NZBMatrix - Music (Lossless)"]   = array("url" => "http://rss.nzbmatrix.com/rss.php?subcat=23", "cat" => "music");
//$rssfeeds["NZBMatrix - Sports"]             = array("url" => "http://rss.nzbmatrix.com/rss.php?subcat=7", "cat" => "sports");
$rssfeeds["MediaFrontPage on Github"]       = array("url" => "https://github.com/nick8888/mediafrontpage/commits/master.atom", "type" => "atom");

//$customStyleSheet = "";
//Example of how to use this
//$customStyleSheet = "css/lighttheme.css";
$customStyleSheet = "css/minimal.css";

//Show only posters for coming episodes
//$customStyleSheet = "css/comingepisodes-minimal-poster.css";

//Show only banners for coming episodes
//$customStyleSheet = "css/comingepisodes-minimal-banner.css";

?>
Can anyone help please? Huh Nod

Also as mentioned, I have centralized my XBMC library using MySQL along with centralizing the Thumbnails via symlinks. Because of this, I am not sure what to enter for the xbmcimgpath = setting.

Many thanks.

H.


- blackic3 - 2011-03-15

hernandito Wrote:First of all thank you for MFP. It has already become my management screen.

I have been trying to get this to work, and I finally got it working, sort of...

On my home screen, I can see my SABNzbd, Coming Episodes, Hard Drives, RSS Feeds.

What I cannot see are Recent Movies, Recent TV, and XBMC Library.

On the XBMC Library widget, I get the following error:

Code:
XBMC's JSON API did not respond.

Check your configuration (config.php) and that the JSON
service variable is configured correctly and that the Service
is running.

I have XBMC Dharma 10.0 on an ATV2. My media, and centralized MySQL files, and Thumbnails are on an unRAID server. I also have MFP being served from the unRAID server.

On XBMC, I have configured my Web Interface as "Default". The above items do not show up. I changed the Web Interface to "JSON RPC Debug", they still do not work.

Below are the contents of my config.php


Code:
<?php
// Only set the $mfpsecured variable to true if you have secured
// MediaFrontPage with a password via .htaccess or some other method
// use at your own risk as this can create a security vulnerability in
// the wControl widget.
$mfpsecured = false;

// Alternativly you can set a unique key here.
$mfpapikey = '';  //

// enter hostname and port of the xbmc json service here. By default 8080
$xbmcjsonservice = 'http://192.168.0.198:2323'; //remove 'USER:PASSWORD@' if your xbmc install does not require a password.
$xbmcimgpath = 'http://192.168.0.198:2323/vfs/'; //leave as default if unsure

$xbmcdbconn = array(
        'video' => array('dns' => 'sqlite:/home/xbmc/.xbmc/userdata/Database/MyVideos34.db', 'username' => '', 'password' => '', 'options' => array()),
        'music' => array('dns' => 'sqlite:/home/xbmc/.xbmc/userdata/Database/MyMusic7.db', 'username' => '', 'password' => '', 'options' => array()),
    );
//Example of mysql connections
/*
$xbmcdbconn = array(
        'video' => array(
            'dns' => 'mysql:host=192.168.0.201;dbname=xbmc_video',
            'username' => 'xbmc',
            'password' => 'xbmc',
            'options' => array(PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES utf8")
        ),
        'music' => array(
            'dns' => 'mysql:host=192.168.0.201;dbname=xbmc_music',
            'username' => 'xbmc',
            'password' => 'xbmc',
            'options' => array(PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES utf8")
        ),
        
    );
*/

// enter path to sickbeards's coming episodes page
$sickbeardcomingepisodes = 'http://192.168.0.201:8081/comingEpisodes/';
$sickbeardurl = "http://192.168.0.201:8081/home/";

// enter SABnzbd+ URL and API key
$saburl = 'http://192.168.0.201:88/';  // The full URL you use to access SABnzbd.
$sabapikey = 'REMOVED FOR SAFETY';                             // SABnzbd's API Key found in Config>General.

//enter NZBmatrix login
$nzbusername = 'Removed for safety';        //username
$nzbapi = 'Removed for safety';            //api

// enter navigation bar links
$navlink;
$navlink["Sickbeard"] = "http://192.168.0.201:8081/";
$navlink["Couch Potato"] = "http://192.168.0.201:5000/movie/";
//$navlink["TV Headend"] = "/tvheadend";
$navlink["Sabnzbd"] = "http://192.168.0.201:88/#/dv1/";
$navlink["Tower"] = "http://tower/main.htm";
$navlink["unMenu"] = "http://tower:8080/";
$navlink["XBMC"] = "http://192.168.0.198:2323/";

// enter shortcut links for control section
$shortcut;
$shortcut["Shutdown XBMC"] = array("cmd" => 'shutdown');
$shortcut["Update XBMC Video Library"] = array("cmd" => 'vidscan');
//$shortcut["Clean XBMC Video Library"] = array("xbmcsend" => 'CleanLibrary(video)'); // Optionally add 'host' => 'localhost', 'port' => 9777 to connect to a different machine.
$shortcut["Update XBMC Audio Library"] = array("json" => '{"jsonrpc": "2.0", "method": "AudioLibrary.ScanForContent", "id" : 1 }');
$shortcut["Google"] = "http://www.google.com/";
/*
$shortcut["Input - XBMC"] = "/input/xbmc";
$shortcut["Input - Pay TV"] = "/input/cable";
$shortcut["Input - Games"] = "/input/games";
$shortcut["Now Playing"] = "/nowplaying";
$shortcut["Turn TV On"] = "/tv/on";
$shortcut["Turn TV Off"] = "/tv/off";
$shortcut["Turn Xbox On"] = "/xbox/on";
$shortcut["Turn Xbox Off"] = "/xbox/off";
*/

// enter directories for hard drive section
$drive;
$drive["unRAID 1"] = "/mnt/disk1/";
$drive["unRAID 2"] = "/mnt/disk2/";
$drive["unRAID 3"] = "/mnt/disk3/";
$drive["unRAID 4"] = "/mnt/disk4/";
$drive["unRAID 5"] = "/mnt/disk5/";
$drive["Cache"] = "/mnt/cache/";



// enter rss feeds. Ensure sabnzbd > config > index sites is set. Supports cat, pp, script, priority as per the sabnzbd api.
//$rssfeeds["NZBMatrix - TV Shows (DivX)"]    = array("url" => "http://rss.nzbmatrix.com/rss.php?subcat=6", "cat" => "tv");
$rssfeeds["NZBMatrix - Movies (HD x264)"]   = array("url" => "http://rss.nzbmatrix.com/rss.php?subcat=42", "cat" => "movies");
$rssfeeds["NZBMatrix - TV Shows (HD x264)"] = array("url" => "http://rss.nzbmatrix.com/rss.php?subcat=41", "cat" => "tv");
//$rssfeeds["NZBMatrix - Movies (DivX)"]      = array("url" => "http://rss.nzbmatrix.com/rss.php?subcat=2", "cat" => "movies");

//$rssfeeds["NZBMatrix - Music (MP3)"]        = array("url" => "http://rss.nzbmatrix.com/rss.php?subcat=22", "cat" => "music");
//$rssfeeds["NZBMatrix - Music (Lossless)"]   = array("url" => "http://rss.nzbmatrix.com/rss.php?subcat=23", "cat" => "music");
//$rssfeeds["NZBMatrix - Sports"]             = array("url" => "http://rss.nzbmatrix.com/rss.php?subcat=7", "cat" => "sports");
$rssfeeds["MediaFrontPage on Github"]       = array("url" => "https://github.com/nick8888/mediafrontpage/commits/master.atom", "type" => "atom");

//$customStyleSheet = "";
//Example of how to use this
//$customStyleSheet = "css/lighttheme.css";
$customStyleSheet = "css/minimal.css";

//Show only posters for coming episodes
//$customStyleSheet = "css/comingepisodes-minimal-poster.css";

//Show only banners for coming episodes
//$customStyleSheet = "css/comingepisodes-minimal-banner.css";

?>
Can anyone help please? Huh Nod

Also as mentioned, I have centralized my XBMC library using MySQL along with centralizing the Thumbnails via symlinks. Because of this, I am not sure what to enter for the xbmcimgpath = setting.

Many thanks.

H.

have you tried updating xbmc to a newer version as the first builds had the webserver disabled


- hernandito - 2011-03-15

blackic3 Wrote:have you tried updating xbmc to a newer version as the first builds had the webserver disabled

On the ATV2 I am on a Feb 27 Build. I do have a 10.1 Live version of XBMC, which I will try to configure and key into that one. I am not sure if this is happening because on something configured in the server that is hosting the web site, or because my library is centralised using MySQL, or something is missing from the ATV2. I am able to control the ATV from Couch Potato and Sickbeard.

If someone has any info, please advice.

Thanks.

H.


- hernandito - 2011-03-16

No luck... I switched my config.php to point to my XBMC Live computer. On that computer I have set the Web Interface to "Default" as well. I am getting the same results.

I am guessing this has something to do with either my centralized MySQL, or something with the php setup. I keep reading about cURL. How do I determine if this is running on my unRAID server?

Please any help is greatly appreciated.

Thanks.


- Kewlj1313 - 2011-03-16

Hello, thanks alot for the work you've done with this! I was seeing some odd issues with Hard Drive sizes using Windows and Apache 2.2 (Php 5.3). I found it was the .to_readable_size within the HardDrives widget that was causing the problem. I fixed the code and implemented a manual way of deriving GB and TB from the bytes given by the commands used. You can take a look at the code here:

http://pastebin.com/SDZPjC3G

As you can see from here before the fix all of the HDDs were reflected as 2TB due to that .to_readable_size: http://dl.dropbox.com/u/941521/HDDs.PNG

and after my fix the sizes are listed correctly:
http://dl.dropbox.com/u/941521/HDDsFixed.PNG

Hopefully this helps out, please let me know I may have some other ideas of php areas to work on.

Thank You,

Kewlj1313


- hernandito - 2011-03-16

sniff... sniff....Sad

AnyoneHuh


- imnotknow - 2011-03-16

I found a small bug in wControl.php:

Code:
function widgetMenu($baseurl) {
        global $shortcut;

$mfpapikey is not getting passed into this function so shell commands aren't working if you use the apikey.

I changed it to this to get it to work:

Code:
function widgetMenu($baseurl) {
        global $shortcut, $mfpapikey;



- boulala - 2011-03-17

hy guys

question how would i have to configure a widget to show me the wanted movies from couchpotato? maybe with the option to add a movie to the wanted list?

greetz


- jamjoe - 2011-03-17

hernandito Wrote:No luck... I switched my config.php to point to my XBMC Live computer. On that computer I have set the Web Interface to "Default" as well. I am getting the same results.

I am guessing this has something to do with either my centralized MySQL, or something with the php setup. I keep reading about cURL. How do I determine if this is running on my unRAID server?

Please any help is greatly appreciated.

Thanks.

My config has the following for the json service, where the user, pass, and port are what I have configured under the network settings in XBMC:

Code:
$xbmcjsonservice = "http://user:[email protected]:8082/jsonrpc";

The following code in a php page will tell you whether you have curl running.

Code:
<?php
phpinfo();
?>



- prophetizer - 2011-03-18

boulala Wrote:hy guys

question how would i have to configure a widget to show me the wanted movies from couchpotato? maybe with the option to add a movie to the wanted list?

greetz


oh man that would be awesome


- hernandito - 2011-03-18

jamjoe Wrote:
Code:
$xbmcjsonservice = "http://user:[email protected]:8082/jsonrpc";

The following code in a php page will tell you whether you have curl running.

Jamjoe, THANK YOU!! Nod You rock. This was the bit that kept it from working...

I now have it all working... thank you, thank you.


- gugahoi - 2011-03-18

Hey all, I finally managed to get the Search widget to work as I intended. No reload required, results are loaded on the fly! I've got a few bugs I'm gonna need to sort but all in all I'm very happy with the way I got it done. If you guys want to have a look at it just head on to my repo --> https://github.com/gugahoi/mediafrontpage/

@boulala
If you can understand the code for the coming episodes widget than this should be possible. Have a look at the example widget to get the barebones but some research is gonna be required.

@Kewlj1313
Added your function to my fork. Probably gonna use that to calculate the size of search results too. Thanks.

@imnotknown
Fixed that in my repo. Thanks.