Skip to content

Commit

Permalink
Merge pull request #36 from nguyenanhung/develop
Browse files Browse the repository at this point in the history
Update Project at Thu Aug 10 14:46:52 +07 2023
  • Loading branch information
nguyenanhung authored Aug 10, 2023
2 parents b124fe7 + 81e83b0 commit 5e0a541
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 11 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,7 @@ Hiện tại việc sử dụng nanoid đang là xu hướng so với uuid truy
- [x] Helper Function: `convert_video_embed_dailymotion` - Convert Video URL to Embed DailyMotion (ít dùng, lưu tại đây vì còn nhiều project cũ đang sử dụng)
- [x] Helper Function: `convert_video_embed_youtube` - Convert Video URL to Embed YouTube (ít dùng, lưu tại đây vì còn nhiều project cũ đang sử dụng)
- [x] Helper Function: `convert_video_v_embed_youtube` - Convert Video URL to Embed YouTube (ít dùng, lưu tại đây vì còn nhiều project cũ đang sử dụng)
- [x] Helper Function: `youtube_image_thumbnail` - Convert YoutubeID to Youtube Thumbnail URL

### XML Helper

Expand Down
31 changes: 22 additions & 9 deletions helpers/video_embed_helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,10 @@ function convert_video_embed_vimeo($vimeo)
}
if (!function_exists('convert_video_embed_dailymotion')) {
function convert_video_embed_dailymotion($dailymotion)
{if (empty($dailymotion)) {
return $dailymotion;
}
{
if (empty($dailymotion)) {
return $dailymotion;
}
$dailymotion = str_replace(
array(
'https://www.dailymotion.com/video/',
Expand All @@ -44,9 +45,10 @@ function convert_video_embed_dailymotion($dailymotion)
}
if (!function_exists('convert_video_v_embed_youtube')) {
function convert_video_v_embed_youtube($youtube)
{if (empty($youtube)) {
return $youtube;
}
{
if (empty($youtube)) {
return $youtube;
}
$youtube = str_replace(
array(
'https://www.youtube.com/watch?v=',
Expand All @@ -63,9 +65,10 @@ function convert_video_v_embed_youtube($youtube)
}
if (!function_exists('convert_video_embed_youtube')) {
function convert_video_embed_youtube($youtube)
{if (empty($youtube)) {
return $youtube;
}
{
if (empty($youtube)) {
return $youtube;
}
$youtube = str_replace(
array(
'https://www.youtube.com/watch?v=',
Expand Down Expand Up @@ -101,3 +104,13 @@ function clean_youtube_allow_fullscreen($youtube)
return $youtube;
}
}
if (!function_exists('youtube_image_thumbnail')) {
function youtube_image_thumbnail($id, $filename = 'hqdefault.jpg')
{
if (empty($id)) {
return $id;
}

return 'https://i.ytimg.com/vi/' . trim($id) . '/' . trim($filename);
}
}
4 changes: 2 additions & 2 deletions src/BaseHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
*/
class BaseHelper
{
const VERSION = '1.5.0';
const LAST_MODIFIED = '2023-08-07';
const VERSION = '1.5.1';
const LAST_MODIFIED = '2023-08-10';
const PROJECT_NAME = 'CodeIgniter - Basic Helper';
const AUTHOR_NAME = 'Hung Nguyen';
const AUTHOR_FULL_NAME = 'Hung Nguyen';
Expand Down

0 comments on commit 5e0a541

Please sign in to comment.