Войти
Введите цифры и буквы
/** * coub.com */ $sText = preg_replace('/<video>http:\/\/(?:www\.|)coub\.com\/view\/([a-zA-Z0-9_\-]+)(&.+)?<\/video>/Ui', '<iframe width="500" height="281" src="http://coub.com/embed/$1" frameborder="0" allowfullscreen></iframe>', $sText); $sText = preg_replace('/<video>https:\/\/(?:www\.|)coub\.com\/view\/([a-zA-Z0-9_\-]+)(&.+)?<\/video>/Ui', '<iframe width="500" height="281" src="http://coub.com/embed/$1" frameborder="0" allowfullscreen></iframe>', $sText);
if ($sReturn = $this->parseCoub($sContent)) { return $sReturn; } return false;
protected function parseCoub($sContent) { if (preg_match('#coub\.com\/view\/(\w+).*#i', $sContent, $aMatch)) { return '<iframe src="https://coub.com/embed/' . $aMatch[1] . '?muted=false&autostart=false&originalSize=false&startWithHD=false" allowfullscreen frameborder="0" width="640" height="360" allow="autoplay"></iframe>'; } return false; }
8 комментариев
Вставляешь этот код
после 184 строки.
потом в \config\jevix.php добавь в разрешенные домены coub.com
Изменения вносим в файл \framework\classes\modules\text\entity\ParserTagVideo.entity.class.php
после 47 строчки добавляем
ну и после Яндекса перед закрывающимся } добавляем