Changeset 9969 for trunk/periodic/notifies.php
- Timestamp:
- 04/06/09 03:52:46 (3 years ago)
- File:
-
- 1 edited
-
trunk/periodic/notifies.php (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/periodic/notifies.php
r7299 r9969 48 48 $msgs_per_start = getParam( 'msgs_per_start' ); 49 49 50 $iFullCount = (int)db_value( 'SELECT COUNT(*) FROM NotifyQueue', 0 );50 $iFullCount = (int)db_value( 'SELECT COUNT(*) FROM `sys_mail_queue`', 0 ); 51 51 if ( !$iFullCount ) exit; 52 52 … … 65 65 $nfs_res = db_res(" 66 66 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 Body73 FROM NotifyQueue74 INNER JOIN NotifyMsgsON75 ( NotifyMsgs.ID = NotifyQueue.Msg)76 INNER JOIN NotifyEmailsON77 ( 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) 78 78 WHERE 79 NotifyQueue.`From` = 'NotifyEmails' AND80 NotifyEmails.EmailFlag = 'NotifyMe'79 `sys_mail_queue`.`From` = 'NotifyEmails' AND 80 `sys_subscriptions`.EmailFlag = 'NotifyMe' 81 81 LIMIT $total_per_query 82 82 ",0 ); … … 89 89 ++$err; 90 90 if ( $row[ID1] && $row[ID2] ) 91 db_res("DELETE FROM NotifyQueueWHERE `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 ); 92 92 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"; 94 94 ++$count_ok; 95 95 if ( $count_ok >= $total_count ) break; … … 102 102 $nfs_res = db_res(" 103 103 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, 106 106 Profiles.NickName as Name, 107 107 Profiles.Email, 108 NotifyMsgs.Subj,109 NotifyMsgs.HTML as Body110 FROM NotifyQueue111 INNER JOIN NotifyMsgsON112 ( 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) 113 113 INNER JOIN Profiles ON 114 (Profiles.ID = NotifyQueue.Email)114 (Profiles.ID = `sys_mail_queue`.Email) 115 115 WHERE 116 NotifyQueue.`From` = 'Profiles' AND116 `sys_mail_queue`.`From` = 'Profiles' AND 117 117 Profiles.EmailNotify = 1 118 118 ",0 ); … … 125 125 ++$err; 126 126 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 ); 128 128 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"; 130 130 ++$count_ok; 131 131 if ( $count_ok >= $total_count ) break; … … 139 139 $nfs_res = db_res(" 140 140 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, 145 145 Profiles.NickName as Name, 146 146 Profiles.Email 147 FROM NotifyQueue147 FROM `sys_mail_queue` 148 148 INNER JOIN Profiles ON 149 (Profiles.ID = NotifyQueue.Email)149 (Profiles.ID = `sys_mail_queue`.Email) 150 150 WHERE 151 NotifyQueue.`From` = 'ProfilesMsgText' AND151 `sys_mail_queue`.`From` = 'ProfilesMsgText' AND 152 152 Profiles.EmailNotify = 1 153 153 ",0); … … 162 162 if ( !mail( $row['Email'], $row['Subj'], $body, $headers, "-f{$site['email_notify']}") ) 163 163 ++$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"; 166 166 ++$count_ok; 167 167 if ( $count_ok >= $total_count ) break;
Note: See TracChangeset
for help on using the changeset viewer.