I have added a custom Scheduled Task. When I try to run it by clicking Run Now to just goes to the next page and shows the name of the cron job. There is no "Done" on the page. Here is the code:
Code:
<?php
error_reporting(E_ALL & ~E_NOTICE);
if (!is_object($DB_site))
{
exit;
}
$users = $DB_site->query("
SELECT username, email, usergroupid, membergroupids, languageid, retaileremailaccept
FROM " . TABLE_PREFIX . "user
WHERE usergroupid ='9' OR membergroupids ='9'
AND retaileremailaccept = '0'
");
vbmail_start();
$row = $DB_site->num_rows($users);
if($row > 0)
{
while ($user = $DB_site->fetch_array($users))
{
$username = unhtmlspecialchars($user['username']);
$useremail = $user['email'];
eval(fetch_email_phrases('retaileremail_accept', $user['languageid']));
vbmail($useremail, $subject, $message);
}
vbmail_end();
$DB_site->query("
UPDATE " . TABLE_PREFIX . "user
SET retaileremailaccept = '1'
WHERE username = '" . addslashes($username) . "'
");
log_cron_action('Notification Email sent to: ' . $username, $nextitem);
}
?>
Any ideas why this is happening? I can run other standard vBulletin scheduled tasks.