1 # Bloxsom Plugin:IconSet
2 # Author: Fletcher T. Penney
7 # --- Configurable variables ----
9 # Where are your icon image files?
10 $logos_url = "/images";
12 # Where is the icon definition page
13 # Note that this is optional
14 $icon_file = "$blosxom::datadir/iconlist";
16 # Is the icons plugin enabled
17 $use_icons_plugin = 1;
19 # -------------------------------
24 open (ICONS, $icon_file);
31 my ($pkg, $path, $filename, $story_ref, $title_ref, $body_ref) = @_;
34 foreach $iconpair (@iconslist) {
35 if ($iconpair =~ /(.*)=(.*)/) {
38 $iconset= qq!<img src="$logos_url/$icon" alt="logo">! if ($path =~ /^$categ/i);
42 if ($$body_ref =~ /<!-- iconset\s*(\S*)\s*-->/i) {
43 $iconset= qq!<img src="$logos_url/$1" alt="logo">! if $1 ne"";
46 if ($use_icons_plugin eq 1) {
47 $icons::icons = $iconset if ($iconset ne "");
60 Blosxom Plug-in: iconset
64 IconSet allows you to set an icon to be used within a particular story. Set the $logos_url to the url for your icons. You then use the <!-- iconset ### --> directive within a story to set an icon to be displayed for that story. If a default icon is set by the icons plug-in, it will be overridden.
66 If the icons plugin is present, then you may continue to use the $icons::icons variable. Otherwise, you can use the $iconset::iconset variable.
68 The $icon_file allows you to set an icon for any story in a category by using a definitions file. This allows you to set an icon for any category, whether it is top level or not, without having a world readable datadir. (The original icons plugin cannot do this.)
70 The format for iconfile is:
73 and uses regexp's for either expression. So,
74 /computers/blosxom=blosxom.gif will set the icon to blosxom.gif for any file in the computers/blosxom directory, or any of its subdirectories.
77 /computers/blosxom/newstuff=cool.png, then anything in this one subdirectory will have a different icon. The line that matches last is the one that "sticks."
79 By using this technique, you can replace the icons plugin altogether by replacing $iconset::iconset in your templates wherever you used to use $icons::icons. If you do this, then change the $use_icons_plugin variable.
83 None known; please send bug reports and feedback to the Blosxom
84 development mailing list <blosxom-devel@lists.sourceforge.net>.
88 Fletcher T. Penney - http://fletcher.freeshell.org
90 This plugin is now maintained by the Blosxom Sourceforge Team,
91 <blosxom-devel@lists.sourceforge.net>.
95 This source is submitted to the public domain. Feel free to use and modify it. If you like, a comment in your modified source attributing credit to myself and Gregory Bair for his original work would be appreciated.
97 THIS SOFTWARE IS PROVIDED AS IS AND WITHOUT ANY WARRANTY OF ANY KIND. USE AT YOUR OWN RISK!