From: wbudic Date: Sat, 13 Feb 2021 06:09:20 +0000 (+1100) Subject: upd X-Git-Url: https://lifelog.hopto.org/gitweb/?a=commitdiff_plain;h=6f088e5e7cd32ffa1b1a921cf9248c70102ba221;p=LifeLog.git upd --- diff --git a/dbLifeLog/main.cnf b/dbLifeLog/main.cnf index 8d7830b..b58940d 100644 --- a/dbLifeLog/main.cnf +++ b/dbLifeLog/main.cnf @@ -1,38 +1,37 @@ - -!CNF1.0 +!CNF2.0 This is the main configuration file for the LifeLog applications settings. https://github.com/wbudic/LifeLog This is an Open Source License project -> https://choosealicense.com/licenses/isc/ -# Credential format:< , to enable AUTO_LOGIN option bellow, +# Credential format:<>> , to enable AUTO_LOGIN option bellow, the config in app, has to also be enabled. -< +<>> # BACKUP_ENABLED -> Enable (1), disable (0) backups to be restored from config page. -< +<>> # Default database driver prefix, is SQLite. Note Remove -> '!' prefix to tag name, to enable, set, and override any previously set from now on, top to end of file approach. -< +<>> # ProgresSQL DB driver. -< +<>> # LOG actual variable size limit, - 1024 default, 128 minimum value. -< +<>> # Set the following to an database name, with external managed multiple users, that are to connect to a single database. # Users have to be externally set, and alias is then used for their userid to be able to login. (Add user roles to AUTH table). # By default this setting is disabled with 0, making alias name, its own log database, per user. -< +<>> # Timezoning, if set to 1, country locale setting for timezone in config page is ignored. -< +<>> # Public, enabled list of categories. Remove -> '!' prefix before tag name, to enable. Be careful what category you add/enable here. # Public records view feature only, it doesn't allow new log entries to be added and have pin point searching of all existing. <#File,System log and Event. # Following is similar to AUTO_LOGIN setting above, and must be set. -< +<>> < <- (Diary,System Log,Poetry) category id's only, does set in the config page also work. -<>> -<=6 AND >>> +<>> <- (Diary,System Log,Poetry) category id's only, does set in the config page also work. +<>> +<=6 AND >>> < @@ -70,6 +69,7 @@ America/Texas=America/Chicago 38|$COMPRESS_ENC=0`Compress Encode pages, default -> 0=false, 1=true. 40|$SUBPAGEDIR =docs`Directory to scan for subpages like documents. 42|$DISP_ALL = 1`Display whole log entry, default -> 1=true, 0=false for display single line only. +>> < 01|Unspecified `For quick uncategorized entries. 03|File System `Operating file system/Application short log. @@ -86,6 +86,7 @@ America/Texas=America/Chicago 60|Online `Online purchases (ebay, or received/ordered from online source). 88|Diary `Diary specific log and entry. Your daily yaddi-yadda that have decided to place here. 90|Fitness `Fitness steps, news, info, and useful links. Amount is steps. +>> < NOTES|DROP TABLE NOTES;' ver. 1.5 fts4 virtual tables have been scratched as they require special SQLite compilation. LOG<5>|Run Query ' ver. 1.5 diff --git a/htdocs/cgi-bin/login_ctr.cgi b/htdocs/cgi-bin/login_ctr.cgi index fe9f16d..d7a5eb9 100755 --- a/htdocs/cgi-bin/login_ctr.cgi +++ b/htdocs/cgi-bin/login_ctr.cgi @@ -287,7 +287,7 @@ try{ TIME_ZONE_MAP=>$TIME_ZONE_MAP, db_log_var_limit=>Settings::dbVLSZ() }); - my $DB_VERSION = Settings::release(); + my $DB_VERSION = Settings::release(); #$After loading of config this has now been changed to the current database one. my $hasLogTbl = $curr_tables{'LOG'}; my $hasNotesTbl = $curr_tables{'NOTES'}; my @annons = Settings::anons(); @@ -330,7 +330,7 @@ try{ $db->do('CREATE TABLE life_log_login_ctr_temp_table AS SELECT * FROM LOG;'); my %notes_ids = (); if($hasNotesTbl){ - $pst = Settings::selectRecords($db, 'SELECT rowid, DATE FROM LOG WHERE RTF > 0 ORDER BY DATE;'); + $pst = Settings::selectRecords($db, 'SELECT rowid, DATE FROM LOG WHERE ID_RTF > 0 ORDER BY DATE;'); while(my @row = $pst->fetchrow_array()) { my $sql_date = $row[1];; $sql_date = DateTime::Format::SQLite->parse_datetime($sql_date); @@ -386,9 +386,16 @@ try{ elsif($hasLogTbl && $SCRIPT_RELEASE > $DB_VERSION && $DB_VERSION < 2.0){ #dev 1.9 main log view has changed in 1.8..1.9, above scope will perform anyway, its drop, to be recreated later. $db->do('DROP VIEW '.Settings->VW_LOG);delete($curr_tables{Settings->VW_LOG}); + $db->do('ALTER TABLE "main"."LOG" ADD COLUMN "RTF" BYTE default 0'); delete($curr_tables{Settings->VW_LOG}); $changed = 1; - }elsif($SCRIPT_RELEASE > $DB_VERSION){$changed = 1;} + } + elsif($hasLogTbl && $SCRIPT_RELEASE > $DB_VERSION && $DB_VERSION < 2.2){ + $db->do('ALTER TABLE "main"."LOG" ADD COLUMN "RTF" BYTE default 0');$changed = 1; + } + elsif($SCRIPT_RELEASE > $DB_VERSION){$changed = 1;} + + if(!$hasLogTbl) {