}
// save style
- if ($style !== null) {
- $style->update($styleData);
- }
- else {
+ if ($style === null) {
$styleData['packageID'] = $packageID;
$style = new StyleEditor(self::create($styleData));
- }
-
- // import preview image
- if (!empty($data['image'])) {
- $fileExtension = mb_substr($data['image'], mb_strrpos($data['image'], '.'));
- $index = $tar->getIndexByFilename($data['image']);
- if ($index !== false) {
- $filename = WCF_DIR.'images/stylePreview-'.$style->styleID.$fileExtension;
- $tar->extract($index, $filename);
- FileUtil::makeWritable($filename);
-
- if (file_exists($filename)) {
- try {
- if (($imageData = getimagesize($filename)) !== false) {
- switch ($imageData[2]) {
- case IMAGETYPE_PNG:
- case IMAGETYPE_JPEG:
- case IMAGETYPE_JPG:
- case IMAGETYPE_GIF:
- $style->update(array('image' => 'stylePreview-'.$style->styleID.$fileExtension));
+
+ // import preview image
+ if (!empty($data['image'])) {
+ $fileExtension = mb_substr($data['image'], mb_strrpos($data['image'], '.'));
+ $index = $tar->getIndexByFilename($data['image']);
+ if ($index !== false) {
+ $filename = WCF_DIR.'images/stylePreview-'.$style->styleID.$fileExtension;
+ $tar->extract($index, $filename);
+ FileUtil::makeWritable($filename);
+
+ if (file_exists($filename)) {
+ try {
+ if (($imageData = getimagesize($filename)) !== false) {
+ switch ($imageData[2]) {
- case IMG_PNG:
- case IMG_JPEG:
- case IMG_JPG:
- case IMG_GIF:
++ case IMAGETYPE_PNG:
++ case IMAGETYPE_JPEG:
++ case IMAGETYPE_JPG:
++ case IMAGETYPE_GIF:
+ $style->update(['image' => 'stylePreview-'.$style->styleID.$fileExtension]);
+ }
}
}
- }
- catch (SystemException $e) {
- // broken image
+ catch (SystemException $e) {
+ // broken image
+ }
}
}
}
-- media providers
-- Videos
-- Youtube
- INSERT INTO wcf1_bbcode_media_provider (title, regex, html) VALUES ('YouTube', 'https?://(?:.+?\\.)?youtu(?:\\.be/|be\\.com/(?:#/)?watch\\?(?:.*?&)?v=)(?P<ID>[a-zA-Z0-9_-]+)(?:(?:\\?|&)t=(?P<start>\\d+)$)?', '<iframe style="max-width:100%;" width="560" height="315" src="https://www.youtube.com/embed/{$ID}?wmode=transparent&start={$start}" allowfullscreen></iframe>');
+ INSERT INTO wcf1_bbcode_media_provider (title, regex, html) VALUES ('YouTube', 'https?://(?:.+?\\.)?youtu(?:\\.be/|be\\.com/(?:#/)?watch\\?(?:.*?&)?v=)(?P<ID>[a-zA-Z0-9_-]+)(?:(?:\\?|&)t=(?P<start>\\d+)$)?', '<div class="videoContainer"><iframe src="https://www.youtube.com/embed/{$ID}?wmode=transparent&start={$start}" allowfullscreen></iframe></div>');
+ -- Youtube playlist
+ INSERT INTO wcf1_bbcode_media_provider (title, regex, html) VALUES ('YouTube Playlist', 'https?://(?:.+?\\.)?youtu(?:\\.be/|be\\.com/)playlist\\?(?:.*?&)?list=(?P<ID>[a-zA-Z0-9_-]+)', '<div class="videoContainer"><iframe src="https://www.youtube.com/embed/videoseries?list={$ID}" allowfullscreen></iframe></div>');
-- Vimeo
INSERT INTO wcf1_bbcode_media_provider (title, regex, html) VALUES ('Vimeo', 'https?://vimeo\\.com/(?P<ID>\\d+)', '<iframe src="https://player.vimeo.com/video/{$ID}" width="400" height="225" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>');
- -- MyVideo
- INSERT INTO wcf1_bbcode_media_provider (title, regex, html) VALUES ('MyVideo', 'http://(?:www\\.)?myvideo\\.de/watch/(?P<ID>\\d+)', '<object width="611" height="383" type="application/x-shockwave-flash" data="http://www.myvideo.de/movie/{$ID}"><param name="movie" value="http://www.myvideo.de/movie/{$ID}" /><param name="AllowFullscreen" value="true" /><param name="AllowScriptAccess" value="always" /><param name="wmode" value="transparent" /></object>');
-- Clipfish
INSERT INTO wcf1_bbcode_media_provider (title, regex, html) VALUES ('Clipfish', 'http://(?:www\\.)?clipfish\\.de/(?:.*?/)?video/(?P<ID>\\d+)/', '<div style="width:464px; height:404px;"><div style="width:464px; height:384px;"><iframe src="http://www.clipfish.de/embed_video/?vid={$ID}&as=0&col=990000" name="Clipfish Embedded Video" width="464" height="384" align="left" marginheight="0" marginwidth="0" scrolling="no"></iframe></div></div>');
-- Veoh