Sign up here and you can log into the forum!

WEC adjustments and fixes

Discussion, features, plugins--everything about zoster's UMSP UPnP Media Server software

WEC adjustments and fixes   

Postby RMerlin » Fri Apr 01, 2011 9:16 pm

Howdy folks,

I fixed a few WEC plugins that would append data to an array without initializing first (hint: don't use arrayname[] on an array without having first intialized it :) ). Since plugin code was done in the global context, this led to some interesting results, such as having all the pornohub categories appear as available shows for other plugins like TwitTV :lol:

While at it, I also adjusted the badge alignment on all WEC plugins - for larger badges, these would nearly touch the text, which looked pretty bad. Make sure to adjust any future plugins - you simply need to add "padding: 4px 10px 4px 4px;" to the <div> style that contains your badge (right after the float: left; attribute). The result is most notable on the Weather and PIN plugins. The adjusted code follows:

Code: Select all
                // Insert badge if we have one
                if ((isset($pluginInfo['thumb']))&&($pluginInfo['thumb']!=''))
                {
                        $desc = '<div style="float: left; padding: 4px 10px 4px 4px;"><img src="'.$pluginInfo['thumb'].'" width="60" height="60" alt="logo"></div>'
                                .'<div>'.$pluginInfo['name']." v".$pluginInfo['version']." (".$pluginInfo['date'].") by "
                                .$pluginInfo['author'].".<br>".$pluginInfo['desc']."<br>Information: <a href='".$pluginInfo['url']."'>".$pluginInfo['url']."</a>"
                                .'</div>';
                }
                elseif ((isset($pluginInfo['art']))&&($pluginInfo['art']!=''))
                {
                        $desc = '<div style="float: left; padding: 4px 10px 4px 4px;"><img src="'.$pluginInfo['art'].'" width="60" height="60" alt="logo"></div>'
                                .'<div>'.$pluginInfo['name']." v".$pluginInfo['version']." (".$pluginInfo['date'].") by "
                                .$pluginInfo['author'].".<br>".$pluginInfo['desc']."<br>Information: <a href='".$pluginInfo['url']."'>".$pluginInfo['url']."</a>"
                                .'</div>';
                }
WDLXTV Webend maintainer. Visit http://www.lostrealm.ca/wdlxtv to see my other WDLXTV projects.
If you like my work, please consider donating.
User avatar
RMerlin
WDLXTV Team
 
Posts: 3236
Joined: Sat Jun 26, 2010 9:25 am
Location: Montreal, Canada

Re: WEC adjustments and fixes   

Postby shunte » Fri Apr 01, 2011 9:56 pm

My bad, I used the same category build out technique for both of those plug-ins but only having TWiT on my WD I'd never noticed the issue

That'll teach me to copy and paste

I'm on an unset() crusade at the moment so things can only get better ;)
If you like the work I do please feel free to make a donation to the Red Cross
User avatar
shunte
Developer
 
Posts: 420
Joined: Sun Sep 19, 2010 1:43 am
Location: Cambridge, MA U. S. and A.

Re: WEC adjustments and fixes   

Postby RMerlin » Fri Apr 01, 2011 10:04 pm

shunte wrote:My bad, I used the same category build out technique for both of those plug-ins but only having TWiT on my WD I'd never noticed the issue

That'll teach me to copy and paste

I'm on an unset() crusade at the moment so things can only get better ;)


Haha :) I"m a big code reuser myself. A large portion of the WEC display code was taken from another of my projects.

No need to unset actually. What I did was simply replace

Code: Select all
arrayname[] = 'blah';


with:
Code: Select all
arrayname = array('blah');


I ran into the issue as I was experimenting with repositories, so for once I had both regular and restricted plugins loaded on WEC.
WDLXTV Webend maintainer. Visit http://www.lostrealm.ca/wdlxtv to see my other WDLXTV projects.
If you like my work, please consider donating.
User avatar
RMerlin
WDLXTV Team
 
Posts: 3236
Joined: Sat Jun 26, 2010 9:25 am
Location: Montreal, Canada


Return to UMSP Media Server

Who is online

Users browsing this forum: No registered users and 1 guest

cron