Slash-MozBar : A "My Sidebar" generator for Mozilla. Born from a story on Slashcode.com, this utility is a snap-in task for Slashcode's "slashd" daemon. The goal of this project is to take the generated "sitename".xml file and create a pleasant-looking table for use in a Mozilla/NS6.0+ browser's side bar. This code has been tested on Linux using perl 5.6.1 and Slashcode > 2.x Obviously, things work better if Slash is installed prior to Slash-MozBar ;) Things to change: * Timing is important. You want this task to run shortly after the open_backend task. Timing can be controlled by the "$task{$me}{timespec}" var, with date/time format like Unix cron. * The script takes the value of the Slash variable "sitename" for use in the generated page title. * IF you are not using the image resize: * Comment out/remove the "use Image::Magick" line from "slash_mozbar.pl", and set "$GL_RSZ" to 0. * Make sure you manually craft resized copies of your topic icons to place in the images/mozbar directory. Aim for a size of 30x30 to make sure there is enough room left in the bar for text ;) * Images in the images/mozbar directory should have the same name as the actual topic images. * IF you are resizing images: * Make sure ImageMagick and its perl modules are installed. * The destination directory for resized images (defaults to images/mozbar) needs to be writable by your Slash user. * "use Image::Magick" needs to be uncommented and "$GL_RSZ" needs to be non-zero (preferably 1). Intructions: 1. If you want to have resize capability, make sure ImageMagick/PerlMagick is installed. Packages can be downloaded from http://www.imagemagick.org/ 2. XML::Parser needs to be installed, available from your local CPAN mirror to be built by hand or easily installed using perl's CPAN module. Time::Local is now required, but should be included as part of your perl installation. If you do not have it for some reason, grab it from CPAN. 3. Create a directory named "mozbar" under your existing Slash site's "images" subdirectory. Usually this is located under: /sites//htdocs/ If you are using the image resize feature, make sure the "mozbar" directory is writeable by your Slash user. 4. Copy div.png and spacer.png into the newly-created "images/mozbar/" directory. These images are used to provide the grey line separator and table spacing, respectively. 5. Create a file called "mozbar.html" in your site rootdir, allowing the Slash user write access. This file will be populated every half hour with the latest links/images/etc. 6. Copy slash_mozbar.pl into your site's tasks directory, usually: /site//tasks/ Make sure slash_mozbar.pl is executable by slashd. A permission set of 0755 should be sufficient. 7. Test the installtion using the Slashcode-supplied "runtask" script, located in the /bin directory. Monitor the site slashd log file for any errors (/site//logs/slashd.log). Call up the resulting http://your.slash.site/mozbar.html in a browser and verify that it looks correct, based on the information in your "sitename.xml" file. 8. Assuming no errors are encountered, restart slashd with an /etc/init.d/slashd restart (or a stop; start). 9. When ready to go "public", use the sample code from add_tab.html to create a button or link on your Slash site so users can quickly add your tab to their Mozilla/Netscape sidebar. To do: - Support other resize utils besides ImageMagick. - More error checking. - Use template instead of hard-coding output format. - Don't resize images if they already exist in mozbar subdir? - Allow for header image instead of "$constants->{sitename} Headlines" Questions/Comments/Bugs to: Scott Sorrentino Special thanks go to Colin Viebrock for bringing up the concept of a Mozilla sidebar and his constant help in the HTML design process. This code is freely distributable and modifiable under the GPL, included as file "COPYING".