diff --git a/bl-kernel/admin/views/settings.php b/bl-kernel/admin/views/settings.php index 0f2d6022..a7500e70 100644 --- a/bl-kernel/admin/views/settings.php +++ b/bl-kernel/admin/views/settings.php @@ -334,6 +334,19 @@ echo Bootstrap::formInputHidden(array( 'disabled' => Text::isEmpty($site->uriFilters('blog')) )); + echo Bootstrap::cardEnd(); + + echo Bootstrap::cardBegin($L->g('Ping Search Engine')); + + echo Bootstrap::formSelect(array( + 'name' => 'pingSearchEngine', + 'label' => $L->g('Ping Search Engine'), + 'options' => array('true' => $L->g('Enabled'), 'false' => $L->g('Disabled')), + 'selected' => ($site->pingSearchEngine() ? 'true' : 'false'), + 'class' => '', + 'tip' => $L->g('notifies-google-when-you-created') + )); + echo Bootstrap::cardEnd(); ?> diff --git a/bl-kernel/site.class.php b/bl-kernel/site.class.php index d340895b..177e5c67 100644 --- a/bl-kernel/site.class.php +++ b/bl-kernel/site.class.php @@ -27,6 +27,7 @@ class Site extends dbJSON 'dateFormat' => 'F j, Y', 'timeFormat' => 'g:i a', 'currentBuild' => 0, + 'pingSearchEngine' => false, 'twitter' => '', 'facebook' => '', 'codepen' => '', @@ -181,6 +182,11 @@ class Site extends dbJSON return $this->getField('markdownParser'); } + public function pingSearchEngine() + { + return $this->getField('pingSearchEngine'); + } + public function twitter() { return $this->getField('twitter'); diff --git a/bl-plugins/sitemap/languages/da.json b/bl-modules/sitemap/languages/da.json similarity index 100% rename from bl-plugins/sitemap/languages/da.json rename to bl-modules/sitemap/languages/da.json diff --git a/bl-plugins/sitemap/languages/de_CH.json b/bl-modules/sitemap/languages/de_CH.json similarity index 100% rename from bl-plugins/sitemap/languages/de_CH.json rename to bl-modules/sitemap/languages/de_CH.json diff --git a/bl-plugins/sitemap/languages/de_DE.json b/bl-modules/sitemap/languages/de_DE.json similarity index 100% rename from bl-plugins/sitemap/languages/de_DE.json rename to bl-modules/sitemap/languages/de_DE.json diff --git a/bl-modules/sitemap/languages/en.json b/bl-modules/sitemap/languages/en.json new file mode 100644 index 00000000..b5391396 --- /dev/null +++ b/bl-modules/sitemap/languages/en.json @@ -0,0 +1,11 @@ +{ + "plugin-data": + { + "name": "Sitemap", + "description": "This plugin generates a sitemap.xml file, which provides the list of pages on your website, this helps search engines organize and filter content from their website." + }, + "sitemap-url": "Sitemap URL", + "notifies-google-when-you-created": "Notifies Google/Bing when you created, modified or deleted content from your site.", + "notifies-bing-when-you-created": "Notifies Google/Bing when you created, modified or deleted content from your site.", + "ping-search-engine": "Ping Search Engines" +} diff --git a/bl-plugins/sitemap/languages/es.json b/bl-modules/sitemap/languages/es.json similarity index 100% rename from bl-plugins/sitemap/languages/es.json rename to bl-modules/sitemap/languages/es.json diff --git a/bl-plugins/sitemap/languages/fa_IR.json b/bl-modules/sitemap/languages/fa_IR.json similarity index 100% rename from bl-plugins/sitemap/languages/fa_IR.json rename to bl-modules/sitemap/languages/fa_IR.json diff --git a/bl-plugins/sitemap/languages/fr_FR.json b/bl-modules/sitemap/languages/fr_FR.json similarity index 58% rename from bl-plugins/sitemap/languages/fr_FR.json rename to bl-modules/sitemap/languages/fr_FR.json index b9a9c6ce..cf8bfc66 100644 --- a/bl-plugins/sitemap/languages/fr_FR.json +++ b/bl-modules/sitemap/languages/fr_FR.json @@ -5,6 +5,7 @@ "description": "Ce plugin génère un fichier sitemap.xml, qui fournit la liste des pages de votre site, ce qui aide les moteurs de recherche à organiser et filtrer le contenu de votre site." }, "sitemap-url": "URL de votre sitemap.", - "notifies-google-when-you-created": "Notifie à Google lorsque vous avez créé, modifié ou supprimé du contenu sur votre site.", - "notifies-bing-when-you-created": "Notifie Bing lorsque vous avez créé, modifié ou supprimé du contenu sur votre site." + "notifies-google-when-you-created": "Notifie à Google/Bing lorsque vous avez créé, modifié ou supprimé du contenu sur votre site.", + "notifies-bing-when-you-created": "Notifie Google/Bing lorsque vous avez créé, modifié ou supprimé du contenu sur votre site.", + "ping-search-engine": "Ping moteurs de recherche" } diff --git a/bl-plugins/sitemap/languages/it.json b/bl-modules/sitemap/languages/it.json similarity index 100% rename from bl-plugins/sitemap/languages/it.json rename to bl-modules/sitemap/languages/it.json diff --git a/bl-plugins/sitemap/languages/ja_JP.json b/bl-modules/sitemap/languages/ja_JP.json similarity index 52% rename from bl-plugins/sitemap/languages/ja_JP.json rename to bl-modules/sitemap/languages/ja_JP.json index 56af2a7c..adb3168d 100644 --- a/bl-plugins/sitemap/languages/ja_JP.json +++ b/bl-modules/sitemap/languages/ja_JP.json @@ -5,6 +5,6 @@ "description": "This plugin generates a sitemap.xml file, which provides the list of pages on your website, this helps search engines organize and filter content from their website." }, "sitemap-url": "Sitemap URL", - "notifies-google-when-you-created": "Notifies Google when you created, modified or deleted content from your site.", - "notifies-bing-when-you-created": "Notifies Bing when you created, modified or deleted content from your site." + "notifies-google-when-you-created": "Notifies Google/Bing when you created, modified or deleted content from your site.", + "notifies-bing-when-you-created": "Notifies Google/Bing when you created, modified or deleted content from your site." } diff --git a/bl-plugins/sitemap/languages/nl_NL.json b/bl-modules/sitemap/languages/nl_NL.json similarity index 50% rename from bl-plugins/sitemap/languages/nl_NL.json rename to bl-modules/sitemap/languages/nl_NL.json index 923baef9..4ca30c8a 100644 --- a/bl-plugins/sitemap/languages/nl_NL.json +++ b/bl-modules/sitemap/languages/nl_NL.json @@ -5,6 +5,6 @@ "description": "Deze plugin genereert het bestand sitemap.xml met daarin de structuur van deze website. Zoekmachines kunnen hiervan gebruikmaken bij het organiseren en filteren van de inhoud." }, "sitemap-url": "URL sitemap", - "notifies-google-when-you-created": "Stel Google op de hoogte bij het aanmaken, bewerken of verwijderen van inhoud op de website.", - "notifies-bing-when-you-created": "Stel Bing op de hoogte bij het aanmaken, bewerken of verwijderen van inhoud op de website." + "notifies-google-when-you-created": "Stel Google/Bing op de hoogte bij het aanmaken, bewerken of verwijderen van inhoud op de website.", + "notifies-bing-when-you-created": "Stel Google/Bing op de hoogte bij het aanmaken, bewerken of verwijderen van inhoud op de website." } diff --git a/bl-plugins/sitemap/languages/ru_RU.json b/bl-modules/sitemap/languages/ru_RU.json similarity index 100% rename from bl-plugins/sitemap/languages/ru_RU.json rename to bl-modules/sitemap/languages/ru_RU.json diff --git a/bl-plugins/sitemap/languages/tr.json b/bl-modules/sitemap/languages/tr.json similarity index 100% rename from bl-plugins/sitemap/languages/tr.json rename to bl-modules/sitemap/languages/tr.json diff --git a/bl-plugins/sitemap/languages/uk_UA.json b/bl-modules/sitemap/languages/uk_UA.json similarity index 100% rename from bl-plugins/sitemap/languages/uk_UA.json rename to bl-modules/sitemap/languages/uk_UA.json diff --git a/bl-plugins/sitemap/metadata.json b/bl-modules/sitemap/metadata.json similarity index 100% rename from bl-plugins/sitemap/metadata.json rename to bl-modules/sitemap/metadata.json diff --git a/bl-plugins/sitemap/plugin.php b/bl-modules/sitemap/plugin.php similarity index 56% rename from bl-plugins/sitemap/plugin.php rename to bl-modules/sitemap/plugin.php index 753264bd..19d01d93 100644 --- a/bl-plugins/sitemap/plugin.php +++ b/bl-modules/sitemap/plugin.php @@ -2,45 +2,6 @@ class pluginSitemap extends Plugin { - public function init() - { - $this->dbFields = array( - 'pingGoogle'=>false, - 'pingBing'=>false - ); - } - - // Method called on the settings of the plugin on the admin area - public function form() - { - global $L; - - $html = '
'; - $html .= ''; - $html .= ''.Theme::sitemapUrl().''; - $html .= '
'; - - $html .= '
'; - $html .= ''; - $html .= ''; - $html .= ''.$L->get('notifies-google-when-you-created').''; - $html .= '
'; - - $html .= '
'; - $html .= ''; - $html .= ''; - $html .= ''.$L->get('notifies-bing-when-you-created').''; - $html .= '
'; - - return $html; - } - private function createXML() { global $site; @@ -80,14 +41,13 @@ class pluginSitemap extends Plugin { private function ping() { - if ($this->getValue('pingGoogle')) { - $url = 'https://www.google.com/ping?sitemap='.Theme::sitemapUrl(); - TCP::http($url, 'GET', true, 3); - } + global $site; + if ($site->pingSearchEngine()) { + $urlGoogle = 'https://www.google.com/ping?sitemap='.Theme::sitemapUrl(); + $urlBing = 'https://www.bing.com/ping?sitemap='.Theme::sitemapUrl(); - if ($this->getValue('pingBing')) { - $url = 'https://www.bing.com/ping?sitemap='.Theme::sitemapUrl(); - TCP::http($url, 'GET', true, 3); + TCP::http($urlGoogle, 'GET', true, 3); + TCP::http($urlBing, 'GET', true, 3); } } diff --git a/bl-plugins/sitemap/languages/en.json b/bl-plugins/sitemap/languages/en.json deleted file mode 100644 index 56af2a7c..00000000 --- a/bl-plugins/sitemap/languages/en.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "plugin-data": - { - "name": "Sitemap", - "description": "This plugin generates a sitemap.xml file, which provides the list of pages on your website, this helps search engines organize and filter content from their website." - }, - "sitemap-url": "Sitemap URL", - "notifies-google-when-you-created": "Notifies Google when you created, modified or deleted content from your site.", - "notifies-bing-when-you-created": "Notifies Bing when you created, modified or deleted content from your site." -}