HomeHelpTrac

Ignore:
Timestamp:
04/06/09 03:52:46 (3 years ago)
Author:
Andrey Prikaznov
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/periodic/notifies.php

    r7299 r9969  
    4848$msgs_per_start = getParam( 'msgs_per_start' ); 
    4949 
    50 $iFullCount = (int)db_value( 'SELECT COUNT(*) FROM NotifyQueue', 0 ); 
     50$iFullCount = (int)db_value( 'SELECT COUNT(*) FROM `sys_mail_queue`', 0 ); 
    5151if ( !$iFullCount ) exit; 
    5252 
     
    6565        $nfs_res = db_res(" 
    6666            SELECT 
    67                 NotifyQueue.Email as ID1, 
    68                 NotifyQueue.Msg as ID2, 
    69                 NotifyEmails.Name as Name, 
    70                 NotifyEmails.Email, 
    71                 NotifyMsgs.Subj, 
    72                 NotifyMsgs.HTML as Body 
    73             FROM NotifyQueue 
    74             INNER JOIN NotifyMsgs ON 
    75                 (NotifyMsgs.ID =  NotifyQueue.Msg) 
    76             INNER JOIN NotifyEmails ON 
    77                 (NotifyEmails.ID = NotifyQueue.Email) 
     67                `sys_mail_queue`.Email as ID1, 
     68                `sys_mail_queue`.Msg as ID2, 
     69                `sys_subscriptions`.Name as Name, 
     70                `sys_subscriptions`.Email, 
     71                `sys_mass_messages`.Subj, 
     72                `sys_mass_messages`.HTML as Body 
     73            FROM `sys_mail_queue` 
     74            INNER JOIN `sys_mass_messages` ON 
     75                (`sys_mass_messages`.ID =  `sys_mail_queue`.Msg) 
     76            INNER JOIN `sys_subscriptions` ON 
     77                (`sys_subscriptions`.ID = `sys_mail_queue`.Email) 
    7878            WHERE 
    79                 NotifyQueue.`From` = 'NotifyEmails' AND 
    80                 NotifyEmails.EmailFlag = 'NotifyMe' 
     79                `sys_mail_queue`.`From` = 'NotifyEmails' AND 
     80                `sys_subscriptions`.EmailFlag = 'NotifyMe' 
    8181            LIMIT $total_per_query 
    8282        ",0 ); 
     
    8989                ++$err; 
    9090            if ( $row[ID1] && $row[ID2] ) 
    91                 db_res("DELETE FROM NotifyQueue WHERE `Email` = $row[ID1] AND `Msg` = $row[ID2] AND `From` = 'NotifyEmails'", 0 ); 
     91                db_res("DELETE FROM `sys_mail_queue` WHERE `Email` = $row[ID1] AND `Msg` = $row[ID2] AND `From` = 'NotifyEmails'", 0 ); 
    9292            else 
    93                 echo "ERROR: while deleting from 'NotifyQueue' ( Email ID: $row[ID1], Msg ID: $row[ID2] )\n"; 
     93                echo "ERROR: while deleting from 'sys_mail_queue' ( Email ID: $row[ID1], Msg ID: $row[ID2] )\n"; 
    9494            ++$count_ok; 
    9595            if ( $count_ok >= $total_count ) break; 
     
    102102        $nfs_res = db_res(" 
    103103            SELECT 
    104                 NotifyQueue.Email as ID1, 
    105                 NotifyQueue.Msg as ID2, 
     104                `sys_mail_queue`.Email as ID1, 
     105                `sys_mail_queue`.Msg as ID2, 
    106106                Profiles.NickName as Name, 
    107107                Profiles.Email, 
    108                 NotifyMsgs.Subj, 
    109                 NotifyMsgs.HTML as Body 
    110             FROM NotifyQueue             
    111             INNER JOIN NotifyMsgs ON 
    112                 (NotifyMsgs.ID =  NotifyQueue.Msg) 
     108                `sys_mass_messages`.Subj, 
     109                `sys_mass_messages`.HTML as Body 
     110            FROM `sys_mail_queue`            
     111            INNER JOIN `sys_mass_messages` ON 
     112                (`sys_mass_messages`.ID =  `sys_mail_queue`.Msg) 
    113113            INNER JOIN Profiles ON 
    114                 (Profiles.ID = NotifyQueue.Email) 
     114                (Profiles.ID = `sys_mail_queue`.Email) 
    115115            WHERE 
    116                 NotifyQueue.`From` = 'Profiles' AND 
     116                `sys_mail_queue`.`From` = 'Profiles' AND 
    117117                Profiles.EmailNotify = 1 
    118118            ",0 ); 
     
    125125                ++$err; 
    126126            if ( $row[ID1] && $row[ID2] ) 
    127                 db_res("DELETE FROM NotifyQueue WHERE Email = $row[ID1] AND Msg = $row[ID2] AND NotifyQueue.`From` = 'Profiles'", 0 ); 
     127                db_res("DELETE FROM `sys_mail_queue` WHERE Email = $row[ID1] AND Msg = $row[ID2] AND `sys_mail_queue`.`From` = 'Profiles'", 0 ); 
    128128            else 
    129                 echo "ERROR: while deleting from 'NotifyQueue' ( Email ID: $row[ID1], Msg ID: $row[ID2] )\n"; 
     129                echo "ERROR: while deleting from 'sys_mail_queue' ( Email ID: $row[ID1], Msg ID: $row[ID2] )\n"; 
    130130            ++$count_ok; 
    131131            if ( $count_ok >= $total_count ) break; 
     
    139139        $nfs_res = db_res(" 
    140140            SELECT 
    141                 NotifyQueue.Email as ID1, 
    142                 NotifyQueue.Msg as ID2, 
    143                 NotifyQueue.MsgText as Body, 
    144                 NotifyQueue.MsgSubj as Subj, 
     141                `sys_mail_queue`.Email as ID1, 
     142                `sys_mail_queue`.Msg as ID2, 
     143                `sys_mail_queue`.MsgText as Body, 
     144                `sys_mail_queue`.MsgSubj as Subj, 
    145145                Profiles.NickName as Name, 
    146146                Profiles.Email 
    147             FROM NotifyQueue 
     147            FROM `sys_mail_queue` 
    148148            INNER JOIN Profiles ON 
    149                 (Profiles.ID = NotifyQueue.Email) 
     149                (Profiles.ID = `sys_mail_queue`.Email) 
    150150            WHERE 
    151                 NotifyQueue.`From` = 'ProfilesMsgText' AND 
     151                `sys_mail_queue`.`From` = 'ProfilesMsgText' AND 
    152152                Profiles.EmailNotify = 1 
    153153            ",0); 
     
    162162            if ( !mail( $row['Email'], $row['Subj'], $body, $headers, "-f{$site['email_notify']}") ) 
    163163                ++$err; 
    164             if ( !db_res("DELETE FROM NotifyQueue WHERE Email = $row[ID1] AND NotifyQueue.`From` = 'ProfilesMsgText'", 0 ) ) 
    165                 echo "ERROR: while deleting from 'NotifyQueue' ( Email ID: $row[ID1], Msg ID: $row[ID2] )\n"; 
     164            if ( !db_res("DELETE FROM `sys_mail_queue` WHERE Email = $row[ID1] AND `sys_mail_queue`.`From` = 'ProfilesMsgText'", 0 ) ) 
     165                echo "ERROR: while deleting from 'sys_mail_queue' ( Email ID: $row[ID1], Msg ID: $row[ID2] )\n"; 
    166166            ++$count_ok; 
    167167            if ( $count_ok >= $total_count ) break; 
Note: See TracChangeset for help on using the changeset viewer.