From b9ed9ac960d88bf97049335f59007892aefcb523 Mon Sep 17 00:00:00 2001 From: Metabox Date: Fri, 19 Jul 2019 14:03:16 +1000 Subject: [PATCH] LTag fixes. --- htdocs/cgi-bin/main.cgi | 88 +++++++++++++++++++++--------------- htdocs/cgi-bin/wsrc/main.css | 5 ++ htdocs/cgi-bin/wsrc/main.js | 7 +++ 3 files changed, 64 insertions(+), 36 deletions(-) diff --git a/htdocs/cgi-bin/main.cgi b/htdocs/cgi-bin/main.cgi index c76f2d7..145f7b2 100755 --- a/htdocs/cgi-bin/main.cgi +++ b/htdocs/cgi-bin/main.cgi @@ -29,7 +29,7 @@ our $PRC_WIDTH = '60'; our $LOG_PATH = '../../dbLifeLog/'; our $SESSN_EXPR = '+30m'; our $DATE_UNI = '0'; -our $RELEASE_VER = '1.4'; +our $RELEASE_VER = '1.5'; our $AUTHORITY = ''; our $IMG_W_H = '210x120'; our $AUTO_WRD_LMT = 200; @@ -62,7 +62,7 @@ my ( $imgw, $imgh ); ### Authenticate session to alias password &authenticate; -&getConfiguration($db ); +&getConfiguration($db); my $tbl_rc = 0; my $tbl_rc_prev = 0; @@ -161,7 +161,7 @@ $today->set_time_zone($TIME_ZONE); my $stmtCat = "SELECT * FROM CAT;"; my $stmt = -"SELECT rowid, ID_CAT, DATE, LOG, AMMOUNT FROM LOG ORDER BY DATE DESC, rowid DESC;"; +"SELECT rowid, ID_CAT, DATE, LOG, AMMOUNT, RTF FROM LOG ORDER BY DATE DESC, rowid DESC;"; $st = $db->prepare($stmtCat); $rv = $st->execute() or die or die "

Error->" & $DBI::errstri & "

"; @@ -319,6 +319,7 @@ while ( my @row = $st->fetchrow_array() ) { my $dt = DateTime::Format::SQLite->parse_datetime( $row[2] ); my $log = $row[3]; my $amm = camm(sprintf "%.2f", $row[4]); + my $rtf = $row[4]; #Apostrophe in the log value is doubled to avoid SQL errors. $log =~ s/''/'/g; @@ -393,34 +394,25 @@ while ( my @row = $st->fetchrow_array() ) { } $log =~ s/</$lnk/o; } - elsif ( $log =~ /<', $idx ) - 7; - my $lst = substr( $log, $idx + 7, $len - $idx ); - my $sub = ""; - my @arr = split(/\n/, $lst); - foreach my $ln (@arr) { - $ln =~ s/^\s*//g; - $sub .= "
  • $ln
  • " if length($ln)>0; - } - - $log = "
      $sub
    "; - #$log =~ s/</$lst/o; - # print $lst; - - } + #Replace with a full link an HTTP URI - my @chnks = split( /($re_a_tag)/si, $log ); - foreach my $ch_i (@chnks) { - next if $ch_i =~ /$re_a_tag/; - next if index( $ch_i, " -1; - $ch_i =~ s/https/http/gsi; - $ch_i =~ s/($RE{URI}{HTTP})/$1<\/a>/gsi; + if($log =~ /