aboutsummaryrefslogtreecommitdiffstats
path: root/install.php
diff options
context:
space:
mode:
authorplegall <plg@piwigo.org>2010-12-27 01:47:29 +0000
committerplegall <plg@piwigo.org>2010-12-27 01:47:29 +0000
commit5382fb218c2494a63e3971305d9ee010e7d7b737 (patch)
tree7661eb6a930574eaa526f831d0991a2f84d60f82 /install.php
parent4bfcf8fdc1f44e6989799408581398c11789241d (diff)
feature 2087 added: use a checkbox in the installation screen for newsletter subscription
git-svn-id: http://piwigo.org/svn/trunk@8311 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r--install.php23
1 files changed, 18 insertions, 5 deletions
diff --git a/install.php b/install.php
index b8707655c..5850e9180 100644
--- a/install.php
+++ b/install.php
@@ -143,6 +143,12 @@ $admin_pass1 = (!empty($_POST['admin_pass1'])) ? $_POST['admin_pass1'] : '';
$admin_pass2 = (!empty($_POST['admin_pass2'])) ? $_POST['admin_pass2'] : '';
$admin_mail = (!empty($_POST['admin_mail'])) ? $_POST['admin_mail'] : '';
+$is_newsletter_subscribe = true;
+if (isset($_POST['install']))
+{
+ $is_newsletter_subscribe = isset($_POST['newsletter_subscribe']);
+}
+
$infos = array();
$errors = array();
@@ -381,6 +387,16 @@ INSERT INTO '.$prefixeTable.'config (param,value,comment)
array_keys($datas[0]),
$datas
);
+
+ if ($is_newsletter_subscribe)
+ {
+ fetchRemote(
+ get_newsletter_subscribe_base_url($language).$admin_mail,
+ $result,
+ array(),
+ array('origin' => 'installation')
+ );
+ }
}
}
@@ -410,6 +426,8 @@ $template->assign(
'F_DB_PREFIX' => $prefixeTable,
'F_ADMIN' => $admin_name,
'F_ADMIN_EMAIL' => $admin_mail,
+ 'EMAIL' => '<span class="adminEmail">'.$admin_mail.'</span>',
+ 'F_NEWSLETTER_SUBSCRIBE' => $is_newsletter_subscribe,
'L_INSTALL_HELP' => sprintf(l10n('Need help ? Ask your question on <a href="%s">Piwigo message board</a>.'), PHPWG_URL.'/forum'),
));
@@ -450,11 +468,6 @@ else
$user = build_user(1, true);
log_user($user['id'], false);
}
-
- $template->assign(
- 'SUBSCRIBE_BASE_URL',
- get_newsletter_subscribe_base_url($language)
- );
}
if (count($errors) != 0)
{