diff options
author | plegall <plg@piwigo.org> | 2009-05-31 19:35:51 +0000 |
---|---|---|
committer | plegall <plg@piwigo.org> | 2009-05-31 19:35:51 +0000 |
commit | 32a24fefc9aece305d244933ec9e3272978193bc (patch) | |
tree | 2bf5bb132364eef99915d32c88c6f7e9d374349a /admin | |
parent | e486b3c79af80356ce85afe8fed47ee4a554a83f (diff) |
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
Diffstat (limited to '')
-rw-r--r-- | admin/include/functions.php | 9 | ||||
-rw-r--r-- | admin/intro.php | 9 | ||||
-rw-r--r-- | admin/template/goto/install.tpl | 13 | ||||
-rw-r--r-- | admin/template/goto/intro.tpl | 16 |
4 files changed, 45 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} <p> <br /> - <input type="button" name="index" value="{'home'|@translate}" onClick="document.location = 'index.php';"/> - <input type="button" name="identification" value="{'Identification'|@translate}" onClick="document.location = 'identification.php';"/> + <input type="button" name="identification" value="{'Identification'|@translate}" onClick="window.open('identification.php');"/> +</p> + +<div class="infos"> + <ul> + <li>{'Subscribe to Piwigo Announcements Newsletter'|@translate}</li> + </ul> +</div> + +<p> + <input type="button" name="subscribe" value="{'Subscribe %s'|@translate|@sprintf:$F_ADMIN_EMAIL}" onClick="window.open('{$SUBSCRIBE_BASE_URL}{$F_ADMIN_EMAIL}');"/> </p> {/if} </div> {* 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"} + +<script type="text/javascript"> +jQuery().ready(function(){ldelim} + jQuery('.cluetip').cluetip({ldelim} + width: 300, + splitTitle: '|' + }); +}); +</script> + <h2>{'title_default'|@translate}</h2> <dl style="padding-top: 30px;"> <dt>{'Piwigo version'|@translate}</dt> @@ -7,6 +20,9 @@ <li><a href="{$PHPWG_URL}" onclick="window.open(this.href, ''); return false;">Piwigo</a> {$PWG_VERSION}</li> <li><a href="{$U_CHECK_UPGRADE}">{'Check for upgrade'|@translate}</a></li> +{if isset($SUBSCRIBE_BASE_URL)} + <li><a href="{$SUBSCRIBE_BASE_URL}{$EMAIL}" onclick="window.open(this.href); return false;" class="cluetip" title="{'Piwigo Announcements Newsletter'|@translate}|{'Subscribe to Piwigo Announcements Newsletter'|@translate|htmlspecialchars|nl2br}">{'Subscribe %s to Piwigo Announcements Newsletter'|@translate|@sprintf:$EMAIL}</a></li> +{/if} </ul> </dd> |