mirror of
https://github.com/Znote/ZnoteAAC.git
synced 2025-04-29 18:59:21 +02:00
Add BB tag for YouTube videos to news and forum. Use with the video id (after v= in URL) ex. [youtube]wK0w0x62PjA[/youtube]
This commit is contained in:
parent
3265ba6c99
commit
5af3051c36
@ -23,6 +23,7 @@ function TransformToBBCode($string) {
|
||||
'[link={$1}]{$2}[/link]' => '<a href="$1" target="_BLANK">$2</a>',
|
||||
'[color={$1}]{$2}[/color]' => '<font color="$1">$2</font>',
|
||||
'[*]{$1}[/*]' => '<li>$1</li>',
|
||||
'[youtube]{$1}[/youtube]' => '<div class="youtube"><div class="aspectratio"><iframe src="//www.youtube.com/embed/$1" frameborder="0" allowfullscreen></iframe></div></div>',
|
||||
);
|
||||
|
||||
foreach ($tags as $tag => $value) {
|
||||
|
@ -63,6 +63,7 @@
|
||||
'[link={$1}]{$2}[/link]' => '<a href="$1" target="_BLANK">$2</a>',
|
||||
'[color={$1}]{$2}[/color]' => '<font color="$1">$2</font>',
|
||||
'[*]{$1}[/*]' => '<li>$1</li>',
|
||||
'[youtube]{$1}[/youtube]' => '<div class="youtube"><div class="aspectratio"><iframe src="//www.youtube.com/embed/$1" frameborder="0" allowfullscreen></iframe></div></div>',
|
||||
);
|
||||
foreach ($tags as $tag => $value) {
|
||||
$code = preg_replace('/placeholder([0-9]+)/', '(.*?)', preg_quote(preg_replace('/\{\$([0-9]+)\}/', 'placeholder$1', $tag), '/'));
|
||||
|
@ -628,3 +628,25 @@ hr {
|
||||
background-color: green;
|
||||
border: 1px solid black;
|
||||
}
|
||||
|
||||
/* ///////////\/\\\\\\\\\\\
|
||||
// Znote YOUTUBE BB \\
|
||||
///////////\/\\\\\\\\\\\ */
|
||||
|
||||
div.youtube {
|
||||
width: 100%;
|
||||
max-width: 560px;
|
||||
}
|
||||
|
||||
div.aspectratio {
|
||||
width: 100%;
|
||||
padding-bottom: 56.25%; /* 16:9 */
|
||||
position: relative;
|
||||
}
|
||||
|
||||
div.aspectratio > iframe {
|
||||
position: absolute;
|
||||
top: 0; bottom: 0; left: 0; right: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user