diff --git a/bl-kernel/boot/init.php b/bl-kernel/boot/init.php index 06644836..ddd10687 100644 --- a/bl-kernel/boot/init.php +++ b/bl-kernel/boot/init.php @@ -106,6 +106,7 @@ include(PATH_KERNEL . 'url.class.php'); include(PATH_KERNEL . 'login.class.php'); include(PATH_KERNEL . 'parsedown.class.php'); include(PATH_KERNEL . 'security.class.php'); +include(PATH_KERNEL . 'social.class.php'); // Include functions include(PATH_KERNEL . 'functions.php'); diff --git a/bl-kernel/helpers/theme.class.php b/bl-kernel/helpers/theme.class.php index 990141bb..2835b4e1 100644 --- a/bl-kernel/helpers/theme.class.php +++ b/bl-kernel/helpers/theme.class.php @@ -20,6 +20,22 @@ class Theme return $GLOBALS['SOCIAL_NETWORKS_EMOJI'][Text::cleanUrl($socialNetwork)]; } + public static function listSiteSocials($list = true, $emoji = false) { + global $site; + $socialList = Theme::socialNetworks(); + + $socialString = ($list == true) ? "
" : ""); + return $socialString; + } + public static function title() { global $site; diff --git a/bl-kernel/social.class.php b/bl-kernel/social.class.php new file mode 100644 index 00000000..ea57b883 --- /dev/null +++ b/bl-kernel/social.class.php @@ -0,0 +1,22 @@ +name = $name; + $this->slug = Text::cleanUrl($name); + $this->emoji = $GLOBALS['SOCIAL_NETWORKS_EMOJI'][$this->slug]; + $this->url = $url; + } + + function getLink($useEmoji = false) { + return "".($useEmoji ? ' " : ""). " " . $this->name.""; + } + +} \ No newline at end of file diff --git a/bl-plugins/socials/languages/en.json b/bl-plugins/socials/languages/en.json new file mode 100644 index 00000000..0b8c8ded --- /dev/null +++ b/bl-plugins/socials/languages/en.json @@ -0,0 +1,7 @@ +{ + "plugin-data": + { + "name": "Social Networks", + "description": "Shows the social network list in the sidebar." + } +} diff --git a/bl-plugins/socials/languages/fr_FR.json b/bl-plugins/socials/languages/fr_FR.json new file mode 100644 index 00000000..c815606c --- /dev/null +++ b/bl-plugins/socials/languages/fr_FR.json @@ -0,0 +1,7 @@ +{ + "plugin-data": + { + "name": "Réseaux sociaux", + "description": "Affiche la liste des réseaux sociaux dans la barre latérale." + } +} diff --git a/bl-plugins/socials/metadata.json b/bl-plugins/socials/metadata.json new file mode 100644 index 00000000..891c2ded --- /dev/null +++ b/bl-plugins/socials/metadata.json @@ -0,0 +1,11 @@ +{ + "author": "Koblog", + "email": "", + "website": "https://plugins.koblog.com", + "version": "kb_0.0.1", + "releaseDate": "2024-08-23", + "license": "MIT", + "compatible": "kb_0.0.1", + "notes": "", + "type": "widget" +} diff --git a/bl-plugins/socials/plugin.php b/bl-plugins/socials/plugin.php new file mode 100644 index 00000000..44a533e7 --- /dev/null +++ b/bl-plugins/socials/plugin.php @@ -0,0 +1,40 @@ +dbFields = array( + 'label' => 'Social Networks', + ); + } + + public function form() + { + global $L; + + $html = '