|
From: FlorinCB <ory...@us...> - 2008-10-04 08:03:24
|
Update of /cvsroot/mxbb/mx_contact/develop/addons/Recipient List addon In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv842/develop/addons/Recipient List addon Added Files: install.txt Log Message: new version of contact module --- NEW FILE: install.txt --- ############################################################## ## MOD Title: Contact Form :: Recipients List Add-on ## MOD Author: marcus.smith < ma...@ph... > (MarcuS) http://www.phobbia.net/mods ## MOD Description: Adds a dropdown of different Admins/Moderators who can be contacted ## MOD Version: 1.2.0 ## ## Installation Level: Easy ## ## Installation Time: ~5 Minutes ## ## Files To Edit: contact.php ## includes/functions_selects.php ## templates/subSilver/contact_body.tpl ## ## Included Files: language/lang_english/lang_contacts.php ## ## License: http://opensource.org/licenses/gpl-license.php GNU General Public License v2 ############################################################## ## For security purposes, please check: http://www.phpbb.com/mods/ ## for the latest version of this MOD. Although MODs are checked ## before being allowed in the MODs Database there is no guarantee ## that there are no security problems within the MOD. No support ## will be given for MODs not found within the MODs Database which ## can be found at http://www.phpbb.com/mods/ ############################################################## ## Author Notes: ## ## How to Use this Addon ## --------------------- ## Open language/lang_english/lang_contacts.php and locate the Recipients array. ## Each recipient is structured as follows: $lang['contact_me']['user_id'] = 'Recipient Name/Dept'; ## The first part: ['user_id'] - is sent to the chosen user_id you enter, whilst the second part: 'Recipient Name/Dept' ## is displayed in the Contact Forms dropdown options list which users see. A user_id can be found by getting ## the u= value seen in the URL when viewing a users profile. ## ## If the sender does not choose a recipient from the list it will go to the Site Admin by default. ## ## One Rule: The same user_id cannot appear more than once in the list! ## ## Sites with Additional Languages ## ------------------------------- ## Simply create a duplicate of lang_contacts.php, making sure the user_id is against the correct translation ## each time in the Recipients array. ## ## Why did you use 'user_id' instead of e-mails? ## --------------------------------------------- ## If we used value="em...@yo..." these may be viewed in the HTML source and either abused by ## people, or found by spam bots harvesting your site. Instead we use the user_id of the user who will ## receive the e-mail, and get their e-mail from the database registered to their name. This does cause ## a couple of limitations - ie each user_id can be listed once only - but is more secure in the end. ## ############################################################## ## MOD History: ## ## 2007-30-05 - Version 1.2.0 ## - Bug fix in install.txt - thanks Wolfgang ## ## 2007-22-04 - Version 1.1.0 ## - Updated to match latest code changes (8.9.4) ## ## 2007-03-03 - Version 1.0.0 ## - Recipients List Add-on written for Contact Form ## ############################################################## ## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD ############################################################## # #-----[ DIY INSTRUCTIONS ]------------------------------------------- # Make sure the Contact Form mod is installed BEFORE following these instructions. See Authors Notes for creating your own reasons list or using translations. # #-----[ COPY ]------------------------------------------ # copy root/language/lang_english/lang_contacts.php to language/lang_english/lang_contacts.php # #-----[ OPEN ]------------------------------------------ # contact.php # #-----[ FIND ]------------------------------------------ # include($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_contact.'.$phpEx); # #-----[ AFTER, ADD ]------------------------------------ # include($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_contacts.'.$phpEx); include($phpbb_root_path . 'includes/functions_selects.'.$phpEx); # #-----[ FIND ]------------------------------------------ # $email = (!isset($HTTP_POST_VARS['email'])) ? '' : stripslashes(trim(htmlspecialchars($HTTP_POST_VARS['email']))); # #-----[ AFTER, ADD ]------------------------------------ # $contacts_list = (!isset($HTTP_POST_VARS['contacts_list'])) ? '' : stripslashes(htmlspecialchars($HTTP_POST_VARS['contacts_list'])); # #-----[ FIND ]------------------------------------------ # $sql = "SELECT user_lang FROM " . USERS_TABLE . " WHERE user_id = 2"; if(!($result = $db->sql_query($sql))) { message_die(CRITICAL_ERROR, "Could not query recipient information", "", __LINE__, __FILE__, $sql); } $row = $db->sql_fetchrow($result); # #-----[ REPLACE WITH ]------------------------------------ # # #-----[ FIND ]------------------------------------------ # empty($contact_config['contact_admin_email']) ? $emailer->email_address($board_config['board_email']) : $emailer->email_address($contact_config['contact_admin_email']); # #-----[ REPLACE WITH ]------------------------------------ # if($contacts_list == '0') { empty($contact_config['contact_admin_email']) ? $emailer->email_address($board_config['board_email']) : $emailer->email_address($contact_config['contact_admin_email']); } else { $sql = "SELECT user_email, user_lang FROM " . USERS_TABLE . " WHERE user_id = '$contacts_list'"; $result = $db->sql_query($sql); if(!$db->sql_query($sql)) { message_die(GENERAL_ERROR, "Could not query recipient information", "", __LINE__, __FILE__, $sql); } $row = $db->sql_fetchrow($result); $emailer->email_address($row['user_email']); } # #-----[ FIND ]------------------------------------------ # 'L_SUBMIT' => $lang['Submit'], 'L_RESET' => $lang['Reset'], # #-----[ AFTER, ADD ]------------------------------------ # 'L_TO_OPTIONS' => $lang['Contacts_list'], 'L_TO_OPTIONS_EXPLAIN' => $lang['Contacts_explain'], 'TO_OPTIONS' => contacts_list($select_name = 'contacts_list'), # #-----[ OPEN ]------------------------------------------ # includes/functions_selects.php # #-----[ FIND ]----------------------------------------- # ?> # #-----[ BEFORE, ADD ]------------------------------------ # // // Contact Form :: Recipients List Addon // function contacts_list($select_name = 'contacts_list') { global $lang; $contacts_list = '<select name="' . $select_name . '">'; $contacts_list .= '<option value="0" selected="selected">' . $lang['Contacts_list'] .'</option>'; while(list($value, $option) = @each($lang['contact_me'])) { $contacts_list .= '<option value="' . $value . '">' . $option . '</option>'; } $contacts_list .= '</select>'; return $contacts_list; } # #-----[ OPEN ]------------------------------------------ # templates/subSilver/contact_body.tpl # #-----[ FIND ]------------------------------------------ # <tr> <td class="row1"><span class="gen"><b>{L_EMAIL}</b></span><br /> <span class="gensmall">{L_EXPLAIN_EMAIL}</span></td> <td class="row2"><input type="text" name="email" size="30" maxlength="50" /></td> </tr> # #-----[ AFTER, ADD ]------------------------------------ # <tr> <td class="row1"><span class="gen"><b>{L_TO_OPTIONS}</b></span><br /> <span class="gensmall">{L_TO_OPTIONS_EXPLAIN}</span></td> <td class="row2">{TO_OPTIONS}</td> </tr> # #-----[ SAVE/CLOSE ALL FILES ]-------------------------- # # EoM |