From 425fafe587594190633cded747f7afe7b7cb7c6c Mon Sep 17 00:00:00 2001 From: kingmath Date: Sat, 30 Jan 2021 18:40:11 +0100 Subject: [PATCH] Add YouTube Add YouTube in Social Networks. --- bl-kernel/admin/views/edit-user.php | 9 +++++++++ bl-kernel/admin/views/settings.php | 9 +++++++++ bl-kernel/helpers/theme.class.php | 3 ++- bl-kernel/site.class.php | 6 ++++++ bl-kernel/user.class.php | 6 ++++++ bl-themes/alternative/img/youtube.svg | 7 +++++++ bl-themes/blogx/img/youtube.svg | 7 +++++++ install.php | 4 +++- 8 files changed, 49 insertions(+), 2 deletions(-) create mode 100644 bl-themes/alternative/img/youtube.svg create mode 100644 bl-themes/blogx/img/youtube.svg diff --git a/bl-kernel/admin/views/edit-user.php b/bl-kernel/admin/views/edit-user.php index ab46a39e..25ed2254 100644 --- a/bl-kernel/admin/views/edit-user.php +++ b/bl-kernel/admin/views/edit-user.php @@ -285,6 +285,15 @@ 'placeholder'=>'', 'tip'=>'' )); + + echo Bootstrap::formInputText(array( + 'name'=>'youtube', + 'label'=>'YouTube', + 'value'=>$user->youtube(), + 'class'=>'', + 'placeholder'=>'', + 'tip'=>'' + )); ?> diff --git a/bl-kernel/admin/views/settings.php b/bl-kernel/admin/views/settings.php index b0ff9031..edd1897c 100644 --- a/bl-kernel/admin/views/settings.php +++ b/bl-kernel/admin/views/settings.php @@ -437,6 +437,15 @@ 'placeholder'=>'', 'tip'=>'' )); + + echo Bootstrap::formInputText(array( + 'name'=>'youtube', + 'label'=>'YouTube', + 'value'=>$site->youtube(), + 'class'=>'', + 'placeholder'=>'', + 'tip'=>'' + )); ?> diff --git a/bl-kernel/helpers/theme.class.php b/bl-kernel/helpers/theme.class.php index 3498f775..a5a66342 100644 --- a/bl-kernel/helpers/theme.class.php +++ b/bl-kernel/helpers/theme.class.php @@ -15,7 +15,8 @@ class Theme { 'linkedin'=>'Linkedin', 'xing'=>'Xing', 'mastodon'=>'Mastodon', - 'vk'=>'VK' + 'vk'=>'VK', + 'youtube'=>'YouTube' ); foreach ($socialNetworks as $key=>$label) { diff --git a/bl-kernel/site.class.php b/bl-kernel/site.class.php index 11285f82..99e4e6bc 100644 --- a/bl-kernel/site.class.php +++ b/bl-kernel/site.class.php @@ -34,6 +34,7 @@ class Site extends dbJSON { 'mastodon'=> '', 'dribbble'=> '', 'vk'=> '', + 'youtube'=> '', 'orderBy'=> 'date', // date or position 'extremeFriendly'=> true, 'autosaveInterval'=> 2, // minutes @@ -203,6 +204,11 @@ class Site extends dbJSON { { return $this->getField('vk'); } + + public function youtube() + { + return $this->getField('youtube'); + } public function orderBy() { diff --git a/bl-kernel/user.class.php b/bl-kernel/user.class.php index e737c5da..0f3b0713 100644 --- a/bl-kernel/user.class.php +++ b/bl-kernel/user.class.php @@ -154,6 +154,11 @@ class User { { return $this->getValue('vk'); } + + public function youtube() + { + return $this->getValue('youtube'); + } public function profilePicture() { @@ -181,6 +186,7 @@ class User { $tmp['xing'] = $this->xing(); $tmp['mastodon'] = $this->mastodon(); $tmp['vk'] = $this->vk(); + $tmp['youtube'] = $this->youtube(); $tmp['profilePicture'] = $this->profilePicture(); if ($returnsArray) { diff --git a/bl-themes/alternative/img/youtube.svg b/bl-themes/alternative/img/youtube.svg new file mode 100644 index 00000000..155c153d --- /dev/null +++ b/bl-themes/alternative/img/youtube.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/bl-themes/blogx/img/youtube.svg b/bl-themes/blogx/img/youtube.svg new file mode 100644 index 00000000..155c153d --- /dev/null +++ b/bl-themes/blogx/img/youtube.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/install.php b/install.php index df196784..7c378896 100644 --- a/install.php +++ b/install.php @@ -394,6 +394,7 @@ function install($adminPassword, $timezone) 'gitlab'=>'', 'linkedin'=>'', 'xing'=>'', + 'youtube'=>'', 'dateFormat'=>'F j, Y', 'extremeFriendly'=>true, 'autosaveInterval'=>2, @@ -431,7 +432,8 @@ function install($adminPassword, $timezone) 'linkedin'=>'', 'xing'=>'', 'github'=>'', - 'gitlab'=>'' + 'gitlab'=>'', + 'youtube'=>'' ) ); file_put_contents(PATH_DATABASES.'users.php', $dataHead.json_encode($data, JSON_PRETTY_PRINT), LOCK_EX);