summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfisharebest <fisharebest@gmail.com>2010-05-04 20:29:41 +0000
committerfisharebest <fisharebest@gmail.com>2010-05-04 20:29:41 +0000
commit469c7ceb8a9e6078b0040397fc1e3e325e814bc0 (patch)
treec67d6fb9a98f5ca08493cd7f50efda5f8641884b
parent305665dec88b838f590e667e15211ff15233214b (diff)
downloadwebtrees-469c7ceb8a9e6078b0040397fc1e3e325e814bc0.tar.gz
webtrees-469c7ceb8a9e6078b0040397fc1e3e325e814bc0.tar.bz2
webtrees-469c7ceb8a9e6078b0040397fc1e3e325e814bc0.zip
#574754
New install has no contact links displayed in footer
-rw-r--r--config_gedcom.php6
-rw-r--r--editconfig_gedcom.php62
-rw-r--r--help_text.php4
-rw-r--r--includes/functions/functions_print.php44
-rw-r--r--includes/set_gedcom_defaults.php2
5 files changed, 36 insertions, 82 deletions
diff --git a/config_gedcom.php b/config_gedcom.php
index 69071061d4..a457f41930 100644
--- a/config_gedcom.php
+++ b/config_gedcom.php
@@ -126,10 +126,8 @@ $GEDCOM_DEFAULT_TAB = "personal_facts"; //-- this setting controls which tab
$SHOW_CONTEXT_HELP = true; // show ? links on the page for contextual popup help
$WEBTREES_EMAIL = ""; // -- "From:" address for automatically generated e-mails
-$CONTACT_EMAIL = "you@yourdomain.com"; // -- this is who the user should contact for more information
-$CONTACT_METHOD = "messaging2"; // -- the method to allow users to contact you. options are: mailto, messaging, messaging2
-$WEBMASTER_EMAIL = "webmaster@yourdomain.com"; // -- this is who the user should contact in case of errors
-$SUPPORT_METHOD = "messaging2"; // -- the method to allow users to contact you. options are: mailto, messaging, messaging2
+$CONTACT_USER_ID = 1; // -- this is who the user should contact for more information
+$WEBMASTER_USER_ID = 1; // -- this is who the user should contact in case of errors
$HOME_SITE_URL = "http://webtrees.net"; // -- url for your home page
$HOME_SITE_TEXT = "webtrees"; // -- name of your site
$SHOW_FACT_ICONS = true; //-- Show Fact icons on Indi page
diff --git a/editconfig_gedcom.php b/editconfig_gedcom.php
index 97008ed535..5ccdc6a191 100644
--- a/editconfig_gedcom.php
+++ b/editconfig_gedcom.php
@@ -129,8 +129,7 @@ if (safe_POST('action')=='update') {
$configtext = preg_replace('/\$COMMON_NAMES_ADD\s*=\s*".*";/', "\$COMMON_NAMES_ADD = \"".$_POST["NEW_COMMON_NAMES_ADD"]."\";", $configtext);
$configtext = preg_replace('/\$COMMON_NAMES_REMOVE\s*=\s*".*";/', "\$COMMON_NAMES_REMOVE = \"".$_POST["NEW_COMMON_NAMES_REMOVE"]."\";", $configtext);
$configtext = preg_replace('/\$COMMON_NAMES_THRESHOLD\s*=\s*".*";/', "\$COMMON_NAMES_THRESHOLD = \"".$_POST["NEW_COMMON_NAMES_THRESHOLD"]."\";", $configtext);
- $configtext = preg_replace('/\$CONTACT_EMAIL\s*=\s*".*";/', "\$CONTACT_EMAIL = \"".$_POST["NEW_CONTACT_EMAIL"]."\";", $configtext);
- $configtext = preg_replace('/\$CONTACT_METHOD\s*=\s*".*";/', "\$CONTACT_METHOD = \"".$_POST["NEW_CONTACT_METHOD"]."\";", $configtext);
+ set_gedcom_setting(WT_GED_ID, 'CONTACT_USER_ID', $_POST["NEW_CONTACT_USER_ID"]);
$configtext = preg_replace('/\$DAYS_TO_SHOW_LIMIT\s*=\s*".*";/', "\$DAYS_TO_SHOW_LIMIT = \"".$_POST["NEW_DAYS_TO_SHOW_LIMIT"]."\";", $configtext);
$configtext = preg_replace('/\$DEFAULT_PEDIGREE_GENERATIONS\s*=\s*".*";/', "\$DEFAULT_PEDIGREE_GENERATIONS = \"".$_POST["NEW_DEFAULT_PEDIGREE_GENERATIONS"]."\";", $configtext);
$configtext = preg_replace('/\$DISPLAY_JEWISH_GERESHAYIM\s*=\s*.*;/', "\$DISPLAY_JEWISH_GERESHAYIM = ".$boolarray[$_POST["NEW_DISPLAY_JEWISH_GERESHAYIM"]].";", $configtext);
@@ -224,7 +223,6 @@ if (safe_POST('action')=='update') {
$configtext = preg_replace('/\$SUBLIST_TRIGGER_I\s*=\s*.*;/', "\$SUBLIST_TRIGGER_I = \"".$_POST["NEW_SUBLIST_TRIGGER_I"]."\";", $configtext);
$configtext = preg_replace('/\$SUBLIST_TRIGGER_F\s*=\s*.*;/', "\$SUBLIST_TRIGGER_F = \"".$_POST["NEW_SUBLIST_TRIGGER_F"]."\";", $configtext);
$configtext = preg_replace('/\$SURNAME_LIST_STYLE\s*=\s*.*;/', "\$SURNAME_LIST_STYLE = \"".$_POST["NEW_SURNAME_LIST_STYLE"]."\";", $configtext);
- $configtext = preg_replace('/\$SUPPORT_METHOD\s*=\s*".*";/', "\$SUPPORT_METHOD = \"".$_POST["NEW_SUPPORT_METHOD"]."\";", $configtext);
$configtext = preg_replace('/\$SURNAME_TRADITION\s*=\s*.*;/', "\$SURNAME_TRADITION = \"".$_POST["NEW_SURNAME_TRADITION"]."\";", $configtext);
$configtext = preg_replace('/\$THUMBNAIL_WIDTH\s*=\s*".*";/', "\$THUMBNAIL_WIDTH = \"".$_POST["NEW_THUMBNAIL_WIDTH"]."\";", $configtext);
$configtext = preg_replace('/\$UNDERLINE_NAME_QUOTES\s*=\s*.*;/', "\$UNDERLINE_NAME_QUOTES = ".$boolarray[$_POST["NEW_UNDERLINE_NAME_QUOTES"]].";", $configtext);
@@ -240,7 +238,7 @@ if (safe_POST('action')=='update') {
$configtext = preg_replace('/\$SAVE_WATERMARK_IMAGE\s*=\s*.*;/', "\$SAVE_WATERMARK_IMAGE = ".$boolarray[$_POST["NEW_SAVE_WATERMARK_IMAGE"]].";", $configtext);
$configtext = preg_replace('/\$THEME_DIR\s*=\s*".*";/', "\$THEME_DIR = \"".trim($_POST["NEW_THEME_DIR"])."\";", $configtext);
$configtext = preg_replace('/\$WEBTREES_EMAIL\s*=\s*".*";/', "\$WEBTREES_EMAIL = \"".trim($_POST["NEW_WEBTREES_EMAIL"])."\";", $configtext);
- $configtext = preg_replace('/\$WEBMASTER_EMAIL\s*=\s*".*";/', "\$WEBMASTER_EMAIL = \"".$_POST["NEW_WEBMASTER_EMAIL"]."\";", $configtext);
+ set_gedcom_setting(WT_GED_ID, 'WEBMASTER_USER_ID', $_POST["NEW_WEBMASTER_USER_ID"]);
$configtext = preg_replace('/\$WELCOME_TEXT_AUTH_MODE\s*=\s*".*";/', "\$WELCOME_TEXT_AUTH_MODE = \"".$_POST["NEW_WELCOME_TEXT_AUTH_MODE"]."\";", $configtext);
$configtext = preg_replace('/\$WELCOME_TEXT_AUTH_MODE_4\s*=\s*".*";/', "\$WELCOME_TEXT_AUTH_MODE_4 = \"".$_POST["NEW_WELCOME_TEXT_AUTH_MODE_4"]."\";", $configtext);// new
$configtext = preg_replace('/\$WELCOME_TEXT_CUST_HEAD\s*=\s*.*;/', "\$WELCOME_TEXT_CUST_HEAD = ".$boolarray[$_POST["NEW_WELCOME_TEXT_CUST_HEAD"]].";", $configtext);
@@ -1688,15 +1686,15 @@ print "&nbsp;<a href=\"javascript: ".i18n::translate('Hide and Show')."\" onclic
</tr>
<tr>
<td class="descriptionbox wrap width20">
- <?php echo i18n::translate('Genealogy contact'), help_link('CONTACT_EMAIL'); ?>
+ <?php echo i18n::translate('Genealogy contact'), help_link('CONTACT_USER_ID'); ?>
</td>
- <td class="optionbox"><select name="NEW_CONTACT_EMAIL" tabindex="<?php echo ++$i; ?>">
+ <td class="optionbox"><select name="NEW_CONTACT_USER_ID" tabindex="<?php echo ++$i; ?>">
<?php
- if ($CONTACT_EMAIL=="you@yourdomain.com") $CONTACT_EMAIL = WT_USER_NAME;
+ $CONTACT_USER_ID=get_gedcom_setting(WT_GED_ID, 'CONTACT_USER_ID');
foreach (get_all_users() as $user_id=>$user_name) {
if (get_user_setting($user_id, 'verified_by_admin')=="yes") {
- print "<option value=\"".$user_name."\"";
- if ($CONTACT_EMAIL==$user_name) print " selected=\"selected\"";
+ print "<option value=\"".$user_id."\"";
+ if ($CONTACT_USER_ID==$user_id) print " selected=\"selected\"";
print ">".getUserFullName($user_id)." - ".$user_name."</option>\n";
}
}
@@ -1706,31 +1704,15 @@ print "&nbsp;<a href=\"javascript: ".i18n::translate('Hide and Show')."\" onclic
</tr>
<tr>
<td class="descriptionbox wrap width20">
- <?php echo i18n::translate('Contact method'), help_link('CONTACT_METHOD'); ?>
+ <?php echo i18n::translate('Support contact'), help_link('WEBMASTER_USER_ID'); ?>
</td>
- <td class="optionbox"><select name="NEW_CONTACT_METHOD" tabindex="<?php echo ++$i; ?>">
- <?php if ($WT_STORE_MESSAGES) { ?>
- <option value="messaging" <?php if ($CONTACT_METHOD=='messaging') print "selected=\"selected\""; ?>><?php print i18n::translate('webtrees internal messaging'); ?></option>
- <option value="messaging2" <?php if ($CONTACT_METHOD=='messaging2') print "selected=\"selected\""; ?>><?php print i18n::translate('Internal messaging with emails'); ?></option>
- <?php } else { ?>
- <option value="messaging3" <?php if ($CONTACT_METHOD=='messaging3') print "selected=\"selected\""; ?>><?php print i18n::translate('webtrees sends emails with no storage'); ?></option>
- <?php } ?>
- <option value="mailto" <?php if ($CONTACT_METHOD=='mailto') print "selected=\"selected\""; ?>><?php print i18n::translate('Mailto link'); ?></option>
- <option value="none" <?php if ($CONTACT_METHOD=='none') print "selected=\"selected\""; ?>><?php print i18n::translate('No contact method'); ?></option>
- </select>
- </td>
- </tr>
- <tr>
- <td class="descriptionbox wrap width20">
- <?php echo i18n::translate('Support contact'), help_link('WEBMASTER_EMAIL'); ?>
- </td>
- <td class="optionbox"><select name="NEW_WEBMASTER_EMAIL" tabindex="<?php echo ++$i; ?>">
+ <td class="optionbox"><select name="NEW_WEBMASTER_USER_ID" tabindex="<?php echo ++$i; ?>">
<?php
- if ($WEBMASTER_EMAIL=="webmaster@yourdomain.com") $WEBMASTER_EMAIL = WT_USER_NAME;
+ $WEBMASTER_USER_ID=get_gedcom_setting(WT_GED_ID, 'WEBMASTER_USER_ID');
foreach (get_all_users() as $user_id=>$user_name) {
if (userIsAdmin($user_id)) {
- print "<option value=\"".$user_name."\"";
- if ($WEBMASTER_EMAIL==$user_name) print " selected=\"selected\"";
+ print "<option value=\"".$user_id."\"";
+ if ($WEBMASTER_USER_ID==$user_id) print " selected=\"selected\"";
print ">".getUserFullName($user_id)." - ".$user_name."</option>\n";
}
}
@@ -1738,23 +1720,7 @@ print "&nbsp;<a href=\"javascript: ".i18n::translate('Hide and Show')."\" onclic
</select>
</td>
</tr>
- <tr>
- <td class="descriptionbox wrap width20">
- <?php echo i18n::translate('Support method'), help_link('SUPPORT_METHOD'); ?>
- </td>
- <td class="optionbox"><select name="NEW_SUPPORT_METHOD" tabindex="<?php echo ++$i; ?>">
- <?php if ($WT_STORE_MESSAGES) { ?>
- <option value="messaging" <?php if ($SUPPORT_METHOD=='messaging') print "selected=\"selected\""; ?>><?php print i18n::translate('webtrees internal messaging'); ?></option>
- <option value="messaging2" <?php if ($SUPPORT_METHOD=='messaging2') print "selected=\"selected\""; ?>><?php print i18n::translate('Internal messaging with emails'); ?></option>
- <?php } else { ?>
- <option value="messaging3" <?php if ($SUPPORT_METHOD=='messaging3') print "selected=\"selected\""; ?>><?php print i18n::translate('webtrees sends emails with no storage'); ?></option>
- <?php } ?>
- <option value="mailto" <?php if ($SUPPORT_METHOD=='mailto') print "selected=\"selected\""; ?>><?php print i18n::translate('Mailto link'); ?></option>
- <option value="none" <?php if ($SUPPORT_METHOD=='none') print "selected=\"selected\""; ?>><?php print i18n::translate('No contact method'); ?></option>
- </select>
- </td>
- </tr>
- </table>
+ </table>
</div>
<div id="config-meta">
<table class="facts_table">
@@ -1897,7 +1863,5 @@ print "&nbsp;<a href=\"javascript: ".i18n::translate('Hide and Show')."\" onclic
document.configform.gedcom_title.focus();
</script>
<?php
-if ($CONTACT_EMAIL=="you@yourdomain.com") $CONTACT_EMAIL = WT_USER_NAME;
-if ($WEBMASTER_EMAIL=="webmaster@yourdomain.com") $WEBMASTER_EMAIL = WT_USER_NAME;
print_footer();
?>
diff --git a/help_text.php b/help_text.php
index 97ff1bd108..b849c092e4 100644
--- a/help_text.php
+++ b/help_text.php
@@ -2175,7 +2175,7 @@ case 'COMMON_NAMES_THRESHOLD':
$text=i18n::translate('This is the number of times that a surname must occur before it shows up in the Common Surname list on the Home Page.');
break;
-case 'CONTACT_EMAIL':
+case 'CONTACT_USER_ID':
$title=i18n::translate('Genealogy contact');
$text=i18n::translate('The person to contact about the genealogical data on this site.');
break;
@@ -2925,7 +2925,7 @@ case 'WATERMARK_THUMB':
$text=i18n::translate('If the Media Firewall is enabled, should thumbnails be watermarked? Your media lists will load faster if you don\'t watermark the thumbnails.');
break;
-case 'WEBMASTER_EMAIL':
+case 'WEBMASTER_USER_ID':
$title=i18n::translate('Support contact');
$text=i18n::translate('The person to be contacted about technical questions or errors encountered on your site.');
break;
diff --git a/includes/functions/functions_print.php b/includes/functions/functions_print.php
index 251c9396fb..1bb5018982 100644
--- a/includes/functions/functions_print.php
+++ b/includes/functions/functions_print.php
@@ -829,26 +829,16 @@ function user_contact_menu($user_id, $method=null) {
//
// this function will print appropriate links based on the preferred contact methods for the genealogy
// contact user and the technical support contact user
-
-function print_contact_links() { // This function is used by 3rd party themes.
- echo contact_links();
-}
-
-function contact_links() {
- global $WEBMASTER_EMAIL, $SUPPORT_METHOD, $CONTACT_EMAIL, $CONTACT_METHOD;
-
- $webmaster_user_id=get_user_id($WEBMASTER_EMAIL);
- if ($WEBMASTER_EMAIL==$CONTACT_EMAIL) {
- $contact_user_id=$webmaster_user_id;
- } else {
- $contact_user_id=get_user_id($CONTACT_EMAIL);
- }
-
- $supportLink = user_contact_link($webmaster_user_id, $SUPPORT_METHOD);
- if ($webmaster_user_id==$contact_user_id && $SUPPORT_METHOD==$CONTACT_METHOD) {
+function contact_links($ged_id=WT_GED_ID) {
+ $contact_user_id =get_gedcom_setting($ged_id, 'CONTACT_USER_ID');
+ $webmaster_user_id=get_gedcom_setting($ged_id, 'WEBMASTER_USER_ID');
+ $contact_method =get_user_setting($contact_user_id, 'contactmethod');
+ $webmaster_method =get_user_setting($webmaster_user_id, 'contactmethod');
+ $supportLink = user_contact_link($webmaster_user_id, $webmaster_method);
+ if ($webmaster_user_id==$contact_user_id && $webmaster_method==$contact_method) {
$contactLink = $supportLink;
} else {
- $contactLink = user_contact_link($contact_user_id, $CONTACT_METHOD);
+ $contactLink = user_contact_link($contact_user_id, $contact_method);
}
if (!$supportLink && !$contactLink) {
@@ -873,21 +863,21 @@ function contact_links() {
}
}
-function contact_menus() {
- global $WEBMASTER_EMAIL, $SUPPORT_METHOD, $CONTACT_EMAIL, $CONTACT_METHOD;
+function contact_menus($ged_id=WT_GED_ID) {
+ $contact_user_id =get_gedcom_setting($ged_id, 'CONTACT_USER_ID');
+ $webmaster_user_id=get_gedcom_setting($ged_id, 'WEBMASTER_USER_ID');
+ $contact_method =get_user_setting($contact_user_id, 'contactmethod');
+ $webmaster_method =get_user_setting($webmaster_user_id, 'contactmethod');
- $webmaster_user_id=get_user_id($WEBMASTER_EMAIL);
- if ($WEBMASTER_EMAIL==$CONTACT_EMAIL) {
+ if ($webmaster_user_id==$contact_user_id) {
$contact_user_id=$webmaster_user_id;
- } else {
- $contact_user_id=get_user_id($CONTACT_EMAIL);
}
- $support_menu=user_contact_menu($webmaster_user_id, $SUPPORT_METHOD);
- if ($webmaster_user_id==$contact_user_id && $SUPPORT_METHOD==$CONTACT_METHOD) {
+ $support_menu=user_contact_menu($webmaster_user_id, $webmaster_method);
+ if ($webmaster_user_id==$contact_user_id) {
$contact_menu=$support_menu;
} else {
- $contact_menu=user_contact_menu($contact_user_id, $CONTACT_METHOD);
+ $contact_menu=user_contact_menu($contact_user_id, $contact_method);
}
if (!$support_menu) {
diff --git a/includes/set_gedcom_defaults.php b/includes/set_gedcom_defaults.php
index e4adce888d..40f8b45c1c 100644
--- a/includes/set_gedcom_defaults.php
+++ b/includes/set_gedcom_defaults.php
@@ -56,5 +56,7 @@ $statement=WT_DB::prepare(
$statement->execute(array($ged_id, 'title', i18n::translate('Genealogy from [%s]', $ged_name)));
$statement->execute(array($ged_id, 'imported', 0));
+$statement->execute(array($ged_id, 'CONTACT_USER_ID', WT_USER_ID));
+$statement->execute(array($ged_id, 'WEBMASTER_USER_ID', WT_USER_ID));
// Eventually, all the settings in config_gedcom.php and privacy.php will be here...