The fields are defined in the lang file, egI have tried your mod but cannot for the life of me figure out how to add extra fields that will display in a post.
Code: Select all
'CONTACT_TEMPLATE' => '<strong>Name:</strong> %1$s' . "\n" . '<strong>Email Address:</strong> %2$s' . "\n" . '<strong>IP:</strong> %3$s' . "\n" . '<strong>Date:</strong> %4$s' . "\n" . '<strong>Reason:</strong> %5$s' . "\n" . '<strong>Subject:</strong> %6$s' . "\n\n" . '<strong>Has entered the following message into the contact form:</strong>' . "\n" . '%7$s',
'CONTACT_TEMPLATE_NO_REASON' => '<strong>Name:</strong> %1$s' . "\n" . '<strong>Email Address:</strong> %2$s' . "\n" . '<strong>IP:</strong> %3$s' . "\n" . '<strong>Date:</strong> %4$s' . "\n" . '<strong>Subject:</strong> %5$s' . "\n\n" . '<strong>Has entered the following message into the contact form:</strong>' . "\n" . '%6$s',
Code: Select all
// there may not be a reason entered in the ACP...so change the template to reflect this
if(!empty($config_contact['contact_reasons']))
{
$contact_message = sprintf($user->lang['CONTACT_TEMPLATE'], $user_name, $contact_data['email'], $user->ip, $date, $contact_data['contact_reason'], $contact_data['contact_subject'], $contact_message);
}
else
{
$contact_message = sprintf($user->lang['CONTACT_TEMPLATE_NO_REASON'], $user_name, $contact_data['email'], $user->ip, $date, $contact_data['contact_subject'], $contact_message);
}
Code: Select all
// there may not be a reason entered in the ACP...so change the template to reflect this
if(!empty($config_contact['contact_reasons']))
{
$contact_message = sprintf($user->lang['CONTACT_TEMPLATE'], $user_name, $contact_data['email'], $user->ip, $date, $contact_data['contact_reason'], $contact_data['contact_subject'], $contact_message, $contact_data['contact_species']);
}
else
{
$contact_message = sprintf($user->lang['CONTACT_TEMPLATE_NO_REASON'], $user_name, $contact_data['email'], $user->ip, $date, $contact_data['contact_subject'], $contact_message, $contact_data['contact_species']);
}
Code: Select all
'CONTACT_TEMPLATE' => '<strong>Name:</strong> %1$s' . "\n" . '<strong>Email Address:</strong> %2$s' . "\n" . '<strong>IP:</strong> %3$s' . "\n" . '<strong>Date:</strong> %4$s' . "\n" . '<strong>Reason:</strong> %5$s' . "\n" . '<strong>Subject:</strong> %6$s' . "\n" . '<strong>Species:</strong> %8$s' . "\n\n" . '<strong>Has entered the following message into the contact form:</strong>' . "\n" . '%7$s',
'CONTACT_TEMPLATE_NO_REASON' => '<strong>Name:</strong> %1$s' . "\n" . '<strong>Email Address:</strong> %2$s' . "\n" . '<strong>IP:</strong> %3$s' . "\n" . '<strong>Date:</strong> %4$s' . "\n" . '<strong>Subject:</strong> %5$s' . "\n" . '<strong>Species:</strong> %7$s' . "\n\n" . '<strong>Has entered the following message into the contact form:</strong>' . "\n" . '%6$s',
Code: Select all
// our data array
$contact_data = array(
'username' => ($user->data['user_id'] != ANONYMOUS) ? $user->data['username'] : utf8_normalize_nfc(request_var('username', '', true)),
'email' => ($user->data['user_id'] != ANONYMOUS) ? $user->data['user_email'] : strtolower(request_var('email', '')),
'email_confirm' => ($user->data['user_id'] != ANONYMOUS) ? $user->data['user_email'] : strtolower(request_var('email_confirm', '')),
'contact_reason' => utf8_normalize_nfc(request_var('contact_reason', '', true)),
'contact_location' => utf8_normalize_nfc(request_var('contact_location', '', true)),
'contact_message' => utf8_normalize_nfc(request_var('message', '', true)),
'contact_date_found' => utf8_normalize_nfc(request_var('contact_date_found', '', true)),
'contact_species' => utf8_normalize_nfc(request_var('contact_species', '', true)),
);
Code: Select all
$messenger->assign_vars(array(
'ADM_USERNAME' => htmlspecialchars_decode($contact_users[$i]['username']),
'SITENAME' => htmlspecialchars_decode($config['sitename']),
'USER_IP' => $user->ip,
'USERNAME' => $user_name,
'USER_EMAIL' => htmlspecialchars_decode($contact_data['email']),
'DATE' => $date,
'DATE_FOUND' => htmlspecialchars_decode($contact_data['contact_date_found']),
'REASON' => htmlspecialchars_decode($contact_data['contact_reason']),
'SPECIES' => htmlspecialchars_decode($contact_data['contact_species']),
'LOCATION' => htmlspecialchars_decode($location),
'MESSAGE' => $message,
));
Code: Select all
// output the display
$template->assign_vars(array(
'USERNAME' => isset($contact_data['username']) ? $contact_data['username'] : '',
'EMAIL' => isset($contact_data['email']) ? $contact_data['email'] : '',
'EMAIL_CONFIRM' => isset($contact_data['email_confirm']) ? $contact_data['email_confirm'] : '',
'CONTACT_REASONS' => (!empty($config_contact['contact_reasons'])) ? contact_make_select(explode("\n", $config_contact['contact_reasons']), $contact_data['contact_reason']) : '',
'CONTACT_LOCATION' => isset($contact_data['contact_subject']) ? $contact_data['contact_location'] : '',
'CONTACT_MESSAGE' => isset($contact_data['contact_message']) ? $contact_data['contact_message'] : '',
'CONTACT_DATE_FOUND' => isset($contact_data['contact_date_found']) ? $contact_data['contact_date_found'] : '',
'CONTACT_SPECIES' => isset($contact_data['contact_species']) ? $contact_data['contact_species'] : '',
Code: Select all
<tr>
<td class="row1" width="25%"><b class="genmed">{L_DATE_FOUND}: </b></td>
<td class="row2" valign="middle"><input type="text" style="width: 300px" class="post" name="contact_date_found" id="contact_date_found" value="{CONTACT_DATE_FOUND}" size="30" maxlength="60" tabindex="5" /></td>
</tr>
<tr>
<td class="row1" width="25%"><b class="genmed">{L_LOCATION}: </b></td>
<td class="row2" valign="middle"><input type="text" style="width: 300px" class="post" name="contact_location" id="contact_location" value="{CONTACT_LOCATION}" size="30" maxlength="60" tabindex="5" /></td>
</tr>
<tr>
<td class="row1" width="25%"><b class="genmed">{L_SPECIES}: </b></td>
<td class="row2" valign="middle"><input type="text" style="width: 300px" class="post" name="contact_species" id="contact_species" value="{CONTACT_SPECIES}" size="30" maxlength="60" tabindex="5" /></td>
</tr>
Ensure you have uploaded all files from the download of this mod onto your forum. I can not reproduce this error.