]> lifelog.hopto.org Git - LifeLog.git/commitdiff
FRAME_SIZE
authorMetabox <redacted>
Fri, 19 Jul 2019 12:01:54 +0000 (22:01 +1000)
committerMetabox <redacted>
Fri, 19 Jul 2019 12:01:54 +0000 (22:01 +1000)
htdocs/cgi-bin/config.cgi
htdocs/cgi-bin/login_ctr.cgi
htdocs/cgi-bin/main.cgi

index 04e3c5594ab29d3ef84a4b271aff889a37114674..5b77584e6684357b04917b53084f92d458d021f7 100755 (executable)
@@ -31,6 +31,7 @@ our $AUTHORITY   = '';
 our $IMG_W_H     = '210x120';
 our $AUTO_WRD_LMT= 200;
 our $AUTO_LOGIN  = 0;
+our $FRAME_SIZE  = 0;
 #END OF SETTINGS
 
 #This is the OS developer release key, replace on istallation. As it is not secure.
@@ -221,13 +222,36 @@ while(my @row = $dbs->fetchrow_array()) {
                             $u = "SELECTED"
                                }
         $v = qq(<select id="almi" name="var$i">
-                                        <option value="0" $l>Disabled</option>
-                                                                <option value="1" $u>Enabled</option>
-                                                               </select>);
+                          <option value="0" $l>Disabled</option>
+                          <option value="1" $u>Enabled</option>
+                       </select>);
                 }
-                elsif($n ne "RELEASE_VER"){             
+                elsif($n eq "FRAME_SIZE"){
+                         my($l,$m,$s, $t)=("","");
+                               if($v == 0){
+                                        $l = "SELECTED"
+                               }
+                               elsif($v == 1){
+                                        $m = "SELECTED"
+                               }
+                               elsif($v == 2){
+                                        $s = "SELECTED"
+                               }
+                               else{
+                                $t = $v;
+                               }
+               $v = qq(<select id="almi" name="var$i">
+                          <option value="0" $l>Large</option>
+                          <option value="1" $m>Medium</option>
+                                  <option value="2" $s>Small</option>
+                                  <option value="3" $t>---</option>
+                       </select>);     
+               }
+               elsif($n ne "RELEASE_VER"){              
                         $v = '<input name="var'.$i.'" type="text" value="'.$v.'" size="12">';
-                }               
+               }
+
+
           $tbl = qq($tbl 
           <tr class="r0" align="left">
                    <td>$n</td>
@@ -753,6 +777,7 @@ sub changeSystemSettings {
                                                case "IMG_W_H"   {$IMG_W_H=$var; updCnf($r[0],$var)}
                                                case "AUTO_WRD_LMT"{$AUTO_WRD_LMT=$var; updCnf($r[0],$var)}
                                                case "AUTO_LOGIN" {$AUTO_LOGIN=$var; updCnf($r[0],$var)}
+                                               case "FRAME_SIZE" {$FRAME_SIZE=$var; updCnf($r[0],$var)}
                                         }
                                }
                        }
@@ -951,6 +976,7 @@ sub getConfiguration {
                                case "IMG_W_H"      {$IMG_W_H=$r[2]}
                                case "AUTO_WRD_LMT" {$AUTO_WRD_LMT=$r[2]}
                                case "AUTO_LOGIN"       {$AUTO_LOGIN=$r[2]}
+                               case "FRAME_SIZE"       {$FRAME_SIZE=$r[2]}
                        }
 
                }
index 142ba1533c72eef52c4823182b6fbc12f369a377..b1b0b94f8cda5fc833a8752533dbd9b606d478ad 100755 (executable)
@@ -30,6 +30,7 @@ our $AUTHORITY   = '';
 our $IMG_W_H     = '210x120';
 our $AUTO_WRD_LMT= 200;
 our $AUTO_LOGIN  = 0;
+our $FRAME_SIZE  = 0;
 #END OF SETTINGS
 
 
@@ -202,8 +203,7 @@ try{
                                                CREATE INDEX idx_cat_name ON CAT (NAME);
                 ); 
                $rv = $db->do($stmt);
-               $changed = 1;
-               #insertDefCats($db);
+               $changed = 1;           
        }
        #Have cats been wiped out?
        $st = $db->prepare('SELECT count(ID) FROM CAT;');
@@ -314,7 +314,6 @@ my $stmt = qq(
 }
 
 sub populate {
-
                
                my $db = shift;
                my ($did,$name, $value, $desc);
@@ -416,24 +415,6 @@ sub selSQLTbl{
 return "SELECT name FROM sqlite_master WHERE type='table' AND name='$name';"
 }
 
-sub insertDefCats {
-         my
-         $st = $_[0]->prepare('INSERT INTO CAT VALUES (?,?,?)'); 
-                       $_[0]->begin_work();
-               $st->execute(1, "Unspecified", "For quick uncategorised entries.");
-               $st->execute(2, "Document", "Large Protected RichText document log entry type.");
-               $st->execute(3, "File", "Operating file system short log.");
-               $st->execute(6, "System Log", "Operating system important log.");
-               $st->execute(9, "Event", "Event that occured, meeting, historically important.");
-               $st->execute(28,"Personal", "Personal log of historical importance, diary type.");
-               $st->execute(32,"Expense", "Significant yearly expense.");
-               $st->execute(35,"Income", "Significant yearly income.");
-               $st->execute(40,"Work", "Work related entry, worth monitoring.");
-               $st->execute(45,"Food", "Quick reference to recepies, observations.");
-               $_[0]->commit();
-               $st->finish();
-}
-
 
 sub removeOldSessions {
        opendir(DIR, $LOG_PATH);
index 145f7b215b307f7da795cd77e5eb25055b61720c..b4f7f3ad6db037436a2164b74c7579979593d056 100755 (executable)
@@ -19,6 +19,7 @@ use DateTime::Duration;
 use Date::Language;
 use Date::Parse;
 use Time::localtime;
+
 use Regexp::Common qw /URI/;
 
 #DEFAULT SETTINGS HERE!
@@ -32,8 +33,8 @@ our $DATE_UNI     = '0';
 our $RELEASE_VER  = '1.5';
 our $AUTHORITY    = '';
 our $IMG_W_H      = '210x120';
-our $AUTO_WRD_LMT = 200;
-
+our $AUTO_WRD_LMT = 1000;
+our $FRAME_SIZE   = 0;
 #END OF SETTINGS
 
 my $cgi = CGI->new;
@@ -400,7 +401,16 @@ while ( my @row = $st->fetchrow_array() ) {
       #Replace with a full link an HTTP URI
       if($log =~ /<iframe /){
           my $a = q(<iframe width="560" height="315");
-          my $b = q(<iframe width="390" height="215");
+          my $b;
+          switch ( $FRAME_SIZE ) {
+               case "0" { $b = q(width="390" height="215") }
+               case "1" { $b = q(width="280" height="180") }
+               case "2" { $b = q(width="160" height="120") }
+               else{
+                          $b = $FRAME_SIZE;
+               }
+          }
+          $b = "<iframe $b";
           $log =~ s/$a/$b/o;
       }
       else{
@@ -970,6 +980,7 @@ sub getConfiguration {
                   case "LANGUAGE"     { $LANGUAGE     = $r[2] }
                   case "IMG_W_H"      { $IMG_W_H      = $r[2] }
                   case "AUTO_WRD_LMT" { $AUTO_WRD_LMT = $r[2] }
+                  case "FRAME_SIZE"   { $FRAME_SIZE   = $r[2] }
                   else {
                       print "Unknow variable setting: " . $r[1] . " == " . $r[2];
                 }