]> git.nbdom.net Git - nb.git/commitdiff
www/dbq/dbq.php
authorNicolas Boisselier <nicolas.boisselier@gmail.com>
Thu, 7 Jun 2018 01:46:25 +0000 (02:46 +0100)
committerNicolas Boisselier <nicolas.boisselier@gmail.com>
Thu, 7 Jun 2018 01:46:25 +0000 (02:46 +0100)
etc/profile.d/sys.sh
lib/postgres/mime.sql
www/dbq/dbq.php

index 1c101c4eb7a0dc3042c6995bd40d66ed897c889f..faebb4c7b6db81ab5febd1f471508dca628611b1 100644 (file)
@@ -10,7 +10,7 @@ arch${s}$(sys_arch)
 nproc${s}$(sys_nproc)
 date_install${s}$(sys_date_install)
 ips${s}$(echo -n $(ips 2>/dev/null))
-public_ip${s}$( (http_get http://nbdom.net/myip || curl -s http://nbdom.net/myip) 2>/dev/null)
+public_ip${s}$( (http_get http://nicolas.boisselier.free.fr/myip/) 2>/dev/null)
 EOF
 }
 
index 1e67970f48296acca5cea5dc3baf746fceeceb47..df7b3396c203b049ac81a82c0f17deb028b92ff1 100644 (file)
@@ -12,7 +12,7 @@ BEGIN TRANSACTION;
 DELETE FROM mime;
 CREATE TEMPORARY TABLE tmp_mime ON COMMIT DROP AS SELECT * FROM mime LIMIT 0;
 
-COPY mime FROM STDIN WITH (format 'text', NULL '');
+COPY mime (ext,type,name) FROM STDIN WITH (format 'text', NULL '');
 x3d    application/vnd.hzn-3d-crossword        3D Crossword Plugin
 3g2    video/3gpp2     3GP2
 mseq   application/vnd.mseq    3GPP MSEQ File
index f679f847ff570e3c40cfc366ce6702d980d3fd04..e74e3c519086b1a4a5cbb9b5503212eb8454e38d 100644 (file)
@@ -506,7 +506,8 @@ class DbQ extends nb {
                $this->db->limit = $this->limit();
                $ropt = [
                        #'html_menu' => empty($this->_nopage),
-                       'is_html' => empty($this->_nopage),
+# NB 07.06.18                  'is_html' => empty($this->_nopage),
+                       'is_html' => $this->page->is('html'),
                ];
                if (!empty($this->_nopage)) {
                        $this->table->show_url_sort = false;
@@ -589,6 +590,13 @@ class DbQ extends nb {
                return $h;
        }
 
+       private function default_format() {
+               return 
+                       (!empty($_SERVER['HTTP_USER_AGENT']) and preg_match($this->format_html_ua_exp,$_SERVER['HTTP_USER_AGENT']))
+                               ? 'html'
+                               : $this->format_cli
+               ;
+       }
 
        public function format($set=null) {
                if ($set === null) return $this->params['format'];
@@ -719,7 +727,7 @@ class DbQ extends nb {
                $this->uri = $path;
                $this->uri_params = explode($this->expode_args,$args);
 
-               // We accept sub extention, that will determine if we wanr to print the full page
+               // We accept sub extention, that will determine if we want to print the full page
                if (preg_match('/\.((\w+)(\.html)?)$/',$path,$m)) {
                        $path = substr($path,0,strlen($path)-strlen($m[1])-1);
                        $values[] = $m[2];
@@ -948,11 +956,7 @@ EOF;
                        # Not empty !
 
                } else {
-                       $format = 
-                               (!empty($_SERVER['HTTP_USER_AGENT']) and preg_match($this->format_html_ua_exp,$_SERVER['HTTP_USER_AGENT']))
-                                       ? 'html'
-                                       : $this->format_cli
-                       ;
+                       $format = $this->default_format();
 
                }