Sinepaw.org
About Code Collections Diversions Musings Personal Photos Search
/ROOT/code/slash-mozbar/faq.phtml
Slash-MozBar - Frequently Asked Questions (FAQ)

What is it? This project was created to give sites based on Slashcode a nice looking Mozilla / Netscape 6.0+ sidebar tab.
Project Home


Questions:


What started all this?
    My interest was piqued after reading a post/thread on Slashcode.com regarding Slash and a nice-looking Mozilla sidebar tab. Knowing full well how difficult it is to promote a Slash site (or any site, for that matter), I saw this as a way to make a site more accessible via a nifty tab.

    After modeling a CGI script based on the screenshot Slashcode user Colin Viebrock (aka "Greedo") posted in the article, I thought it would be far more efficient to make the script a client-side task called by slashd.

Where can I get the CGI version?
    Currently, it can be played with under the old SlashXML Project Section, where I stumbled through the first few incarnations. Note that the CGI version is slow, mainly due to the fact that it does not cache images locally. Each icon is handled by a call to grabimg.cgi, which obtains the original topic icon from the Slash site, resizes it to roughly 30x30 and displays the resulting PNG.

    I can definitely see a use for the CGI version for sites that do not want to run the slashd task or for users who just want to have a sidebar tab for a site they like, without the admins doing a single bit of work. Someday, after I clean it up a bit, I'm sure it'll be offered under this project.

Can I see it in action?
    The current version is up and running on my Slash site, Kill-HUP.com. The "launch" link is on the left-hand menu. If you'd rather see the tab HTML, take a look at http://www.kill-hup.com/mozbar.html.
I have added two screen shots of version 0.3.1: full browser window (71 KB) and close-up of bar only (9 KB).

Does it resize the topic images on the fly?
    In a word, no. The reason for this is not my burning desire to be a pain in the ass, but my own bad experiences. I tried using ImageMagick but found that most topic icons, when resized, looked like crap. During testing, I had better results running my topic icons through Photoshop (or pick your equivalent) and shrinking them to a 30x30 pixel size.

    Perhaps, in the future, we can add automatic resizing to the script. What might be cool is if it "auto-resized" images for which a previously-resized icon is not available.

    Update: I've added topic icon resizing support, using ImageMagick, thanks to a suggestion that I convert GIFs before resizing. The results look a lot better now ;) You can control whether or not the task resizes images via a script variable, should you not want resizing support.

What is required to run Slash-MozBar?
    The slashd task file that is "Slash-MozBar" requires:
  • Slashcode version 2.x and up.
  • Perl version 5 and higher.
  • Time::Local, usually installed by default with perl but available from CPAN for those who lack it.
  • XML::Parser, available from your local CPAN mirror or easily installed using perl's CPAN module.
  • ImageMagick and the associated PerlMagick modules.
    ImageMagick is only required if you want automated image resizing support.
    All of these packages, including Slash-MozBar, are freely available. Everything but ImageMagick is licensed under the GNU Public License.

What else is included in the Slash-MozBar source file?
    In addition to the slash_mozbar.pl task for slashd, you'll also find:
  • CHANGES
    Version change history.
  • README
    A quick description of what Slash-MozBar is and how to use/customize it.
  • UPGRADING
    Quick instructions for upgrading from version to version. Probably not required, but there's no such thing as too much information.
    (First appeared in version 0.3.2)
  • add_tab.html
    Sample HTML file showing the code you'll need to have users add your tab to their Mozilla/Netscape sidebar.
  • div.png
    Image to create the "separator bar" between time and comment count.
  • spacer.png
    Transparent image for spacing that no serious webmaster should be without ;)
...and, of course, a copy of the GNU Public License ;)

Why parse XML? Why not query the Slash db directly?
    I saw no need to duplicate the code that generates the RDF / RSS / XML feeds within Slashcode. This task is a simple add-on that doesn't require any core changes to your site. I think simplicity is best ;)

So, how do I get this running?
    Here are the installation steps:
  1. Download Slash-MozBar source and untar it to a temporary directory.
  2. If you're not changing any of the hard-coded paths within slash_mozbar.pl, make a directory called mozbar under your Slash site's existing images subdirectory.
  3. Copy div.png and spacer.png into the newly-created images/mozbar/ directory.
    If you are using the image resize functionality, you'll need to make sure this directory is writable by your Slash user.
  4. Create a file called "mozbar.html" in your site rootdir, allowing the Slash user write access.
  5. Copy slash_mozbar.pl into your site's tasks directory, usually <slash home>/site/<site url>/tasks/.
  6. Call up http://your.slash.site/mozbar.html in a browser and verify that it looks okay.
  7. Restart slashd with a /etc/init.d/slashd stop; /etc/init.d/slashd start (or simply 'restart').
  8. Wait.
    You can also run the task manually using Slash's run_task script, located in <slash home>/bin/.
  9. Add the code from add_tab.html to a button or link on your Slash site so users can quickly add your tab to their Mozilla/Netscape sidebar.


How can I help?
    The easiest way to help, assuming you are running a site based on Slashcode, is to test the code and report any bugs you find. Be sure to let me know which versions of Slashcode and Slash-MozBar you are using, what you believe may have caused the error and what exactly happened. Relevant log file entries from slashd.log can also be extremely helpful ;)

    I'm also open to suggestions for improvements, whether within the code itself or the generated sidebar output.
We support open web standards. This page contains both Valid XHTML 1.0 and Valid CSS .
Unless otherwise noted, all content © 2000 - 2006 Scott Sorrentino.


Version History
Created:   13 August 2003