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)



- Zarquon - 2010-11-21

gugahoi Wrote:Hey guys, really like the new mobile interface, and the Git feed in the rss widget.
I don't understand how the mfpsecured=false and mfpapikey work? What are they supposed to do? (I do use htaccess by the way)

I was thinking, maybe there could be a search widget? To search through the nzb's for some sites? And last thing - is it possible to have the coming episodes widget dynamically change? (What I mean is, if I could click on the link in the rss feed, and instead of having a new page open, the comingepisodes part of the website would load the new website? That would come in handy for searching as well as for the links in the "control widget")

Keep up the great work.
If your website is secured with a password through .htaccess then you can set the $mfpsecured=true; in the config.php. If not then set the $mfpapikey to some random hex string similar to the strings created by sabnzbd. (in fact the same one is fine.) You don't need both set but it is fine if you do. Once that is done the Control widget will allow you to call shell commands and xbmc-send actions, see samples in the default-config.php.

I'm not sure a NZB search is within the scope of this project. But if someone wants to write a widget it would be easy to add.

Lastly your request to dynamically change the middle section of the page would require a rework of the framework and I don't see us doing this any time soon and I'm not sure it is necessary, but it would be doable. Possible requiring a specialized widget to handle it.


- Nick8888 - 2010-11-21

I agree with Zarquon, widgets should not affect each other (unless in some sort of related way). It would be easily done by just inserting the search results in the comingepisodes wrapper, but that is not ideal as the widget would be incorrectly titled 'Coming Episodes' and in addition the coming episodes would be invisible until page reload.

The best way to do it, in my opinion is by creating a thin widget with a search box, which could be positioned at the top in the middle (or anywhere else), which expands when something is searched, displaying results below.

The control widget probably should also be modified to allow displaying links in its own widget.

At the moment I'm busy on other features but I agree a search widget shouldn't be too hard to implement using the RSS widget as a base.


- gugahoi - 2010-11-21

Zarquon Wrote:If your website is secured with a password through .htaccess then you can set the $mfpsecured=true; in the config.php. If not then set the $mfpapikey to some random hex string similar to the strings created by sabnzbd. (in fact the same one is fine.) You don't need both set but it is fine if you do. Once that is done the Control widget will allow you to call shell commands and xbmc-send actions, see samples in the default-config.php.

I'm not sure a NZB search is within the scope of this project. But if someone wants to write a widget it would be easy to add.

Lastly your request to dynamically change the middle section of the page would require a rework of the framework and I don't see us doing this any time soon and I'm not sure it is necessary, but it would be doable. Possible requiring a specialized widget to handle it.

Thanks for clearing that up for me, I'll see if I can figure out a good way to have the search then. I was just thinking it would be nice to have the page as a central hub for the server I'm running and it would be good to have as many features as possible. Maybe the way Nick said is a good idea. I just think that the coming episodes widget is taking center stage in the page when it is not as important. The widget has static information that only changes once a day so it's not as if there will be new information every time. So reusing the space would be a nice feature. And to recover the coming episodes widget, I'm sure it would be possible to have a button saying 'back' or anything that would redirect the widget to the original page. Just some ideas.


- Nick8888 - 2010-11-21

gugahoi Wrote:Thanks for clearing that up for me, I'll see if I can figure out a good way to have the search then. I was just thinking it would be nice to have the page as a central hub for the server I'm running and it would be good to have as many features as possible. Maybe the way Nick said is a good idea. I just think that the coming episodes widget is taking center stage in the page when it is not as important. The widget has static information that only changes once a day so it's not as if there will be new information every time. So reusing the space would be a nice feature. And to recover the coming episodes widget, I'm sure it would be possible to have a button saying 'back' or anything that would redirect the widget to the original page. Just some ideas.
The solution would not to be to add it to the coming episodes widget as there are more flexible options.

Currently, the Coming Episodes widget does not necessarily need to take up the majority of the page, you have the option to:
1. collapse it
2. move it to a placeholder on the side

Slimming down the coming episodes widget so it looks neater in the sidebar is a seperate issue and I'm planning on making a slimmer version at some point.

With the two options above, the real problem at the moment is there is not really a single widget that fits nicely in the middle section. Although, I do currently use it for the media library widget which works nicely. EDIT: Perhaps when we add thumbs to this widget, it will require more space and be a viable option to have in the middle section.

The only issue I currently have is that the control widget requires opening links in a new tab.

One solution is to create an empty widget, perhaps with an empty iframe which other widgets can direct their 'results' to. The control widget currently allows the user to specify the target for each link (I think) so it should be quite simple.

Perhaps you would like to mock such an Iframe widget up and see how it works.

EDIT: ok cant specify target attribute in Control Widget shortcuts but this would be trivial to add

Also check out the example widget as a starting point if you are overwhelmed by the other widgets


- Archigos - 2010-11-21

Nick, I was wondering which file(s) to edit to shorten the Recent widgets for less items displayed. I thought I found it in wXBMCLibrary.php, but none of the changes I made seemed to do anything.

I grabbed the latest files via GitHub about an hour ago and I decided to reactivate the Recent Movies widget. My hopes are to have the Recent Movies widget show 5 entries and Recent TV to show 10 instead of the default 15 for each.

Thanks for all the help guys.


- Nick8888 - 2010-11-21

Code:
widgets/wXBMCLibrary.php?w=rm&style=w&a=rm&c=15
Changing this used to work (and still does. you will see 5 for a split second) but when the widget updates every 60sec it is not considered. We will need to look into this, as it would happen to RSS widget as well if we added support for refreshing every few minutes.

In the meantime just edit the libXBMCLibrary.php file.
Code:
        case "re": // Recent Episodes
            if(!empty($params['count'])) {
                $count = $params['count'];
            } else {
                $count = 15;
            }
This is the default value which is used if the ?c= parameter is not used in the request.


- Archigos - 2010-11-21

I normally don't have this bad of luck, but changing that section didn't seem to do anything, I assume you meant in the section below:
Quote: if ($_GET['style'] == "w") {
switch ($_GET['w']) {
case "re": // Recent Episodes

I changed it from:
Quote: if ($_GET['style'] == "w") {
switch ($_GET['w']) {
case "re": // Recent Episodes
$params['onclickcmd'] = "cmdXbmcLibrary";
if(empty($params['wrapper'])) {
$params['wrapper'] = $wdgtRecentTV['block'];
}
$params['harness'] = "widgets/wXBMCLibrary.php?w=re&";
$params['refresh'] = true;
break;
case "rm": // Recent Movies
to:
Quote: if ($_GET['style'] == "w") {
switch ($_GET['w']) {
case "re": // Recent Episodes
if(!empty($params['count'])) {
$count = $params['count'];
} else {
$count = 10;
}
case "rm": // Recent Movies
I also tried just adding that to the beginning of the section:
Quote: case "re": // Recent Episodes
if(!empty($params['count'])) {
$count = $params['count'];
} else {
$count = 10;
}
$params['onclickcmd'] = "cmdXbmcLibrary";
if(empty($params['wrapper'])) {
$params['wrapper'] = $wdgtRecentTV['block'];
}
$params['harness'] = "widgets/wXBMCLibrary.php?w=re&";
$params['refresh'] = true;
break;

PS. If you PM either PayPal info or a favorite charity, etc. I'm willing to send a $20 donation for this project.


- hotlobster - 2010-11-21

Nick8888 Wrote:1. Find the paths at which the images are located. ie http://[IP]:[PORT]/sickbeard/showPoster/?show=79349(right click on thumbs in sickbeard's own coming episodes page)
2. Find out where MFP is looking for them (firefox extension -> firebug helps)

Then paste the full paths here
As i said before, image path, ( seen from firebug ) are coming from sickbeard, not MFP:

That's from MFP:
Code:
http://login:pass@url/sickbeard//showPoster/?show=153021
pointing directly to sickbeard url, not passing trought mfp php script.


- Nick8888 - 2010-11-21

Archigos Wrote:I normally don't have this bad of luck, but changing that section didn't seem to do anything, I assume you meant in the section below:


I changed it from:

to:

I also tried just adding that to the beginning of the section:


PS. If you PM either PayPal info or a favorite charity, etc. I'm willing to send a $20 donation for this project.

I think you are in the wrong file. Sorry for not being clear. There are two files for the xbmc widget wXBMCLibrary and libXBMCLibrary. I admit its confusing!

I've moved all the widgets into their own folders so it a bit cleaner in the new branch I created here for moving the config to a database. (dont bother trying it yet.. but it works)

If you go to the other file and you should be fine.

In regards to a donation, I am more than happy directing it to team xbmc. I think they are the ones who deserve it and it will go to supporting the whole community.

Thanks!


- Nick8888 - 2010-11-21

hotlobster Wrote:As i said before, image path, ( seen from firebug ) are coming from sickbeard, not MFP:

That's from MFP:
Code:
http://login:pass@url/sickbeard//showPoster/?show=153021
pointing directly to sickbeard url, not passing trought mfp php script.

Thats strange, they should be pointing at http://url/sickbeardposter.php?show=73141

I'll look into it but I haven't been able to reproduce it. When I did a clean install today I did experience having the multiple logins but as should be the case, it did not happen more than once as the thumbs were written to sbpcache. I'll see if I can find what's going on.


- Archigos - 2010-11-21

Your right, I was in the wrong file, I mentioned where I was toying with stuff (the wXBMCLibrary file) and didn't notice that when you gave the directions you mentioned the other one, so I'll try that in a minute and I'll make the donation for you later today. Smile

Thanks again


- DejaVu - 2010-11-22

hotlobster Wrote:As i said before, image path, ( seen from firebug ) are coming from sickbeard, not MFP:

That's from MFP:
Code:
http://login:pass@url/sickbeard//showPoster/?show=153021
pointing directly to sickbeard url, not passing trought mfp php script.

Could this be because you have the proceeding / at the end of your URL in the Config.php file?

IE -
Code:
http://login:pass@url/sickbeard/
Whereas it maybe should be

Code:
http://login:pass@url/sickbeard

You should also note, you can only use the \sickbeard redirect if you have it configured in the conf files.

I dont, so mine is simply =
Code:
http://localhost:8081(/showPoster/?show=153021)

Makes sense...?


- Nick8888 - 2010-11-22

hotlobster Wrote:Yes i have this problem too. I think it's because the tthumb pictures are called directly by the client to sickbird webserver.
To prevent this, they should be proxyfied by the php script directly.

@DejaVu77, I don't think hotlobsters problem is that they are not displaying. The problem is that its asking to login for each.


- RaNaMaster - 2010-11-22

hey guys can i get some help with the Clean XBMC Video Library it cant seem to make it work my xbmc ip address is 192.168.1.4 so what do i need to do to make it work
this is what i get when i click on it
Error returned from call to widget.
Error: Authorization failure


- Nick8888 - 2010-11-22

Because the ability to run shell commands or xbmc send commands can be potentially dangerous if your website is unsecured, Zarquon made it so that you need to either set your website as either secure (if you have a .htaccess file) or otherwise you can just set a random word in there so that it is safe to run the commands.

from default-config.php
Code:
// 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 = ''; //