1 # Bloxsom Plugin:AutoLink
2 # Author: Fletcher T. Penney
4 # modelled after dictionary by Gregory Bair
8 # --- Configurable variables ----
10 # Where is the definition page
11 $link_file = "$blosxom::datadir/autolinks";
14 # -------------------------------
19 open (LINKS, $link_file);
26 my ($pkg, $path, $filename, $story_ref, $title_ref, $body_ref) = @_;
28 if ($$story_ref =~ m/<!-- noautolink -->/gi || $$body_ref =~ m/<!-- noautolink -->/gi) {
33 foreach $i (@linkslist) {
34 if ($i =~ /(.*?)=(.*)/) {
38 # By default, autolinks now changes only the first occurence of a given term
39 # If you want to change all occurences,
40 # change the end of the following line to '\/a>/ig'
41 $$body_ref =~ s/(?<=\s)($word)(?=([\s\,\!\;]|\.\s|\:\s|[\(\)]\s))/<a href="$link">$1<\/a>/i;
55 Blosxom Plug-in: autolink
59 Allows you to create a list of keywords that are automatically converted to a url whenever they are used in a story. You can insert "<!-- noautolink -->" in a story to prevent any changes
61 You can set your own location for the autolinks data file, but by default it lives in your data directory.
65 Fletcher T. Penney - http://fletcher.freeshell.org
70 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.
72 THIS SOFTWARE IS PROVIDED AS IS AND WITHOUT ANY WARRANTY OF ANY KIND. USE AT YOUR OWN RISK!