Beispiel #1
0
function awpcp_listing_updated_user_message($listing, $messages)
{
    $admin_email = awpcp_admin_recipient_email_address();
    $payments_api = awpcp_payments_api();
    $show_total_amount = $payments_api->payments_enabled();
    $show_total_credits = $payments_api->credit_system_enabled();
    $currency_code = awpcp_get_currency_code();
    $blog_name = awpcp_get_blog_name();
    if (!is_null($transaction)) {
        $transaction_totals = $transaction->get_totals();
        $total_amount = $transaction_totals['money'];
        $total_credits = $transaction_totals['credits'];
    } else {
        $total_amount = 0;
        $total_credits = 0;
    }
    if (get_awpcp_option('requireuserregistration')) {
        $include_listing_access_key = false;
        $include_edit_listing_url = true;
    } else {
        $include_listing_access_key = get_awpcp_option('include-ad-access-key');
        $include_edit_listing_url = false;
    }
    $params = compact('ad', 'admin_email', 'transaction', 'currency_code', 'show_total_amount', 'show_total_credits', 'include_listing_access_key', 'include_edit_listing_url', 'total_amount', 'total_credits', 'message', 'blog_name');
    $email = new AWPCP_Email();
    $email->to[] = "{$ad->ad_contact_name} <{$ad->ad_contact_email}>";
    $email->subject = get_awpcp_option('listingaddedsubject');
    $email->prepare(AWPCP_DIR . '/frontend/templates/email-place-ad-success-user.tpl.php', $params);
    return $email;
}
Beispiel #2
0
/**
 * XXX: Referenced in FAQ: http://awpcp.com/forum/faq/why-doesnt-my-currency-code-change-when-i-set-it/
 */
function awpcp_get_currency_symbol()
{
    $currency_symbol = get_awpcp_option('currency-symbol');
    if (!empty($currency_symbol)) {
        return $currency_symbol;
    }
    $currency_code = awpcp_get_currency_code();
    foreach (awpcp_currency_symbols() as $currency_symbol => $currency_codes) {
        if (in_array($currency_code, $currency_codes)) {
            return $currency_symbol;
        }
    }
    return $currency_code;
}