VBsupport перешел с домена .ORG на родной .RU
Ура!
Пожалуйста, обновите свои закладки - VBsupport.ru
Блок РКН снят, форум доступен на всей территории России, включая новые терртории, без VPN
На форуме введена премодерация ВСЕХ новых пользователей
Почта с временных сервисов, типа mailinator.com, gawab.com и/или прочих, которые предоставляют временный почтовый ящик без регистрации и/или почтовый ящик для рассылки спама, отслеживается и блокируется, а так же заносится в спам-блок форума, аккаунты удаляются
Если вы хотите приобрести какой то скрипт/продукт/хак из каталогов перечисленных ниже: Каталог модулей/хаков
Ещё раз обращаем Ваше внимание: всё, что Вы скачиваете и устанавливаете на свой форум, Вы устанавливаете исключительно на свой страх и риск.
Сообщество vBSupport'а физически не в состоянии проверять все стили, хаки и нули, выкладываемые пользователями.
Помните: безопасность Вашего проекта - Ваша забота. Убедительная просьба: при обнаружении уязвимостей или сомнительных кодов обязательно отписывайтесь в теме хака/стиля
Спасибо за понимание
So basically this is a total easy-to-implement plugin, which converts standard youtube links to video-embeds on the fly without urging users to use the video-button because I think it is unnecessary.
On post display, the plugin checks if the post contains at least 1 youtube link in the form of
and converts them using the default vB video bbcode parser.
Code can be modified to fit your needs, altough there shouldn't be much to add.
If you're the special performance-freak, I'm curious if you can enhance data/query-performance. So let me know if you do.
INSTALL:
- Download attached XML File and import it as an addon.
Code:
Changes since 1.3:
- Now works properly on iPad
Changes since 1.2:
- Supports mobile devices with fallback-display if browser doesn't support flash/embed codes
- Allows the user to specify the above mentioned replacement code for mobile browsers
- Minor improvements & Fixes
Changes since 1.1:
- Moved regular expression and index position into admincp settings to allow easier changing in the future
- supports new youtube link format: "http://youtu.be/*somevideocode*"
Changes since 1.0: (or: why should I download that mod again?)
- Added Link parsing in post-preview mode and in post reviewbits (the latest posts you see under the new reply form)
Now every post containing youtube-links should display the embedded video instead.
Works with any number of youtube-links and any kind of text surrounding them.
Забавная ситуация... разработчики добавили штатный ББкод для вставки видео - нет, всё равно не то
лениво юзерам тыкать в кнопачки, надо, чтобы сразу, рррраз - ссылку кинул и всё
и ведь даже не сформулируешь "лениво нашим юзерам" - хаки-то не нашенские
Ещё один вариант Auto youtube player - проще, чем первый, без настроек, без определения мобильных
оба хака не парсят ссылки вида _http://www.youtube.com/watch?feature=player_embedded&v=5xw3QZ1r_NE
этот не обрабатывает и короткие ссылки вида _http://youtu.be/5xw3QZ1r_NE
тема на орге: http://www.vbulletin.org/forum/showthread.php?t=283432
Quote:
this is a very small mod converting any youtube url inside the post to live show embed player
its support all youtube servers and the new sharing link
how to install :
just upload the XML product from admin panel that's it
Проблема этих хаков в том, что они обрабатывают пост при отображении, а не при сохранении. Тоесть каждый раз, когда пост обрабатывается, обрабатывается и ссылка.
Я давно ищу хак, которые бы изменял ссылку на BB-code при отправке поста. Это бы решило проблему.
@mikesmith
Простоузер
Join Date: Aug 2009
Posts: 1
Версия vB: 3.8.7
Reputation:
Novice 0
Репутация в разделе: 0
0
Можно просто переписать парсер:
PHP Code:
function replaceLinkToIframe($text, $width = 480, $height = 390) { $text = preg_replace('~ # Match non-linked youtube URL in the wild. (Rev:20111012) https?:// # Required scheme. Either http or https. (?:[0-9A-Z-]+\.)? # Optional subdomain. (?: # Group host alternatives. youtu\.be/ # Either youtu.be, | youtube\.com # or youtube.com followed by \S* # Allow anything up to VIDEO_ID, [^\w\-\s] # but char before ID is non-ID char. ) # End host alternatives. ([\w\-]{11}) # $1: VIDEO_ID is exactly 11 chars. (?=[^\w\-]|$) # Assert next char is non-ID or EOS. (?! # Assert URL is not pre-linked. [?=&+%\w]* # Allow URL (query) remainder. (?: # Group pre-linked alternatives. [\'"][^<>]*> # Either inside a start tag, | </a> # or inside <a> element text contents. ) # End recognized pre-linked alts. ) # End negative lookahead assertion. [?=&+%\w-]* # Consume any URL (query) remainder. ~ix', '<a href="$0">watch video</a><div class="video-youtube" style="display:none"><iframe width="' . $width .'" height="' . $height .'" src="http://www.youtube.com/embed/$1" frameborder="0" allowfullscreen></iframe></div>', $text); return $text; }
@Catlord Meow
Специалист
Join Date: Jul 2016
Location: Москва
Posts: 183
Версия vB: 4.2.х
Пол:
Reputation:
Professional 417
Репутация в разделе: 68
0
Quote:
Originally Posted by fragov
Проблема этих хаков в том, что они обрабатывают пост при отображении, а не при сохранении. Тоесть каждый раз, когда пост обрабатывается, обрабатывается и ссылка.
Я давно ищу хак, которые бы изменял ссылку на BB-code при отправке поста. Это бы решило проблему.