本文整理汇总了PHP中misc::send_email方法的典型用法代码示例。如果您正苦于以下问题:PHP misc::send_email方法的具体用法?PHP misc::send_email怎么用?PHP misc::send_email使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类misc
的用法示例。
在下文中一共展示了misc::send_email方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: misc
//.........这里部分代码省略.........
$edit_first_name = $misc->make_db_safe($_POST['user_first_name']);
$edit_last_name = $misc->make_db_safe($_POST['user_last_name']);
$edit_canEditSiteConfig = $misc->make_db_safe($_POST['edit_canEditSiteConfig']);
$edit_canEditMemberTemplate = $misc->make_db_safe($_POST['edit_canEditMemberTemplate']);
$edit_canEditAgentTemplate = $misc->make_db_safe($_POST['edit_canEditAgentTemplate']);
$edit_canEditListingTemplate = $misc->make_db_safe($_POST['edit_canEditListingTemplate']);
$edit_canEditAllListings = $misc->make_db_safe($_POST['edit_canEditAllListings']);
$edit_canEditAllUsers = $misc->make_db_safe($_POST['edit_canEditAllUsers']);
$edit_can_view_logs = $misc->make_db_safe($_POST['edit_canViewLogs']);
$edit_can_moderate = $misc->make_db_safe($_POST['edit_canModerate']);
$edit_can_feature_listings = $misc->make_db_safe($_POST['edit_canFeatureListings']);
$edit_can_edit_pages = $misc->make_db_safe($_POST['edit_canPages']);
$edit_can_have_vtours = $misc->make_db_safe($_POST['edit_canVtour']);
$edit_can_have_files = $misc->make_db_safe($_POST['edit_canFiles']);
$edit_can_have_user_files = $misc->make_db_safe($_POST['edit_canUserFiles']);
$edit_limitListings = $misc->make_db_safe($_POST['edit_limitListings']);
$sql_edit_canExportListings = $misc->make_db_safe($_POST['edit_canExportListings']);
$sql_edit_canEditListingExpiration = $misc->make_db_safe($_POST['edit_canEditListingExpiration']);
$sql_edit_canEditPropertyClasses = $misc->make_db_safe($_POST['edit_canEditPropertyClasses']);
$sql_userdb_blog_user_type = $misc->make_db_safe($_POST['edit_BlogPrivileges']);
$sql_edit_limitFeaturedListings = $misc->make_db_safe($_POST['edit_limitFeaturedListings']);
$sql_edit_userRank = $misc->make_db_safe($_POST['edit_userRank']);
$sql_edit_canManageAddons = $misc->make_db_safe($_POST['edit_canManageAddons']);
$sql = 'UPDATE ' . $config['table_prefix'] . 'userdb SET
userdb_active = ' . $edit_is_active . ',
userdb_user_first_name = ' . $edit_first_name . ',
userdb_user_last_name = ' . $edit_last_name . ',
userdb_can_edit_site_config = ' . $edit_canEditSiteConfig . ',
userdb_can_edit_member_template = ' . $edit_canEditMemberTemplate . ',
userdb_can_edit_agent_template = ' . $edit_canEditAgentTemplate . ',
userdb_can_edit_listing_template = ' . $edit_canEditListingTemplate . ',
userdb_can_view_logs = ' . $edit_can_view_logs . ',
userdb_can_moderate = ' . $edit_can_moderate . ',
userdb_can_feature_listings = ' . $edit_can_feature_listings . ',
userdb_can_edit_pages = ' . $edit_can_edit_pages . ',
userdb_can_have_vtours = ' . $edit_can_have_vtours . ',
userdb_can_have_files = ' . $edit_can_have_files . ',
userdb_can_have_user_files = ' . $edit_can_have_user_files . ',
userdb_limit_listings = ' . $edit_limitListings . ',
userdb_can_edit_expiration = ' . $sql_edit_canEditListingExpiration . ',
userdb_can_export_listings = ' . $sql_edit_canExportListings . ',
userdb_can_edit_all_users = ' . $edit_canEditAllUsers . ',
userdb_can_edit_all_listings = ' . $edit_canEditAllListings . ',
userdb_can_edit_property_classes = ' . $sql_edit_canEditPropertyClasses . ',
userdb_can_manage_addons = ' . $sql_edit_canManageAddons . ',
userdb_rank = ' . $sql_edit_userRank . ',
userdb_featuredlistinglimit = ' . $sql_edit_limitFeaturedListings . ',
userdb_blog_user_type = ' . $sql_userdb_blog_user_type . '
WHERE userdb_id = ' . $user_id;
$recordSet = $conn->Execute($sql);
if ($recordSet === false) {
$misc->log_error($sql);
}
} else {
if (isset($_POST['edit_active'])) {
$edit_is_active = $misc->make_db_safe($_POST['edit_active']);
} else {
$edit_is_active = $misc->make_db_safe('yes');
}
$edit_first_name = $misc->make_db_safe($_POST['user_first_name']);
$edit_last_name = $misc->make_db_safe($_POST['user_last_name']);
$sql = 'UPDATE ' . $config['table_prefix'] . 'userdb SET userdb_active = ' . $edit_is_active . ', userdb_user_first_name = ' . $edit_first_name . ', userdb_user_last_name =' . $edit_last_name . ' WHERE userdb_id = ' . $user_id;
$recordSet = $conn->Execute($sql);
if ($recordSet === false) {
$misc->log_error($sql);
}
}
if ($is_active == 'no' && $_POST['edit_active'] == 'yes') {
if ($config['moderate_agents'] == 1 && $is_agent == 'yes' || $config['moderate_members'] == 1 && $is_agent == 'no') {
$message = $_POST['user_first_name'] . ' ' . $_POST['user_last_name'] . ",\r\n" . $lang['user_activated_message'] . "\r\n\r\n";
if ($is_agent == 'yes') {
$link = $config['baseurl'] . '/admin/index.php';
} else {
$link = $config['baseurl'] . '/index.php?action=member_login';
}
$message .= $link;
$email = str_replace('\'', '', $_POST['user_email']);
$send = $misc->send_email($config['company_name'], $config['admin_email'], $email, $message, $lang['user_activated_subject']);
}
}
$message = user_managment::updateUserData($user_id);
if ($message == 'success') {
// one has to ensure that the cookie containing the pass is reset
// otherwise, one would have to log out and in again everytime
// an account was updated
if ($_POST['edit_user_pass'] != "" && $_SESSION['userID'] == $user_id) {
$_SESSION['userpassword'] = md5($_POST['edit_user_pass']);
}
$display .= '<p>' . $lang['user_editor_account_updated'] . ', ' . $_SESSION['username'] . '</p>';
} else {
$display .= '<p>' . $lang['alert_site_admin'] . '</p>';
}
// end else
}
// end if $pass_the_form == "Yes"
}
// end else
$misc->log_action($lang['log_updated_user'] . ': ' . $user_id);
return $display;
}
示例2: ContactFriendForm
/**
* Contact::ContactFriendForm()
*
* @param integer $listing_id This should hold the listing ID that you aer emailing your friend about.
* @return
*/
function ContactFriendForm($listing_id)
{
global $conn, $config, $lang;
require_once $config['basepath'] . '/include/misc.inc.php';
$misc = new misc();
$display = '';
$error = array();
if (isset($_POST['message'])) {
// Make sure there is a message
if ($_SESSION['security_code'] != md5($_POST['security_code']) && $config["use_email_image_verification"] == 1) {
$error[] = 'email_verification_code_not_valid';
}
if (trim($_POST['name']) == '') {
$error[] = 'email_no_name';
}
if (trim($_POST['email']) == '') {
$error[] = 'email_no_email_address';
} elseif ($misc->validate_email($_POST['email']) !== true) {
$error[] = 'email_invalid_email_address';
}
if (trim($_POST['friend_email']) == '') {
$error[] = 'email_no_email_address';
} elseif ($misc->validate_email($_POST['friend_email']) !== true) {
$error[] = 'email_invalid_email_address';
}
if (trim($_POST['subject']) == '') {
$error[] = 'email_no_subject';
}
if (trim($_POST['message']) == '') {
$error[] = 'email_no_message';
}
}
if (count($error) == 0 && isset($_POST['message'])) {
// Send Mail
$sent = $misc->send_email($_POST['name'], $_POST['email'], $_POST['friend_email'], $_POST['message'], $_POST['subject']);
if ($sent === true) {
$display .= $lang['email_listing_sent'] . ' ' . $_POST['friend_email'];
} else {
$display .= $sent;
}
} else {
if (count($error) != 0) {
foreach ($error as $err) {
$display .= '<div class="error_text">' . $lang[$err] . '</div>';
}
}
$name = '';
$email = '';
$subject = '';
// $friend_name = '';
$friend_email = '';
$message = '';
if (isset($_POST['message'])) {
$email = stripslashes($_POST['email']);
$name = stripslashes($_POST['name']);
$message = stripslashes($_POST['message']);
$subject = stripslashes($_POST['subject']);
// $friend_name = $_POST['friend_name'];
$friend_email = stripslashes($_POST['friend_email']);
} else {
$subject = $lang['email_in_reference_to_listing'] . $listing_id;
$message = $lang['email_listing_default_message'] . "\r\n\r\n" . $config['baseurl'] . '/index.php?action=listingview&listingID=' . $listing_id;
}
$display .= '<form name="contact_friend" method="post" action="index.php?action=contact_friend&popup=yes&listing_id=' . $listing_id . '">
<table border="0" cellspacing="2" cellpadding="4">
<tr>
<td colspan="2" style="vertical-align: top" class="TitleColor"><label for="name">' . $lang['email_your_name'] . ' </label>
<input id="name" name="name" value="' . htmlentities($name) . '" type="text" size="50">
</td>
</tr>
<tr>
<td colspan="2" style="vertical-align: top" class="TitleColor"><label for="email">' . $lang['email_your_email'] . ' </label>
<input id="email" name="email" value="' . htmlentities($email) . '" type="text" size="50">
</td>
</tr>
<tr>
<td colspan="2" style="vertical-align: top" class="TitleColor"><label for="email">' . $lang['email_friend_email'] . ' </label>
<input id="email" name="friend_email" value="' . htmlentities($friend_email) . '" type="text" size="50">
</td>
</tr>
<tr>
<td colspan="2" style="vertical-align: top" class="TitleColor"><label for="subject">' . $lang['email_your_subject'] . '</label>
<input id="subject" name="subject" value="' . htmlentities($subject) . '" type="text" size="50">
</td>
</tr>
<tr>
<td colspan="2" style="vertical-align: top" class="TitleColor"><label for="message">' . $lang['email_your_message'] . '</label>
<br />
<br />
<textarea id="message" name="message" rows="5" cols="50">' . htmlentities($message) . '</textarea>
</td>
</tr>
</tr>';
if ($config["use_email_image_verification"] == 1) {
//.........这里部分代码省略.........
示例3: misc
//.........这里部分代码省略.........
if ($message == "success") {
$display .= "<p>{$lang['admin_new_listing_created']}, {$_SESSION['username']}</p>";
if ($config['moderate_listings'] === "1") {
// if moderation is turned on...
$display .= "<p>{$lang['admin_new_listing_moderated']}</p>";
}
if (isset($_POST['or_owner'])) {
$display .= "<p><a href=\"index.php?action=edit_listings&edit={$new_listing_id}\">{$lang['you_may_now_edit_the_listing']}</a></p>";
} else {
$display .= "<p><a href=\"index.php?action=edit_my_listings&edit={$new_listing_id}\">{$lang['you_may_now_edit_your_listing']}</a></p>";
}
$display .= "<br /><p>{$lang['admin_additional_steps']}</p>";
$display .= '<form action="index.php?action=edit_listing_images" method="post" name="edit_listing_images"><input type="hidden" name="edit" value="' . $new_listing_id . '" /><a href="javascript:document.edit_listing_images.submit()">' . $lang['upload_images'] . '</a></form>';
$display .= '<br />';
if ($_SESSION['admin_privs'] == "yes" || $_SESSION['havevtours'] == "yes") {
$display .= '<form action="index.php?action=edit_vtour_images" method="post" name="edit_vtour_images"><input type="hidden" name="edit" value="' . $new_listing_id . '" /><a href="javascript:document.edit_vtour_images.submit()">' . $lang['upload_vtours'] . '</a></form>';
$display .= '<br />';
}
if ($_SESSION['admin_privs'] == "yes" || $_SESSION['havefiles'] == "yes") {
$display .= '<form action="index.php?action=edit_listing_files" method="post" name="edit_listing_files"><input type="hidden" name="edit" value="' . $new_listing_id . '" /><a href="javascript:document.edit_listing_files.submit()">' . $lang['upload_files'] . '</a></form>';
$display .= '<br />';
}
$misc->log_action("{$lang['log_created_listing']} {$new_listing_id}");
if ($config['email_notification_of_new_listings'] === "1") {
// if the site admin should be notified when a new listing is added
global $config, $lang;
$agent_email = $listing->getListingEmail($new_listing_id, true);
$agent_first_name = $listing->getListingAgentFirstName($new_listing_id);
$agent_last_name = $listing->getListingAgentLastName($new_listing_id);
$message = $_SERVER['REMOTE_ADDR'] . " -- " . date("F j, Y, g:i:s a") . "\r\n\r\n{$lang['admin_new_listing']}:\r\n{$config['baseurl']}/admin/index.php?action=edit_listings&edit={$new_listing_id}\r\n";
$header = "From: " . $agent_first_name . " " . $agent_last_name . " <" . $agent_email . ">\r\n";
$header .= "X-Sender: {$config['admin_email']}\r\n";
$header .= "Return-Path: {$config['admin_email']}\r\n";
$sent = $misc->send_email($agent_first_name . " " . $agent_last_name, $agent_email, $config['admin_email'], $message, $lang['admin_new_listing']);
}
// end if
} else {
$display .= "<p>{$lang['alert_site_admin']}</p>";
}
// end else
}
// end $pass_the_form == "Yes"
}
// end else
}
//End if (($listing_count >= $listing_limit) && ($listing_limit !== -1))
} else {
// Check Number of Listings User has
$sql = 'SELECT count(listingsdb_id) FROM ' . $config['table_prefix'] . 'listingsdb WHERE userdb_id = ' . $_SESSION['userID'];
$recordSet = $conn->Execute($sql);
if ($recordSet === false) {
$misc->log_error($sql);
}
$listing_count = $recordSet->fields[0];
// Get User Listing Limit
$sql = 'SELECT userdb_limit_listings FROM ' . $config['table_prefix'] . 'userdb WHERE userdb_id = ' . $_SESSION['userID'];
$recordSet = $conn->Execute($sql);
if ($recordSet === false) {
$misc->log_error($sql);
}
$listing_limit = $recordSet->fields[0];
$display .= '<!-- ' . $listing_count . ' >= ' . $listing_limit . ' -->';
if ($listing_count >= $listing_limit && $listing_limit !== '-1') {
$display .= '<br />';
$display .= $lang['admin_listing_limit_reached'];
} else {
示例4: NotifyUsersOfAllNewListings
function NotifyUsersOfAllNewListings()
{
global $conn, $lang, $config;
$display = '';
require_once $config['basepath'] . '/include/misc.inc.php';
$misc = new misc();
require_once $config['basepath'] . '/include/search.inc.php';
//Get Last Notification Timestamp
$sql = 'SELECT controlpanel_notification_last_timestamp FROM ' . $config['table_prefix_no_lang'] . 'controlpanel';
$recordSet = $conn->Execute($sql);
if ($recordSet === false) {
$misc->log_error($sql);
}
$last_timestamp = $conn->UnixTimeStamp($recordSet->fields['controlpanel_notification_last_timestamp']);
//echo 'Timestamp'.$last_timestamp;
$display .= 'Sending New Listing Notifications since ' . date(DATE_RFC822, $last_timestamp) . "<br />\r\n";
$current_timestamp = time();
$notify_count = 0;
$sql = "SELECT " . $config['table_prefix'] . "usersavedsearches.userdb_id, usersavedsearches_title, usersavedsearches_query_string, usersavedsearches_notify, userdb_user_name, userdb_emailaddress\n\t\t\t\tFROM " . $config['table_prefix'] . "userdb , " . $config['table_prefix'] . "usersavedsearches\n\t\t\t\tWHERE " . $config['table_prefix'] . "userdb.userdb_id = " . $config['table_prefix'] . "usersavedsearches.userdb_id AND usersavedsearches_notify = 'yes'";
$recordSet = $conn->Execute($sql);
if ($recordSet === false) {
$misc->log_error($sql);
}
while (!$recordSet->EOF) {
$query_string = $misc->make_db_unsafe($recordSet->fields['usersavedsearches_query_string']);
$user_id = $recordSet->fields['userdb_id'];
$search_title = $misc->make_db_unsafe($recordSet->fields['usersavedsearches_title']);
$email = $misc->make_db_unsafe($recordSet->fields['userdb_emailaddress']);
$user_name = $misc->make_db_unsafe($recordSet->fields['userdb_user_name']);
$display .= 'Checking Notifications for Saved Search "' . $search_title . '" for ' . $user_name . "<br />\r\n";
// Break Quesry String up into $_GET variables.
unset($_GET);
$query_string = urldecode($query_string);
$criteria = explode('&', $query_string);
foreach ($criteria as $crit) {
if ($crit != '') {
$pieces = explode('=', $crit);
$pos = strpos($pieces[0], '[]');
if ($pos !== false) {
$name = substr($pieces[0], 0, -2);
$_GET[$name][] = $pieces[1];
} else {
$_GET[$pieces[0]] = $pieces[1];
}
}
}
if (!isset($_GET)) {
$_GET[] = '';
}
$_GET['listing_last_modified_greater'] = $last_timestamp;
$matched_listing_ids = search_page::search_results(true);
if (count($matched_listing_ids) >= 1) {
//print_r($matched_listing_ids);
//Get User Details
//Now that we have a list of the listings, render the template
$template = $this->renderNotifyListings($matched_listing_ids, $search_title, $user_name, $email);
$display .= '<span class=redtext">Sent Listing Notification to ' . $user_name . '<' . $email . '> for listings ' . implode(',', $matched_listing_ids) . "</span><br />\r\n";
// Send Mail
if (isset($config['site_email']) && $config['site_email'] != '') {
$sender_email = $config['site_email'];
} else {
$sender_email = $config['admin_email'];
}
$subject = $lang['new_listing_notify'] . $search_title;
$sent = $misc->send_email($config['admin_name'], $sender_email, $email, $template, $subject, TRUE, TRUE);
}
$recordSet->MoveNext();
}
// while
//Swt Last Notification Timestamp
$db_timestamp = $conn->DBTimeStamp($current_timestamp);
$sql = 'UPDATE ' . $config['table_prefix_no_lang'] . 'controlpanel SET controlpanel_notification_last_timestamp = ' . $db_timestamp;
$recordSet = $conn->Execute($sql);
if ($recordSet === false) {
$misc->log_error($sql);
}
$display .= "Finish Sending Notifications<br />\r\n";
return $display;
}