From 32a24fefc9aece305d244933ec9e3272978193bc Mon Sep 17 00:00:00 2001 From: plegall Date: Sun, 31 May 2009 19:35:51 +0000 Subject: [PATCH] feature 1020 added: ability to subscribe to Piwigo Announcement Newsletter from Piwigo itself. Admins can perform this action at the end of installation or on administration panel index. git-svn-id: http://piwigo.org/svn/branches/2.0@3381 68402e56-0260-453c-a942-63ccdbb3a9ee --- admin/include/functions.php | 9 +++++++++ admin/intro.php | 9 +++++++++ admin/template/goto/install.tpl | 13 +++++++++++-- admin/template/goto/intro.tpl | 16 ++++++++++++++++ include/config_default.inc.php | 3 +++ install.php | 5 +++++ language/en_UK/admin.lang.php | 5 +++++ language/fr_FR/admin.lang.php | 6 ++++++ 8 files changed, 64 insertions(+), 2 deletions(-) diff --git a/admin/include/functions.php b/admin/include/functions.php index 6f41aafba..88505ca5c 100644 --- a/admin/include/functions.php +++ b/admin/include/functions.php @@ -2114,4 +2114,13 @@ SELECT '.$conf['user_fields']['username'].' return $username; } + +function get_newsletter_subscribe_base_url($language) { + $subscribe_domain = 'piwigo.org'; + if ('fr_FR' == $language) { + $subscribe_domain = 'fr.piwigo.org'; + } + + return 'http://'.$subscribe_domain.'/announcement/subscribe.php?email='; +} ?> \ No newline at end of file diff --git a/admin/intro.php b/admin/intro.php index 98ee92f26..d2549b5db 100644 --- a/admin/intro.php +++ b/admin/intro.php @@ -115,6 +115,15 @@ else if (isset($_GET['action']) and 'phpinfo' == $_GET['action']) $template->set_filenames(array('intro' => 'intro.tpl')); +if ($conf['show_newsletter_subscription']) { + $template->assign( + array( + 'EMAIL' => $user['email'], + 'SUBSCRIBE_BASE_URL' => get_newsletter_subscribe_base_url($user['language']), + ) + ); +} + $php_current_timestamp = date("Y-m-d H:i:s"); list($mysql_version, $db_current_timestamp) = mysql_fetch_row(pwg_query('SELECT VERSION(), CURRENT_TIMESTAMP;')); diff --git a/admin/template/goto/install.tpl b/admin/template/goto/install.tpl index d7f6bd82f..e6bbce53c 100644 --- a/admin/template/goto/install.tpl +++ b/admin/template/goto/install.tpl @@ -149,8 +149,17 @@ TD { {else}


- - + +

+ +
+ +
+ +

+

{/if} {* content *} diff --git a/admin/template/goto/intro.tpl b/admin/template/goto/intro.tpl index 3df354993..3ea7b2ac5 100644 --- a/admin/template/goto/intro.tpl +++ b/admin/template/goto/intro.tpl @@ -1,4 +1,17 @@ {* $Id$ *} +{known_script id="jquery" src=$ROOT_URL|@cat:"template-common/lib/jquery.packed.js"} +{known_script id="jquery.dimensions" src=$ROOT_URL|@cat:"template-common/lib/plugins/jquery.dimensions.packed.js"} +{known_script id="jquery.cluetip" src=$ROOT_URL|@cat:"template-common/lib/plugins/jquery.cluetip.packed.js"} + + +

{'title_default'|@translate}

{'Piwigo version'|@translate}
@@ -7,6 +20,9 @@
  • Piwigo {$PWG_VERSION}
  • {'Check for upgrade'|@translate}
  • +{if isset($SUBSCRIBE_BASE_URL)} +
  • {'Subscribe %s to Piwigo Announcements Newsletter'|@translate|@sprintf:$EMAIL}
  • +{/if} diff --git a/include/config_default.inc.php b/include/config_default.inc.php index f44bcd7b8..5857d7fa1 100644 --- a/include/config_default.inc.php +++ b/include/config_default.inc.php @@ -657,6 +657,9 @@ $conf['allow_web_services'] = true; // Maximum number of images to be returned foreach call to the web service $conf['ws_max_images_per_page'] = 500; +// Display a link to subscribe to Piwigo Announcements Newsletter +$conf['show_newsletter_subscription'] = true; + // +-----------------------------------------------------------------------+ // | Filter | // +-----------------------------------------------------------------------+ diff --git a/install.php b/install.php index e7c630de8..67691c019 100644 --- a/install.php +++ b/install.php @@ -421,6 +421,11 @@ else { array_push($errors, $error_copy); } + + $template->assign( + 'SUBSCRIBE_BASE_URL', + get_newsletter_subscribe_base_url($language) + ); } if (count($errors) != 0) { diff --git a/language/en_UK/admin.lang.php b/language/en_UK/admin.lang.php index 90e6780f8..ce83cebbf 100644 --- a/language/en_UK/admin.lang.php +++ b/language/en_UK/admin.lang.php @@ -647,4 +647,9 @@ $lang['Bound template'] = 'Bound template'; $lang['Downloads'] = 'Downloads'; $lang['Released on'] = 'Released on'; $lang['Number of downloads'] = 'Number of downloads'; +// --------- Starting below: New or revised $lang ---- from Colibri +$lang['Piwigo Announcements Newsletter'] = 'Piwigo Announcements Newsletter'; +$lang['Subscribe to Piwigo Announcements Newsletter'] = 'Keep in touch with Piwigo project, subscribe to Piwigo Announcement Newsletter. You will receive emails when a new release is available (sometimes including a security bug fix, it\'s important to know and upgrade) and when major events happen to the project. Only a few emails a year.'; +$lang['Subscribe %s'] = 'Subscribe %s'; +$lang['Subscribe %s to Piwigo Announcements Newsletter'] = 'Subscribe %s to Piwigo Announcements Newsletter'; ?> diff --git a/language/fr_FR/admin.lang.php b/language/fr_FR/admin.lang.php index 217490f7a..21df31cb4 100644 --- a/language/fr_FR/admin.lang.php +++ b/language/fr_FR/admin.lang.php @@ -646,4 +646,10 @@ $lang['Bound template'] = 'Template rattaché'; $lang['Downloads'] = 'Téléchargements'; $lang['Released on'] = 'Ajouté le'; $lang['Number of downloads'] = 'Nombre de téléchargements'; +// --------- Starting below: New or revised $lang ---- from Colibri +$lang['Piwigo Announcements Newsletter'] = 'Newsletter Piwigo'; +$lang['Subscribe to Piwigo Announcements Newsletter'] = 'Restez en contact avec le projet Piwigo, abonnez-vous à la newsletter. Vous recevrez un email lorsqu\'une nouvelle version sera disponible (parfois un bug de sécurité est corrigé, il est important d\'être au courant et de mettre à jour) ou qu\'un événement majeur surviendra sur le projet. Seulement quelques messages par an.'; +$lang['Subscribe %s'] = 'Abonner %s'; +$lang['Subscribe %s to Piwigo Announcements Newsletter'] = 'Abonner %s à la newsletter Piwigo'; + ?>