diff options
| author | czaks <marcin@6irc.net> | 2014-05-04 01:20:12 +0200 |
|---|---|---|
| committer | czaks <marcin@6irc.net> | 2014-05-04 01:20:12 +0200 |
| commit | 73eb8c6b58d61fdea8dcfb7747daa4902a42838a (patch) | |
| tree | 70b88ec750ca102d2601d35f69cc4dc58dc843f8 /templates/themes/catalog/theme.php | |
| parent | bac23d22f89aba8773a52b8e14566e24060f304f (diff) | |
quick & dirty youtube thumbnails in catalog support
Diffstat (limited to 'templates/themes/catalog/theme.php')
| -rw-r--r-- | templates/themes/catalog/theme.php | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/templates/themes/catalog/theme.php b/templates/themes/catalog/theme.php index d3a837ca..5d391536 100644 --- a/templates/themes/catalog/theme.php +++ b/templates/themes/catalog/theme.php @@ -41,6 +41,11 @@ $post['link'] = $config['root'] . $board['dir'] . $config['dir']['res'] . sprintf($config['file_page'], ($post['thread'] ? $post['thread'] : $post['id'])); $post['board_name'] = $board['name']; $post['file'] = $config['uri_thumb'] . $post['thumb']; + + if ($post['embed'] && preg_match('/^https?:\/\/(\w+\.)?(?:youtube\.com\/watch\?v=|youtu\.be\/)([a-zA-Z0-9\-_]{10,11})(&.+)?$/i', $post['embed'], $matches)) { + $post['youtube'] = $matches[2]; + } + $recent_posts[] = $post; } |
