Пример #1
0
            if ($campaign['send_to'] == '20' || $userinfo['adminemail'] > 0) {
                $subject = getQHPhrase($userinfo['languageid'], $campaign['template_id'], 'subject');
                $text = getQHPhrase($userinfo['languageid'], $campaign['template_id'], 'text');
                $html = getQHPhrase($userinfo['languageid'], $campaign['template_id'], 'html');
                if (!empty($subject) && !empty($text) && !empty($html)) {
                    if (sendEmail($user, $subject, $text, $html, $campaign['id'], $attachment)) {
                        insertTrack($campaign['id'], $user['email'], 'sent');
                        showDebug("Email sent to '" . $user['email'] . "' [ID: " . $user['userid'] . "]");
                        $sends++;
                        if ($sends == $vbulletin->options['qhvbmailer_sleepafter']) {
                            showDebug("Sleeping for " . $vbulletin->options['qhvbmailer_sleepamount'] . " seconds");
                            sleep($vbulletin->options['qhvbmailer_sleepamount']);
                            $sends = 0;
                        }
                    } else {
                        insertTrack($campaign['id'], $user['email'], 'failed');
                        showDebug("Email cannot be sent to '" . $user['email'] . "' [ID: " . $user['userid'] . "]", 2);
                    }
                } else {
                    showDebug("Could not get phrases for '" . $user['email'] . "' [ID: " . $user['userid'] . "]", 3);
                }
            } else {
                showDebug("'" . $user['email'] . "' [ID: " . $user['userid'] . "] does not wish to receive emails");
            }
        }
    } else {
        showDebug("Template #" . $campaign['template_id'] . " does not exist", 3);
    }
    $vbulletin->db->query_write("UPDATE " . TABLE_PREFIX . "qhvbmailer_campaigns SET send_switch='1' WHERE id='" . $campaign['id'] . "'");
    showDebug("Campaign sent [ID: " . $campaign['id'] . "]");
}
Пример #2
0
include './global.php';
global $vbulletin;
require_once DIR . '/includes/qhvbmailer_functions.php';
$vbulletin->input->clean_array_gpc('g', array('campaign_id' => TYPE_UINT, 'email' => TYPE_STR, 'u' => TYPE_STR));
$campaign_id = $vbulletin->GPC['campaign_id'];
$email = $vbulletin->GPC['email'];
$url = $vbulletin->GPC['u'];
if ($campaign_id > 0 && !empty($email)) {
    if (empty($url)) {
        insertTrack($campaign_id, $email, 'read');
        $tracks = countTracks($campaign_id, 'unique_read');
        if ($tracks == 0) {
            insertTrack($campaign_id, $email, 'unique_read');
        }
    } else {
        insertTrack($campaign_id, $email, 'link');
        header("Location: " . $url);
    }
}
/*
Please do not remove this Copyright notice.
As you see this is a free script accordingly under GPL laws and you will see
a license attached accordingly to GNU.
You may NOT rewrite another hack and release it to the vBulletin.org community
or another website using this code without our permission, So do NOT try to release a hack using any part of our code without written permission from us!
Copyright 2007, BlogToRank.com
QH vbMailer v2.1
December 2, 2007
*/
/*======================================================================*\
|| #################################################################### ||