Just found a nifty sidebar widget that makes getting to my live scanner stream simple, including an imbedded WMP for those who cannot install software at work (you are welcome, Dan!). The screenshot of the widget, aptly named SHOUTcast Sidebar Widget, looked super and filled every need that I had. I was troubled, though, to see a very recent post on the WordPress forums of someone having a problem getting it to work. I thought probably a WP install that falls outside the norm and that mine will work just fine. Well, it did not. The widget title showed up fine, but that was it.
So, I opened the code up. Warning - I am not (repeat, not) a PHP expert. Perl yes, PHP, no. So, I did what any good programmer would do (other than RTFM) and sprinkled a few echo statements in the main script to see what it was (and was not) finding. It read my Shoutcast status page just fine, as well as parsed the results properly, but when it arrived at fetching the skeleton page, nothing was retrieved. I looked at the filename and it was correct. What was wrong were two things, one my fault, one the code:
- In the README file, it says to extract all the files into wp-content/plugins/sc_widget. Problem is that the installation zip file has them in a directory called shoutcast-sidebar-widget. Most widget and plugin installations for WP do not change directory names in mid-installation, most are just drag 'em over. I will take the hit (did not RTFM), but left the directory name as is and changed the code.
- Looking at the filenames in the script and the skeleton page, all the fully qualified references were to /wp-content/plugins/sc_widget/sc_running.htm, which works just dandy if your WP installation is at the root of the server. Removing the leading slash makes the script and resulting, edited skeleton file work just dandy in any level of the server. There are 6 occurrences in the two files, sc_widget.php and sc_running.htm. Easy enough edit.
Ok, I admit it. I do love to find fun, silly, little devices to toss up here. And this one is in the ultimate silly category. While reading the 