public static function html_video($str) {
$sites = [
+ 'viveo' => [
+ 'exp' => '//player.vimeo.com/video/([^/&\s]+)',
+ 'html' => '<iframe class="video"'
+ .' type="text/html"'
+ .' src="//player.vimeo.com/video/<SRC>"'
+ .' frameborder="0"'
+ .' allowfullscreen'
+ .'></iframe>',
+ ],
'dtube' => [
- 'exp' => '(d.tube/#!/v/[^/]+/[^/\?\s]+)',
+ 'exp' => '(d\.tube/#!/v/[^/]+/[^/\?\s]+)',
'html' => '<iframe class="video"'
.' type="text/html"'
.' src="<SRC>"'
.'></iframe>',
],
'hooktube' => [
- 'exp' => 'hooktube.com/watch\?v=([^/&\s]+)',
+ 'exp' => 'hooktube\.com/watch\?v=([^/&\s]+)',
'html' => '<iframe class="video"'
.' type="text/html"'
.' src="//hooktube.com/embed/<SRC>?enablejsapi=1&autoplay=0"'
],
'youtube' => [
#'exp' => 'www.youtube.com/watch\?v=([^/&\s]+)',
- 'exp' => '(?:/watch\?v=|/video/)([^/&\s]+)',
+ 'exp' => '(?:/watch\?v=|/video/|//youtu.be/)([^/&\s]+)',
'html' => '<a href="'.$str.'"><iframe class="video"'
.' type="text/html"'
+ #.' src="//youtu.be/embed/<SRC>?enablejsapi=1"'
.' src="//www.youtube.com/embed/<SRC>?enablejsapi=1"'
# NB 10.06.18 .' src="//hooktube.com/embed/<SRC>?enablejsapi=1"'
.' frameborder="0"'
<?php
require_once(dirname(__FILE__).'/nb.php');
+require_once(NB_ROOT.'/lib/php/mime.php');
Class Out extends Nb {
protected static $type = 'txt';
protected static $types;
protected static $header = true;
+ protected static $mime;
public static function init() {
#self::$types['html'] = self::$types['table'];
self::type(self::client_type());
+ #self::$mime = new Mime();
}
public function __construct($opt=[],&$data=[],$head=[]) {
if (empty($o['no_format'])) foreach ($row as $k => $v) {
$row[$k] = self::format($v,null,$o);
}
+
if (isset($o['row_parse_post'])) {
$o['row_parse_post']($row);
}
if (!empty($o['escape'])) $v = self::escape($v);
+ # Html user friendly
+# NB 25.07.18 if (!empty($o['is_html']) and $is_scalar) $v = Mime::html($v);
+
return $v;
}
$raw = null;
#debug([self::client_header('Accept'),$content_type]);
+ #global $_POST;
foreach (['json','yaml'] as $type) {
if (!strpos($content_type,'/'.$type)) continue;
# NB 20.07.18 unset($post[$type]);
$fct = $type . '_decode';
- $_POST = $this->$fct(file_get_contents("php://input"));
+ $_POST = (array)$this->$fct(file_get_contents("php://input"));
+ #foreach ($_POST as $k=>$v) { $_POST[$k] = $v; }
+ #bye($_POST);
# NB 20.07.18 $_POST = array_merge((array)$this->$fct($_POST[$type]),$post);
break;
} elseif ($action == 'status') { $this->page($this,'status');
} elseif ($action == 'conf') { $this->page($this,'conf');
} elseif ($action == 'conf') { $this->page($this,'conf');
- #} elseif ($action == 'html_video') { $this->page($arg);
- } elseif ($action == 'html_video') { $this->page(Mime::html_video($arg));
- } elseif ($action == '_post') { $this->page($_POST);
- } elseif ($action == '_get') { $this->page($_GET);
+ } elseif ($action == 'html') { $this->page(Mime::html($arg));
} elseif ($action == 'types') {
$types = [];
#$this->page($this,'phpinfo_rows');
#$this->phpinfo_rows();
+ } elseif ($action == '_POST') { $this->page($_POST);
+ } elseif ($action == '_GET') { $this->page($_GET);
} elseif (0
or $action == '_SERVER'
or $action == '_REQUEST'