/[webpac]/branches/drustvene/back2html.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /branches/drustvene/back2html.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 80 by dpavlin, Tue Jul 8 08:24:13 2003 UTC revision 146 by dpavlin, Sun Nov 16 13:20:14 2003 UTC
# Line 16  sub back2html { Line 16  sub back2html {
16                  # convert spaces in left field to non-breaking spaces                  # convert spaces in left field to non-breaking spaces
17                  $items[0] =~ s#\s+# #g;                  $items[0] =~ s#\s+# #g;
18                  # try to make link on right field                  # try to make link on right field
19                  if ($items[1] =~ m#(http://[\S]+)\s*.*?#i) {                  sub mkurl {
20                            my $url = shift || die "mkurl needs url as argument";
21                          # chop URLS longer than 60 characters                          # chop URLS longer than 60 characters
22                          my $url = substr($1,0,60);                          my $txturl = substr($1,0,60);
23                          $url .= "..." if (length($1) > 60);                          $txturl .= "..." if (length($1) > 60);
24                          $items[1] =~ s#(.*)\b(http://[\S]+)(\b?.*)#$1<a href=\"$2\">$url</a>$3#g;                          return "<a href=\"$url\">$txturl</a>";
25                  }                  }
26                    $items[1] =~ s#(http://[\S]+)#mkurl($1)#gie;
27                  $out .= join("</td><td>",@items);                  $out .= join("</td><td>",@items);
28                  $out .= "</td></tr>\n";                  $out .= "</td></tr>\n";
29          }          }

Legend:
Removed from v.80  
changed lines
  Added in v.146

  ViewVC Help
Powered by ViewVC 1.1.26