Multible mail-adresses
foodlover
Posted on 20-01-2011 22:24
Offline
Junior Member
Posts: 37
Joined: 14.01.11
Warnings:
Hallo :-)
Is it possible for make a drop down or ad different
contact emails under under: Contact Us.
Like different departments:
Sales
Webmaster
Marketing
and so on.
So when the person wants to contact they have to choose
which department they want to mail.
slaughter
Posted on 23-01-2011 13:33
Offline
Head Developer
Super Admin
Posts: 1091
Joined: 28.12.09
Gender: male
Warnings:
it is possible, but needs some modification in contact file.
foodlover
Posted on 23-01-2011 13:41
Offline
Junior Member
Posts: 37
Joined: 14.01.11
Warnings:
Does anyone know about a mod/infusion for this?
Yodix
Posted on 23-01-2011 13:57
Offline
Member
Posts: 55
Joined: 15.01.11
Gender: male
Warnings:
I do not know whether you like it, but this contact to send an email to the selected admin, etc.
Code <?php
/*-------------------------------------------------------+
| PHP-Fusion Content Management System
| Copyright (C) 2002 - 2010 Nick Jones
| http://www.php-fusion.co.uk/
+--------------------------------------------------------+
| Filename: contact.php
| Author: Nick Jones (Digitanium)
+--------------------------------------------------------+
| This program is released as free software under the
| Affero GPL license. You can redistribute it and/or
| modify it under the terms of this license which you
| can read by viewing the included agpl.txt or online
| at www.gnu.org/licenses/agpl.html. Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+--------------------------------------------------------*/
require_once "maincore.php";
require_once THEMES."templates/header.php";
include LOCALE.LOCALESET."contact.php";
add_to_title($locale['global_200'].$locale['400']);
$add_group = "5";
$contactlist = array();
$emails = array();
$getadmins = dbquery("SELECT user_id, user_name, user_level, user_email FROM ".DB_USERS." WHERE user_level > '101' ORDER BY user_id ASC");
$additional_group = (is_numeric($add_group) && $add_group > 0) ? " AND user_groups REGEXP('^\\\.{$add_group}$|\\\.{$add_group}\\\.|\\\.{$add_group}$')" : "";
while ($admin = dbarray($getadmins)) {
$contactlist[getgroupname($admin['user_level'])][$admin['user_id']] = $admin['user_name'];
$emails[$admin['user_id']]['name'] = $admin['user_name'];
$emails[$admin['user_id']]['mail'] = $admin['user_email'];
}
$moderators = dbquery("SELECT user_id, user_name, user_email FROM ".DB_USERS." WHERE user_level < '102'".$additional_group." ORDER BY user_level DESC, user_id");
while ($moderator = dbarray($moderators)) {
$contactlist[getgroupname($add_group)][$moderator['user_id']] = $moderator['user_name'];
$emails[$moderator['user_id']]['name'] = $moderator['user_name'];
$emails[$moderator['user_id']]['mail'] = $moderator['user_email'];
}
$dest_locale = $settings['locale'] == "Romanian" ? "Destinatar" : "Destination";
if (isset($_POST['sendmessage'])) {
include_once INCLUDES."securimage/securimage.php";
$error = "";
$mailname = substr(stripinput(trim($_POST['mailname'])), 0, 50);
$email = substr(stripinput(trim($_POST['email'])), 0, 100);
$subject = substr(str_replace(array("\r","\n","@"), "", descript(stripslash(trim($_POST['subject'])))), 0, 50);
$message = descript(stripslash(trim($_POST['message'])));
if ($mailname == "") {
$error .= "· <span class='alt'>".$locale['420']."</span><br />\n";
}
if ($email == "" || !preg_match("/^[-0-9A-Z_\.]{1,50}@([-0-9A-Z_\.]+\.){1,50}([0-9A-Z]){2,4}$/i", $email)) {
$error .= "· <span class='alt'>".$locale['421']."</span><br />\n";
}
if ($subject == "") {
$error .= "· <span class='alt'>".$locale['422']."</span><br />\n";
}
if ($message == "") {
$error .= "· <span class='alt'>".$locale['423']."</span><br />\n";
}
$securimage = new Securimage();
if (!isset($_POST['captcha_code']) || $securimage->check($_POST['captcha_code']) == false) {
$error .= "· <span class='alt'>".$locale['424']."</span><br />\n";
}
if (!$error) {
require_once INCLUDES."sendmail_include.php";
if (!sendemail($settings['siteusername'],$settings['siteemail'],$mailname,$email,$subject,$message)) {
$error .= "· <span class='alt'>".$locale['425']."</span><br />\n";
}
}
if ($error) {
opentable($locale['400']);
echo "<div style='text-align:center'><br />\n".$locale['442']."<br /><br />\n".$error."<br />\n".$locale['443']."</div><br />\n";
closetable();
} else {
opentable($locale['400']);
echo "<div style='text-align:center'><br />\n".$locale['440']."<br /><br />\n".$locale['441']."</div><br />\n";
closetable();
}
} else {
opentable($locale['400']);
echo $locale['401']."<br /><br />\n";
echo "<form name='userform' method='post' action='".FUSION_SELF."'>\n";
echo "<table cellpadding='0' cellspacing='0' class='center'>\n<tr>\n";
echo "<td width='100' class='tbl'>".$locale['402']."</td>\n";
echo "<td class='tbl'><input type='text' name='mailname' maxlength='50' class='textbox' style='width: 200px;' /></td>\n";
echo "</tr>\n<tr>\n";
echo "<td width='100' class='tbl'>".$locale['403']."</td>\n";
echo "<td class='tbl'><input type='text' name='email' maxlength='100' class='textbox' style='width: 200px;' /></td>\n";
echo "</tr>\n<tr>\n";
echo "<td width='100' class='tbl'>".$locale['404']."</td>\n";
echo "<td class='tbl'><input type='text' name='subject' maxlength='50' class='textbox' style='width: 200px;' /></td>\n";
echo "</tr>\n<tr>\n";
echo "<td width='100' class='tbl'>Destinatar:</td>\n";
echo "<td class='tbl'><select name='destination' class='textbox' style='width: 200px;' />\n";
foreach ($contactlist as $group => $members) {
echo "<option value='' disabled='disabled' style='font-weight: bold'>" . $group . "</option>\n";
foreach ($members as $id => $name)
echo "<option value='". $id . "'>" . $name . "</option>\n";
}
echo "</select></td>\n";
echo "</tr>\n<tr>\n";
echo "<td width='100' class='tbl'>".$locale['405']."</td>\n";
echo "<td class='tbl'><textarea name='message' rows='10' class='textbox' cols='50'></textarea></td>\n";
echo "</tr>\n<tr>\n";
echo "<td width='100' class='tbl'>".$locale['407']."</td>\n";
echo "<td class='tbl'>";
echo "<img id='captcha' src='".INCLUDES."securimage/securimage_show.php' alt='' align='left' />\n";
echo "<a href='".INCLUDES."securimage/securimage_play.php'><img src='".INCLUDES."securimage/images/audio_icon.gif' alt='' align='top' class='tbl-border' style='margin-bottom:1px' /></a><br />\n";
echo "<a href='#' onclick=\"document.getElementById('captcha').src = '".INCLUDES."securimage/securimage_show.php?sid=' + Math.random(); return false\"><img src='".INCLUDES."securimage/images/refresh.gif' alt='' align='bottom' class='tbl-border' /></a>\n";
echo "</td>\n</tr>\n<tr>";
echo "<td class='tbl'>".$locale['408']."</td>\n";
echo "<td class='tbl'><input type='text' name='captcha_code' class='textbox' style='width:100px' /></td>\n";
echo "</tr>\n<tr>\n";
echo "<td align='center' colspan='2' class='tbl'>\n";
echo "<input type='submit' name='sendmessage' value='".$locale['406']."' class='button' /></td>\n";
echo "</tr>\n</table>\n</form>\n";
closetable();
}
require_once THEMES."templates/footer.php";
?>
Advertising Bot Posted on 23-05-2012 02:33
Bot Agent Posts: n^xJoined: Always
foodlover
Posted on 24-01-2011 00:07
Offline
Junior Member
Posts: 37
Joined: 14.01.11
Warnings:
nice. thanks alot.
Do I have to edit direct in the php code? I want to choose who they can pick and write to, not to all members.
Yodix
Posted on 24-01-2011 19:04
Offline
Member
Posts: 55
Joined: 15.01.11
Gender: male
Warnings:
The code takes a list of the relevant table in the database so you can change the query for any group and add the appropriate administrators.
foodlover
Posted on 26-01-2011 01:01
Offline
Junior Member
Posts: 37
Joined: 14.01.11
Warnings:
would be nice with an Infusion :-D
uygarozan
Posted on 26-01-2011 05:57
Offline
Junior Member
Posts: 17
Joined: 22.11.10
Warnings:
Foodlover,
I'm using infusion "custom_contact" for it. That is a infusion for php-fusion but it works on my site. Look at:
http://www.turkis...ontact.php
If you can use it, just tell me. I'll send it to you.
Edited by uygarozan on 26-01-2011 05:57
afoster
Posted on 26-01-2011 17:53
Offline
Junior Member
Posts: 10
Joined: 29.01.10
Gender: male
Warnings:
uygarozan wrote:
Foodlover,
I'm using infusion "custom_contact" for it. That is a infusion for php-fusion but it works on my site. Look at:
http://www.turkis...ontact.php
If you can use it, just tell me. I'll send it to you.
Would appreciate it if you could send the infusion to me. Send to afoster@bluebottle.com
Thanks.
uygarozan
Posted on 27-01-2011 06:34
Offline
Junior Member
Posts: 17
Joined: 22.11.10
Warnings:
Done. I've send it to afoster@bluebottle.com
afoster
Posted on 27-01-2011 17:38
Offline
Junior Member
Posts: 10
Joined: 29.01.10
Gender: male
Warnings:
Thank you
foodlover
Posted on 27-01-2011 18:41
Offline
Junior Member
Posts: 37
Joined: 14.01.11
Warnings:
please mail to: scherffenberg@gmail.com
Thanks alot
uygarozan
Posted on 28-01-2011 02:28
Offline
Junior Member
Posts: 17
Joined: 22.11.10
Warnings:
Done.