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)



- _Mikie_ - 2011-05-22

gugahoi Wrote:Ye you're right. That's basically the difference. The link is when you call the main page - mediafrontpage.php?layout=LAYOUTNAME where layout name is what is after layout in the php page (eg.:layout-myexample.php would require mediafrontpage.php?layout=myexample to be applied and consequently widget-myexample.css will be applied). Don't think that was very clear, ask away if you still got questions.

Yeah that makes sense kinda. Been fiddling for a couple minutes and I have an idea in my head just need to plan it out before I confuse myself. This is going to sound like a strange question but bare with me. Can it call not myexample.css but myexample.php instead? So yes its calling a php file for the css. Ignore the technicalities. Can you change the calling link if that makes sense. Can it be done?

Then secondly can it call a myexample.css thats not named myexample. So (eg.:layout-myexample.php would require mediafrontpage.php?layout=myexample to be applied and consequently widget-myexampleOTHERNAME.css will be applied). Is that possible?

Lastly can it call two css files for one layout?

Thanks Smile


- gugahoi - 2011-05-22

_Mikie_ Wrote:Yeah that makes sense kinda. Been fiddling for a couple minutes and I have an idea in my head just need to plan it out before I confuse myself. This is going to sound like a strange question but bare with me. Can it call not myexample.css but myexample.php instead? So yes its calling a php file for the css. Ignore the technicalities. Can you change the calling link if that makes sense. Can it be done?

Then secondly can it call a myexample.css thats not named myexample. So (eg.:layout-myexample.php would require mediafrontpage.php?layout=myexample to be applied and consequently widget-myexampleOTHERNAME.css will be applied). Is that possible?

Lastly can it call two css files for one layout?

Thanks Smile

It can be done. I'm not entirely sure of what you're trying to do. It already calls both a php page and a CSS page as I said. If you could elaborate a bit more...


- _Mikie_ - 2011-05-22

gugahoi Wrote:It can be done. I'm not entirely sure of what you're trying to do. It already calls both a php page and a CSS page as I said. If you could elaborate a bit more...

Last question and then I'll reveal all. What defines that section 2 starts to the right of section 1 and section 3 to the right of that and section 4 etc.. Is it javascript or css and in what file is it found?


- CoinTos - 2011-05-22

I currently have a working (APC) UPS widget for apcupsd, I'll post it if anyone is interested. Also, if anyone uses NUT and can send a sample upsc report, I'll add it (all I need is the fields you can remove/change the info if you prefer). I do have a sample from the NUT config notes but I still prefer a real world to confirm and as I don't use NUT some outside interest would motivate me more. Big Grin

Right now it's nothing fancy. It's modeled after the HardDrive widget and refreshes every 15 seconds. It will produces a popup with what I figured is useful info when you move the mouse over the UPS name.


- SleepyP - 2011-05-22

AWESOME! This is why the modular widget architecture is great for this project!


- DejaVu - 2011-05-22

gugahoi Wrote:Basically I couldn't really figure out how to make it work well. If you can it would be awesome.

I had a look (pointless), this programing lark is WAY WAY WAY over my head. I've sat down for over 8 hours trying to learn the basics of PHP and Javascript and although I semi get it - there is no real way of learning it properly without being tutored IMO.

The basics are pretty easy and a Hello World script - I've nailed that! But assigning variables, calling functions, else, if, error, require_once, $result, getElementById, etc etc ... Totally lost me. There is soooo much stuff to cram in your brain when making a script and I get completely screwed.

Editing it - perhaps.
Writing it - No Chance (and it's F@^&ING frustrating the S#!T out of me!)

Some of the stuff it chats about over on W3Schools even lose me half way through the tutorial!
They start out like you've never looked at PHP ever - to half way though - where you almost a pro - to the end, where I gather you can code with your eyes shut.


- SleepyP - 2011-05-23

Hahah, I hear ya. I am actually pretty decent at PHP, but JS is still like "What the hell is this moon language?!?!" The syntax is just close enough to stuff I know that I can ALMOST get it, but not quite. Most of the code I have looked at from this project is not commented, which IMO does not help anything. I have tried to document pretty much all the stuff I add to help make it intelligible, but for a lot of the stuff I didn't write I don't even know where to begin. Like the wXBMCLibrary.php file has a lot of instances where the widget calls itself and does different things, and I'm not comfortable with commenting on the code when I only have theories on what its doing.


- gugahoi - 2011-05-23

CoinTos Wrote:I currently have a working (APC) UPS widget for apcupsd, I'll post it if anyone is interested. Also, if anyone uses NUT and can send a sample upsc report, I'll add it (all I need is the fields you can remove/change the info if you prefer). I do have a sample from the NUT config notes but I still prefer a real world to confirm and as I don't use NUT some outside interest would motivate me more. Big Grin

Right now it's nothing fancy. It's modeled after the HardDrive widget and refreshes every 15 seconds. It will produces a popup with what I figured is useful info when you move the mouse over the UPS name.

What exactly does your widget do? Check power consumption or something?

_Mikie_ Wrote:Last question and then I'll reveal all. What defines that section 2 starts to the right of section 1 and section 3 to the right of that and section 4 etc.. Is it javascript or css and in what file is it found?

Not sure on that one. I think it's just the flow of the page. So if one section takes 20% width, the next one starts relative to that and CSS probably takes care of things. Nick8888 posted the tutorial he used as the framework for the widget architecture not so long ago if you want to have a more in depth look at it.

DejaVu Wrote:I had a look (pointless), this programing lark is WAY WAY WAY over my head. I've sat down for over 8 hours trying to learn the basics of PHP and Javascript and although I semi get it - there is no real way of learning it properly without being tutored IMO.

Fair enough. I also felt overwhelmed a bit when I first started reading about it. You can only understand when you get hands on tho so my advice to you is don't be intimidated as sometimes it sounds more complicated than it really is.


- CoinTos - 2011-05-23

gugahoi Wrote:What exactly does your widget do? Check power consumption or something?

The widget displays UPS name, Estimated Runtime, Load and Charge (which is a progress bar).

Apon mouse over it will display:

UPS name and/or Hostname, Model, UPS Mode, Maximum Watts, Start Time, Status, Outages (number), Last Transfer (reason), Last Outage Timestamp, Line Voltage, Load Percent, Battery Volts, Battery Charge, and Battery Runtime.

Currently, it only supports hosts running Apcupsd (in otherwords only APC brand UPS) but NUT support can be added with a little rewrite/addition. It supports multiple hosts running apcupsd with ups attached. I am currently trying to find a better popup for the information, as at times info can get covered up and doesn't look very 'pretty' in chrome (box doesn't size right).

As I said, nobody may need it, this is just a convience thing for me as mediafrontpage is my home page and saves me loading phpsysinfo just to check basic ups info.


- gugahoi - 2011-05-23

CoinTos Wrote:The widget displays UPS name, Estimated Runtime, Load and Charge (which is a progress bar).

Apon mouse over it will display:

UPS name and/or Hostname, Model, UPS Mode, Maximum Watts, Start Time, Status, Outages (number), Last Transfer (reason), Last Outage Timestamp, Line Voltage, Load Percent, Battery Volts, Battery Charge, and Battery Runtime.

Currently, it only supports hosts running Apcupsd (in otherwords only APC brand UPS) but NUT support can be added with a little rewrite/addition. It supports multiple hosts running apcupsd with ups attached. I am currently trying to find a better popup for the information, as at times info can get covered up and doesn't look very 'pretty' in chrome (box doesn't size right).

As I said, nobody may need it, this is just a convience thing for me as mediafrontpage is my home page and saves me loading phpsysinfo just to check basic ups info.

Sounds awesome, why don't you put it up on the repo? Doesn't have to be on the layout by default since I don't think that many people have that (I wouldn't know since I didn't even know such a thing existed) but it's always good to increase MFP's usefulness! ;D


- CoinTos - 2011-05-23

gugahoi Wrote:Sounds awesome, why don't you put it up on the repo? Doesn't have to be on the layout by default since I don't think that many people have that (I wouldn't know since I didn't even know such a thing existed) but it's always good to increase MFP's usefulness! ;D

OK, I'll polish/comment it some more then figure out how to use a repo. Smile


- _Mikie_ - 2011-05-23

gugahoi Wrote:Not sure on that one. I think it's just the flow of the page. So if one section takes 20% width, the next one starts relative to that and CSS probably takes care of things. Nick8888 posted the tutorial he used as the framework for the widget architecture not so long ago if you want to have a more in depth look at it.

Hmm okay.. I'll fiddle around and see if I can get it working. If you change the section names so its section 1,2,3,4,5,6,7,8 and so on. So like 3 columns get 1,2,3 and then 4 columns get 4,5,6,7 and so on it all works except it shows it in one long line all below each other.

Nick8888 any idea how to change this?


- SleepyP - 2011-05-23

I wasted the better part of two days trying to do a ping function using PHP's exec() function, only to find it won't reliable work on a lot of Linux distributions because of the way access to ping is limited and the output may differ a little from system to system, to say nothing of Windows. Looks like some janky socket functions may hold the answer, but further research is required.


- gugahoi - 2011-05-23

_Mikie_ Wrote:Hmm okay.. I'll fiddle around and see if I can get it working. If you change the section names so its section 1,2,3,4,5,6,7,8 and so on. So like 3 columns get 1,2,3 and then 4 columns get 4,5,6,7 and so on it all works except it shows it in one long line all below each other.

Nick8888 any idea how to change this?

What exactly are you trying to accomplish? I don't quite understand it yet.


On another not, I've added tons of info on the wSystem widget and I don't really think there's more that can be added. Here's a sneak peak:
Image

It's up for grabs on my repo. Possibly being added to the official soon!


- _Mikie_ - 2011-05-23

I want all the sections for each layout option to be a different name so if I want to apply something to just one layout then it will work. Currently if I apply something to section 1 it affects all the layouts with section 1 not just one of the layouts..