Skip to content

Commit 5e0a541

Browse files
authored
Merge pull request #36 from nguyenanhung/develop
Update Project at Thu Aug 10 14:46:52 +07 2023
2 parents b124fe7 + 81e83b0 commit 5e0a541

3 files changed

Lines changed: 25 additions & 11 deletions

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,7 @@ Hiện tại việc sử dụng nanoid đang là xu hướng so với uuid truy
339339
- [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)
340340
- [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)
341341
- [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)
342+
- [x] Helper Function: `youtube_image_thumbnail` - Convert YoutubeID to Youtube Thumbnail URL
342343

343344
### XML Helper
344345

helpers/video_embed_helper.php

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,10 @@ function convert_video_embed_vimeo($vimeo)
2727
}
2828
if (!function_exists('convert_video_embed_dailymotion')) {
2929
function convert_video_embed_dailymotion($dailymotion)
30-
{if (empty($dailymotion)) {
31-
return $dailymotion;
32-
}
30+
{
31+
if (empty($dailymotion)) {
32+
return $dailymotion;
33+
}
3334
$dailymotion = str_replace(
3435
array(
3536
'https://www.dailymotion.com/video/',
@@ -44,9 +45,10 @@ function convert_video_embed_dailymotion($dailymotion)
4445
}
4546
if (!function_exists('convert_video_v_embed_youtube')) {
4647
function convert_video_v_embed_youtube($youtube)
47-
{if (empty($youtube)) {
48-
return $youtube;
49-
}
48+
{
49+
if (empty($youtube)) {
50+
return $youtube;
51+
}
5052
$youtube = str_replace(
5153
array(
5254
'https://www.youtube.com/watch?v=',
@@ -63,9 +65,10 @@ function convert_video_v_embed_youtube($youtube)
6365
}
6466
if (!function_exists('convert_video_embed_youtube')) {
6567
function convert_video_embed_youtube($youtube)
66-
{if (empty($youtube)) {
67-
return $youtube;
68-
}
68+
{
69+
if (empty($youtube)) {
70+
return $youtube;
71+
}
6972
$youtube = str_replace(
7073
array(
7174
'https://www.youtube.com/watch?v=',
@@ -101,3 +104,13 @@ function clean_youtube_allow_fullscreen($youtube)
101104
return $youtube;
102105
}
103106
}
107+
if (!function_exists('youtube_image_thumbnail')) {
108+
function youtube_image_thumbnail($id, $filename = 'hqdefault.jpg')
109+
{
110+
if (empty($id)) {
111+
return $id;
112+
}
113+
114+
return 'https://i.ytimg.com/vi/' . trim($id) . '/' . trim($filename);
115+
}
116+
}

src/BaseHelper.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
*/
2020
class BaseHelper
2121
{
22-
const VERSION = '1.5.0';
23-
const LAST_MODIFIED = '2023-08-07';
22+
const VERSION = '1.5.1';
23+
const LAST_MODIFIED = '2023-08-10';
2424
const PROJECT_NAME = 'CodeIgniter - Basic Helper';
2525
const AUTHOR_NAME = 'Hung Nguyen';
2626
const AUTHOR_FULL_NAME = 'Hung Nguyen';

0 commit comments

Comments
 (0)