From: Nicolas Boisselier Date: Thu, 7 Jun 2018 01:46:25 +0000 (+0100) Subject: www/dbq/dbq.php X-Git-Url: https://git.nbdom.net/?a=commitdiff_plain;h=73ba55a4756011026916eb2216813841fc07ecc4;p=nb.git www/dbq/dbq.php --- diff --git a/etc/profile.d/sys.sh b/etc/profile.d/sys.sh index 1c101c4e..faebb4c7 100644 --- a/etc/profile.d/sys.sh +++ b/etc/profile.d/sys.sh @@ -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 } diff --git a/lib/postgres/mime.sql b/lib/postgres/mime.sql index 1e67970f..df7b3396 100644 --- a/lib/postgres/mime.sql +++ b/lib/postgres/mime.sql @@ -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 diff --git a/www/dbq/dbq.php b/www/dbq/dbq.php index f679f847..e74e3c51 100644 --- a/www/dbq/dbq.php +++ b/www/dbq/dbq.php @@ -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(); }