Skip to content

Commit

Permalink
Change the readme and update the sizes
Browse files Browse the repository at this point in the history
Signed-off-by: Suki <suki@missallsunday.com>
  • Loading branch information
MissAllSunday committed Aug 2, 2015
1 parent a569d6a commit c06886b
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 12 deletions.
10 changes: 5 additions & 5 deletions Sources/OharaYTEmbed.php
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ function OYTE_Main($data)

// Got something!
else
$result = '<div class="oharaEmbed youtube" id="oh_'. $videoID .'" style="width: '. (empty($modSettings['OYTE_video_width']) ? '420' : $modSettings['OYTE_video_width']) .'px; height: '. (empty($modSettings['OYTE_video_height']) ? '315' : $modSettings['OYTE_video_height']) .'px;"></div>';
$result = '<div class="oharaEmbed youtube" id="oh_'. $videoID .'" style="width: '. (empty($modSettings['OYTE_video_width']) ? '480' : $modSettings['OYTE_video_width']) .'px; height: '. (empty($modSettings['OYTE_video_height']) ? '270' : $modSettings['OYTE_video_height']) .'px;"></div>';

return $result;
}
Expand All @@ -186,13 +186,13 @@ function OYTE_Vimeo($data)
require_once($sourcedir .'/Subs-Package.php');

// Construct the URL
$oembed = 'https://vimeo.com/api/oembed.json?url=' . rawurlencode($data) . '&width='. (empty($modSettings['OYTE_video_width']) ? '420' : $modSettings['OYTE_video_width']) .'&height='. (empty($modSettings['OYTE_video_height']) ? '315' : $modSettings['OYTE_video_height']);
$oembed = 'https://vimeo.com/api/oembed.json?url=' . rawurlencode($data) . '&width='. (empty($modSettings['OYTE_video_width']) ? '480' : $modSettings['OYTE_video_width']) .'&height='. (empty($modSettings['OYTE_video_height']) ? '270' : $modSettings['OYTE_video_height']);

//Attempts to fetch data from a URL, regardless of PHP's allow_url_fopen setting
$jsonArray = json_decode(fetch_web_data($oembed), true);

if (!empty($jsonArray) && is_array($jsonArray) && !empty($jsonArray['html']))
return '<div class="oharaEmbed vimeo">'. str_replace('<iframe', '<iframe width="'. (empty($modSettings['OYTE_video_width']) ? '420' : $modSettings['OYTE_video_width']) .'px" height="'. (empty($modSettings['OYTE_video_height']) ? '315' : $modSettings['OYTE_video_height']) .'px"', $jsonArray['html']) .'</div>';
return '<div class="oharaEmbed vimeo">'. str_replace('<iframe', '<iframe width="'. (empty($modSettings['OYTE_video_width']) ? '480' : $modSettings['OYTE_video_width']) .'px" height="'. (empty($modSettings['OYTE_video_height']) ? '270' : $modSettings['OYTE_video_height']) .'px"', $jsonArray['html']) .'</div>';


else
Expand Down Expand Up @@ -247,8 +247,8 @@ function OYTE_care(&$dummy)
// Add our css and js files. Dear and lovely mod authors, if you're going to use $context['html_headers'] MAKE SURE you append your data .= instead of re-declaring the var! and don't forget to add a new line and proper indentation too!
$context['html_headers'] .= '
<script type="text/javascript"><!-- // --><![CDATA[
var _ohWidth = '.(empty($modSettings['OYTE_video_width']) ? '420' : $modSettings['OYTE_video_width']).';
var _ohHeight = '.(empty($modSettings['OYTE_video_height']) ? '420' : $modSettings['OYTE_video_height']).';
var _ohWidth = '.(empty($modSettings['OYTE_video_width']) ? '480' : $modSettings['OYTE_video_width']).';
var _ohHeight = '.(empty($modSettings['OYTE_video_height']) ? '270' : $modSettings['OYTE_video_height']).';
// ]]></script>
<script type="text/javascript">!window.jQuery && document.write(unescape(\'%3Cscript src="//code.jquery.com/jquery-1.9.1.min.js"%3E%3C/script%3E\'))</script>
<script type="text/javascript" src="'. $settings['default_theme_url'] .'/scripts/ohyoutube.min.js"></script>
Expand Down
20 changes: 13 additions & 7 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,38 +49,44 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.


[color=purple][b][size=12pt]Changelog[/size][/b][/color]
[code]
1.2.4 - August 2, 2015,
- Added responsiveness to videos.
- Re-wrote the JS code to use prototypes.
- Change the default size values to 480 x 270.

[b]1.2.4 - June 26, 2015,[/b]
1.2.3 - June 26, 2015,
- Added a minified js file.
- Added support for using the youtube ID as param.
- License change to MPL 2.0.

[b]1.2.2 - April 05, 2015,[/b]
1.2.2 - April 05, 2015,
- Force loading the oharaEmbed.css file from the default theme.
- Add more options to show video preview images
- Add support for previewing a message
- Improve handling of youtube thumbnails and overall JS improvements.
- Add a setting to enable/disable the autoembed feature. This was suppose to be added a long time ago but dunno why I forgot to do it...
- Missed to check the master setting.

[b]1.2.1 - March 09, 2015,[/b]
1.2.1 - March 09, 2015,
- Added the option to disable the autoembed feature via $context['ohara_disable'].
- Use closures instead of create_function()
- Change the way youtube videos are displayed, faster pages specially with multiple videos, thanks to Infernuza for the tip.

[b]1.2 - March 05, 2014,[/b]
1.2 - March 05, 2014,
- Added auto-embed feature.
- Add support for old [nobbc][yt][/yt][/nobbc] tags
- Add support for [nobbc][vimeo][/vimeo][/nobbc]

[b]1.1 - April 19, 2013,[/b]
1.1 - April 19, 2013,
- Fix the http/https url issue.
- Fixed the parsing smiles after a video issue.
- Fixed the pass by reference issue.
- Updated the regex to include more valid urls.

[b]1.0.1 - Dic 28, 2011,[/b]
1.0.1 - Dic 28, 2011,
-Fix the youtube redirect page error if you use the initial tag alone: [youtube]

[b]1.0 - Sep 25, 2011,[/b]
1.0 - Sep 25, 2011,
-Initial Release
[/code]

0 comments on commit c06886b

Please sign in to comment.