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)



- gugahoi - 2011-05-09

DejaVu Wrote:I'll try and explain (from memory).

--4 Columns--
Widget.css has an extra section (section4) added. All 4 sections add up to 100% of the width and can be adjusted in there. IE 27%, 23%, 30%, 20%.
layout.php has also had a 4 section added and the 4th column created.

--Submenu-
The Frameset (with nav.php in) has been stretched at the top from 35 to 62px to make it larger.
Nav.php has also had handles made for navlink1, navlink2 and navlink3. Explanation to there functions are in the Config.php. navlink2 opens in the frame. navlink3 opens a new tag (might be the other way round). nav.css has also got some stuff added for it. Not sure what the other is for, perhaps new page?

I think that covers it...

Not sure about the layout, I'm sure it was mainly an edited front.css, but I think this can be overidden using the $customstylesheet in config.php anyway.

Sweet... thanks. How do I roll back to previous commits?


- DejaVu - 2011-05-09

gugahoi Wrote:Sweet... thanks. How do I roll back to previous commits?

Supposedly -

git reset --hard <old-commit-id>
git push -f

but I've never done it before. You can have to look through the network for the commit you did last you want to rollback too.


I would probably recommend aadf7919748a0bfa3cc9

Clone it first though. Wink lol


- SleepyP - 2011-05-09

Hey guys, here's 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://xbmc:[email protected]:8082/jsonrpc"; //remove 'USER:PASSWORD@' if your xbmc install does not require a password.
$xbmcimgpath = 'http://localhost:8080/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.1.1;dbname=xbmc_video',
            'username' => 'xbmc',
            'password' => 'xbmc',
            'options' => array(PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES utf8")
        ),
        'music' => array(
            'dns' => 'mysql:host=192.168.1.1;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.1.1:8081/comingEpisodes';
$sickbeardurl = "http://192.168.1.1:8081/";

// enter SABnzbd+ URL and API key
$saburl = 'http://192.168.1.1:25914/';  // The full URL you use to access SABnzbd.

//enter NZBmatrix login

//enter nzb.su login

//Choose your default category and website to serch
$preferredSearch = '2';            // Set to 1 for NZBMatrix and 2 for nzb.su
$preferredCategories = '0';     // Check README for a list of options. Make sure the option is for the appropriate site.

//uTorrent info
$utorrent_url = ""; //url including port eg:http://localhost:8081/

//Transmission info
$transmission_url     = "http://192.168.1.1:34376/transmission/rpc";    // The url for transmission webserver
$transmission_admin    = "";    // The username for trasmission webui
$transmission_pass     = "";    // The password for the webui

// enter navigation bar links
$navlink;
$navlink["XBMC"] = "http://192.168.1.2:8080";
$navlink["Sickbeard"] = "/sickbeard";
$navlink["Couch Potato"] = "/couchpotato";
$navlink["TV Headend"] = "/tvheadend";
$navlink["Sabnzbd"] = "/sabnzbd";

// 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["OS"] = "/";
$drive["Movies"] = "/var/hda/files/drives/drive1/";
$drive["Downloads"] = "/var/hda/files/drives/drive2/";
$drive["Games"] = "/var/hda/files/drives/drive3/";
$drive["TV"] = "/var/hda/files/drives/drive4/";

// 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 - 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 - Movies (HD x264)"]   = array("url" => "http://rss.nzbmatrix.com/rss.php?subcat=42", "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";

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

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

?>

For the MySQL stuff I have tried a bunch of variations, like 127.0.0.1, localhost, and 192.168.1.1:3601. I guess I should roll my client XBMC back to 10.1 with IP addresses in the settings and see if that helps?


- SleepyP - 2011-05-09

Also, what about a Wake-On-LAN widget? I was thinking of building something like that, since we have like 4 XBMC setups in my apartment.


- SleepyP - 2011-05-09

I built a new MySQL database (called xbmcvideotest), pointed all my settings at that as opposed to xbmc_videos, and then populated it with some stuff in XBMC 10.0 Stable. Then, checking in MediaFrontPage, I see that the widgets DO work.

This implies that the schema created in the MySQL database by XBMC has changed in the nightlies?


- hernandito - 2011-05-09

Never mind.... I thought I saw something...


- mediumdry - 2011-05-09

sorry for the stupid question.. where do you get the additions/updates that haven't made it into the official git repository yet? I'd love to be able to see the upcoming shows from SickBeard, for instance...


- hernandito - 2011-05-09

SleepyP Wrote:Also, what about a Wake-On-LAN widget? I was thinking of building something like that, since we have like 4 XBMC setups in my apartment.

A really valuable change for your setup (and mine) would be a modification to the NowPlaying widget, where one could, via a dropdown box, toggle to the various XBMC clients in your network. This would mean setting some type of an if statement that will change the $xbmcimgpath variable in the config.php. As part of the toggle, it could send the wake-on-LAN command.

This has been on my wish list, but I lack the skills to do it.


- hernandito - 2011-05-09

mediumdry Wrote:sorry for the stupid question.. where do you get the additions/updates that haven't made it into the official git repository yet? I'd love to be able to see the upcoming shows from SickBeard, for instance...

The ComingEpisodes is standard on Guga's and Deja's githubs:

https://github.com/gugahoi/mediafrontpage


- SleepyP - 2011-05-09

hernandito Wrote:A really valuable change for your setup (and mine) would be a modification to the NowPlaying widget, where one could, via a dropdown box, toggle to the various XBMC clients in your network. This would mean setting some type of an if statement that will change the $xbmcimgpath variable in the config.php. As part of the toggle, it could send the wake-on-LAN command.

This has been on my wish list, but I lack the skills to do it.

This would require a re-organization of the XBMC-specific settings, plus re-coding the widgets to use those settings. What do you guys think would be a good container for that, a multi-dimensional string array? For it to work properly, I think you'd need the main web UI address, plus the image path, plus that machine's MAC address if you want Wake-On-LAN capablities.
This gets into the kind of territory where it may make sense to store the configuration in some kind of script-generated file as opposed to a PHP document. I haven't done any PHP work in a long time, but I'm gonna see if I can hack together a quick little Wake-On-LAN widget. I know PHP but don't know much about CSS or "modern" HTML, as I mostly worked on back-end stuff.


- hernandito - 2011-05-09

I was thinking more like what Guga did with the Search widget... when you pick an item, the setting is changed and the widget looks at something different.

If it is too hard, the easiest would be to create various MFP folders and access those directly... with only difference being the ip address of the XBMC client.


- hernandito - 2011-05-09

gugahoi Wrote:I also believe you guys were trying to get something like this working....?

http://www.youtube.com/watch?v=3ejENxh464M

What do you think?

I think I can come up with something to do with what you have... Would you mind sharing how you did it?

Thanks!


- DejaVu - 2011-05-09

SleepyP Wrote:Hey guys, here's 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://xbmc:[email protected]:8082/jsonrpc"; //remove 'USER:PASSWORD@' if your xbmc install does not require a password.
$xbmcimgpath = 'http://localhost:8080/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.1.1;dbname=xbmc_video',
            'username' => 'xbmc',
            'password' => 'xbmc',
            'options' => array(PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES utf8")
        ),
        'music' => array(
            'dns' => 'mysql:host=192.168.1.1;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.1.1:8081/comingEpisodes';
$sickbeardurl = "http://192.168.1.1:8081/";

// enter SABnzbd+ URL and API key
$saburl = 'http://192.168.1.1:25914/';  // The full URL you use to access SABnzbd.

//enter NZBmatrix login

//enter nzb.su login

//Choose your default category and website to serch
$preferredSearch = '2';            // Set to 1 for NZBMatrix and 2 for nzb.su
$preferredCategories = '0';     // Check README for a list of options. Make sure the option is for the appropriate site.

//uTorrent info
$utorrent_url = ""; //url including port eg:http://localhost:8081/

//Transmission info
$transmission_url     = "http://192.168.1.1:34376/transmission/rpc";    // The url for transmission webserver
$transmission_admin    = "";    // The username for trasmission webui
$transmission_pass     = "";    // The password for the webui

// enter navigation bar links
$navlink;
$navlink["XBMC"] = "http://192.168.1.2:8080";
$navlink["Sickbeard"] = "/sickbeard";
$navlink["Couch Potato"] = "/couchpotato";
$navlink["TV Headend"] = "/tvheadend";
$navlink["Sabnzbd"] = "/sabnzbd";

// 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["OS"] = "/";
$drive["Movies"] = "/var/hda/files/drives/drive1/";
$drive["Downloads"] = "/var/hda/files/drives/drive2/";
$drive["Games"] = "/var/hda/files/drives/drive3/";
$drive["TV"] = "/var/hda/files/drives/drive4/";

// 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 - 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 - Movies (HD x264)"]   = array("url" => "http://rss.nzbmatrix.com/rss.php?subcat=42", "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";

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

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

?>
A couple of pointers. You have a conflict of addresses in the first few lines and would certainly throw up the errors your getting.

Code:
// enter hostname and port of the xbmc json service here. By default 8080
$xbmcjsonservice = "http://xbmc:[email protected]:8082/jsonrpc"; //remove 'USER:PASSWORD@' if your xbmc install does not require a password.
$xbmcimgpath = 'http://localhost:8080/vfs/'; //leave as default if unsure
/*
I would change to
Code:
// enter hostname and port of the xbmc json service here. By default 8080
$xbmcjsonservice = "http://xbmc:[email protected]:8082/jsonrpc"; //remove 'USER:PASSWORD@' if your xbmc install does not require a password.
$xbmcimgpath = 'http://xbmc:[email protected]:8082/vfs/'; //leave as default if unsure
/*
The $xbmcimagepath is almost certainly on the same server as your JSON-RPC and because your looking for the images on your localhost all the time, it's not finding them and your getting a JSON errors because the images are not being found perhaps.

From what I can gather, you have a Client @ 192.168.1.2 running XBMC where all JSON queries are made, hence the change above.

A Server (MySQL) Database @ 192.168.1.1 running all your HTPC programs.

Have you setup your conf files? As you have all your shortcuts pointing to /sickbeard or /sabnzbd.

If you have not setup the conf 'forwarders' I would recommend putting the IP Addresses and Port numbers to those specific programs as instead, it's also easier...

Like -
Code:
// enter navigation bar links
$navlink;
$navlink["XBMC"] = "http://192.168.1.2:8080";
$navlink["Sickbeard"] = "http://192.168.1.1:8081";
$navlink["Couch Potato"] = "http://192.168.1.1:5000";
$navlink["TV Headend"] = "http://192.168.1.1:4041";
$navlink["Sabnzbd"] = "http://192.168.1.1:25914";
You navlinks wont throw up any errors unless they are clicked. If the conf's are setup then I am way off base and it's highly likely just to be the $xbmcimagepath.

If I'm brutally honest, I think your setup may need explaining a bit.
I personally do not use a Database, not through lack of trying, I just found it a pain to setup and maintain, I use good old fashion External HDD's and build a library on all 6 computers that access them! Smile


- hernandito - 2011-05-09

I use the centralized database and it works great on my end:

Code:
// enter hostname and port of the xbmc json service here. By default 8080
$xbmcjsonservice = "http://192.168.0.198:2323/jsonrpc"; //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
/*
//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")
        ),
        
    );
*/

My database and my XBMC client are on two separate machines.


- DejaVu - 2011-05-09

gugahoi Wrote:I also believe you guys were trying to get something like this working....?

http://www.youtube.com/watch?v=3ejENxh464M

What do you think?

I have this bad feeling that, that drop down menu is only behaving like that because it's on a MAC. I reckon on a PC it will react differently.

It is just a standard drop down with redirects to websites aimed to the main.frame - like a drop down website selector.