Contact Lifestream
        

Lifestream: Upgraded to Wordpress 2.5. Better late than never.




Nucleus Plugin: NP_ItemProgressBar

While going over the Nucleus Plugin Wiki this morning I noticed that not many, hardly any at all, of the plugins there can be called from within an ITEM. Not that you would want to for the most part. But there are a few that would be handy to be able to call from any post and not have to add them to a template or skin. Such as the NP_ProgressBar for example. On rare occasions I’ve wanted to list, for example, how far along I am watching a particular sci-fi or something else that can be easily quantified. So I did a little modification on it, and wrote a small function around it that will replace ALL instances. Not just the first one it encounters. One could say it’s a synthesis of NP_ProgressBar and NP_Codeviewer with some extra code.

Item Progress Bar (30/100)

30,100,#FFFFFF,#000000 Item Progress Bar (100/100)

100,100,#FFFFFF,#3694FF Item Progress Bar (5/100)

5,100,#FFFFFF,#83B300 Item Progress Bar (100/200)

100,200,#FFFFFF,#C72C19

I ran into problems using the php split and preg_split functions for splitting text strings. Originally I had wanted to use the syntax [progress]min,max,bg,fg[/progress] but that did just not compute with php. At least not the way I had done the looping function using split. So I did this instead <progstart>min,max,bg,fg<progend>. It gets the job done too.

I installed and modified Geshi in order to show the source but to no avail. The plugin I just did obviously interferes when it is supposed to go over its own source. So I archived it here instead. I should really try to improve the code and vary the display but for now it will suffice.

Total time spent: 4-5 hours of reading the docs, trial and error and actual php programming.