| 1 |
/*******************************************************/ |
/*******************************************************/ |
| 2 |
/* */ |
/* */ |
| 3 |
/* LeafOK Innd */ |
/* LeafOK Innbbsd */ |
| 4 |
/* Copyright (C) LeafOK.com, 2003-2004 */ |
/* Copyright (C) LeafOK.com, 2003-2005 */ |
| 5 |
/* */ |
/* */ |
| 6 |
/* Programmed by Leaf */ |
/* Programmed by Leaf */ |
| 7 |
/* E-mail:leaf@leafok.com QQ:6049044 */ |
/* E-mail:leaflet@leafok.com QQ:6049044 */ |
| 8 |
/* */ |
/* */ |
| 9 |
/* http://bbs.leafok.com */ |
/* http://bbs.leafok.com */ |
| 10 |
/* http://bbs.leafok.net */ |
/* http://bbs.leafok.net */ |
| 476 |
if (i >= step || cur_art_id >= art_end || rec_count >= step*10) |
if (i >= step || cur_art_id >= art_end || rec_count >= step*10) |
| 477 |
{ |
{ |
| 478 |
//Delete article |
//Delete article |
| 479 |
sql.Format("select AID from innd_logfile where msg_id in (%s" |
sql.Format("select AID from innd_log where msg_id in (%s" |
| 480 |
") and op='I' and cancel=0",msg_id_list); |
") and op='I' and cancel=0",msg_id_list); |
| 481 |
|
|
| 482 |
RS.Open(CRecordset::snapshot,sql,CRecordset::forwardOnly | CRecordset::readOnly); |
RS.Open(CRecordset::snapshot,sql,CRecordset::forwardOnly | CRecordset::readOnly); |
| 533 |
{ |
{ |
| 534 |
//Begin post |
//Begin post |
| 535 |
sql.Format("select bbs.*,innd_conf.group,innd_todo.ID,innd_todo.SID as doSID," |
sql.Format("select bbs.*,innd_conf.group,innd_todo.ID,innd_todo.SID as doSID," |
| 536 |
"user_list.username,subdate(bbs.sub_dt, interval '8' hour)" |
"subdate(bbs.sub_dt, interval '8' hour)" |
| 537 |
" as sub_gmt from innd_todo inner join innd_conf on" |
" as sub_gmt from innd_todo inner join innd_conf on" |
| 538 |
" innd_todo.server=innd_conf.server and innd_todo.SID=innd_conf.SID left join bbs on" |
" innd_todo.server=innd_conf.server and innd_todo.SID=innd_conf.SID left join bbs on" |
| 539 |
" innd_todo.AID=bbs.AID inner join user_list on" |
" innd_todo.AID=bbs.AID where innd_conf.out=1 and" |
|
" bbs.UID=user_list.UID where innd_conf.out=1 and" |
|
| 540 |
" innd_conf.passive_mode=0 and innd_conf.server='%s' and" |
" innd_conf.passive_mode=0 and innd_conf.server='%s' and" |
| 541 |
" bbs.visible and innd_todo.op='P' order by bbs.AID",news_server); |
" bbs.visible and innd_todo.op='P' order by bbs.AID",news_server); |
| 542 |
|
|
| 616 |
|
|
| 617 |
if (out.Left(3) == "240") // Post successfully |
if (out.Left(3) == "240") // Post successfully |
| 618 |
{ |
{ |
| 619 |
sql.Format("insert delayed into innd_logfile (AID,art_id,msg_id,op) " |
sql.Format("insert delayed into innd_log (AID,art_id,msg_id,op) " |
| 620 |
"values(%ld,0,'%s','O')",aid,msg_id); |
"values(%ld,0,'%s','O')",aid,msg_id); |
| 621 |
this->Db.ExecuteSQL(sql); |
this->Db.ExecuteSQL(sql); |
| 622 |
|
|
| 651 |
try |
try |
| 652 |
{ |
{ |
| 653 |
//Begin post |
//Begin post |
| 654 |
sql.Format("select bbs.nickname,innd_todo.ID,innd_conf.group,innd_todo.SID as doSID," |
sql.Format("select bbs.username,bbs.nickname,innd_todo.ID,innd_conf.group," |
| 655 |
"user_list.username,innd_todo.AID," |
"innd_todo.SID as doSID,innd_todo.AID," |
| 656 |
"subdate(innd_todo.dt,interval '8' hour) as dt," |
"subdate(innd_todo.dt,interval '8' hour) as dt," |
| 657 |
"innd_logfile.msg_id from innd_todo inner join innd_conf on" |
"innd_log.msg_id from innd_todo inner join innd_conf on" |
| 658 |
" innd_todo.server=innd_conf.server and innd_todo.SID=innd_conf.SID left join bbs on" |
" innd_todo.server=innd_conf.server and innd_todo.SID=innd_conf.SID left join bbs on" |
| 659 |
" innd_todo.AID=bbs.AID inner join user_list on" |
" innd_todo.AID=bbs.AID inner join innd_log on" |
| 660 |
" bbs.UID=user_list.UID inner join innd_logfile on" |
" innd_todo.AID=innd_log.AID where innd_conf.out=1 and" |
|
" innd_todo.AID=innd_logfile.AID where innd_conf.out=1 and" |
|
| 661 |
" innd_conf.passive_mode=0 and innd_conf.server='%s' and" |
" innd_conf.passive_mode=0 and innd_conf.server='%s' and" |
| 662 |
" innd_todo.op='C' and innd_logfile.cancel=0 order by innd_todo.AID",news_server); |
" innd_todo.op='C' and innd_log.cancel=0 order by innd_todo.AID",news_server); |
| 663 |
|
|
| 664 |
RS.Open(CRecordset::snapshot,sql,CRecordset::forwardOnly | CRecordset::readOnly); |
RS.Open(CRecordset::snapshot,sql,CRecordset::forwardOnly | CRecordset::readOnly); |
| 665 |
|
|
| 718 |
|
|
| 719 |
if (out.Left(3) == "240") // Post successfully |
if (out.Left(3) == "240") // Post successfully |
| 720 |
{ |
{ |
| 721 |
sql.Format("update innd_logfile set cancel=1 where msg_id='%s'",cancel_msg_id); |
sql.Format("update innd_log set cancel=1 where msg_id='%s'",cancel_msg_id); |
| 722 |
this->Db.ExecuteSQL(sql); |
this->Db.ExecuteSQL(sql); |
| 723 |
|
|
| 724 |
sql.Format("delete from innd_todo where ID=%ld",id); |
sql.Format("delete from innd_todo where ID=%ld",id); |
| 917 |
{ |
{ |
| 918 |
//Begin ihave |
//Begin ihave |
| 919 |
sql.Format("select bbs.*,innd_todo.ID,innd_conf.group,innd_todo.SID as doSID," |
sql.Format("select bbs.*,innd_todo.ID,innd_conf.group,innd_todo.SID as doSID," |
| 920 |
"user_list.username,subdate(bbs.sub_dt, interval '8' hour)" |
"subdate(bbs.sub_dt, interval '8' hour)" |
| 921 |
" as sub_gmt from innd_todo inner join innd_conf on" |
" as sub_gmt from innd_todo inner join innd_conf on" |
| 922 |
" innd_todo.server=innd_conf.server and innd_todo.SID=innd_conf.SID left join bbs on" |
" innd_todo.server=innd_conf.server and innd_todo.SID=innd_conf.SID left join bbs on" |
| 923 |
" innd_todo.AID=bbs.AID inner join user_list on" |
" innd_todo.AID=bbs.AID where innd_conf.out=1 and" |
|
" bbs.UID=user_list.UID where innd_conf.out=1 and" |
|
| 924 |
" innd_conf.passive_mode=1 and innd_conf.server='%s' and" |
" innd_conf.passive_mode=1 and innd_conf.server='%s' and" |
| 925 |
" bbs.visible and innd_todo.op='P' order by bbs.AID",news_server); |
" bbs.visible and innd_todo.op='P' order by bbs.AID",news_server); |
| 926 |
|
|
| 1000 |
|
|
| 1001 |
if (out.Left(3) == "235") // Ihave successfully |
if (out.Left(3) == "235") // Ihave successfully |
| 1002 |
{ |
{ |
| 1003 |
sql.Format("insert delayed into innd_logfile (AID,art_id,msg_id,op) " |
sql.Format("insert delayed into innd_log (AID,art_id,msg_id,op) " |
| 1004 |
"values(%ld,0,'%s','O')",aid,msg_id); |
"values(%ld,0,'%s','O')",aid,msg_id); |
| 1005 |
this->Db.ExecuteSQL(sql); |
this->Db.ExecuteSQL(sql); |
| 1006 |
|
|
| 1042 |
try |
try |
| 1043 |
{ |
{ |
| 1044 |
//Begin ihave |
//Begin ihave |
| 1045 |
sql.Format("select bbs.nickname,innd_todo.ID,innd_conf.group,innd_todo.SID as doSID," |
sql.Format("select bbs.username,bbs.nickname,innd_todo.ID,innd_conf.group," |
| 1046 |
"user_list.username,innd_todo.AID," |
"innd_todo.SID as doSID,innd_todo.AID," |
| 1047 |
"subdate(innd_todo.dt,interval '8' hour) as dt," |
"subdate(innd_todo.dt,interval '8' hour) as dt," |
| 1048 |
"innd_logfile.msg_id from innd_todo inner join innd_conf on" |
"innd_log.msg_id from innd_todo inner join innd_conf on" |
| 1049 |
" innd_todo.server=innd_conf.server and innd_todo.SID=innd_conf.SID left join bbs on" |
" innd_todo.server=innd_conf.server and innd_todo.SID=innd_conf.SID left join bbs on" |
| 1050 |
" innd_todo.AID=bbs.AID inner join user_list on" |
" innd_todo.AID=bbs.AID inner join innd_log on" |
| 1051 |
" bbs.UID=user_list.UID inner join innd_logfile on" |
" innd_todo.AID=innd_log.AID where innd_conf.out=1 and" |
|
" innd_todo.AID=innd_logfile.AID where innd_conf.out=1 and" |
|
| 1052 |
" innd_conf.passive_mode=1 and innd_conf.server='%s' and" |
" innd_conf.passive_mode=1 and innd_conf.server='%s' and" |
| 1053 |
" innd_todo.op='C' and innd_logfile.cancel=0 order by innd_todo.AID",news_server); |
" innd_todo.op='C' and innd_log.cancel=0 order by innd_todo.AID",news_server); |
| 1054 |
|
|
| 1055 |
RS.Open(CRecordset::snapshot,sql,CRecordset::forwardOnly | CRecordset::readOnly); |
RS.Open(CRecordset::snapshot,sql,CRecordset::forwardOnly | CRecordset::readOnly); |
| 1056 |
|
|
| 1109 |
|
|
| 1110 |
if (out.Left(3) == "235") // Ihave successfully |
if (out.Left(3) == "235") // Ihave successfully |
| 1111 |
{ |
{ |
| 1112 |
sql.Format("update innd_logfile set cancel=1 where msg_id='%s'",cancel_msg_id); |
sql.Format("update innd_log set cancel=1 where msg_id='%s'",cancel_msg_id); |
| 1113 |
this->Db.ExecuteSQL(sql); |
this->Db.ExecuteSQL(sql); |
| 1114 |
|
|
| 1115 |
sql.Format("delete from innd_todo where ID=%ld",id); |
sql.Format("delete from innd_todo where ID=%ld",id); |
| 1213 |
|
|
| 1214 |
try |
try |
| 1215 |
{ |
{ |
| 1216 |
syslog << logfile::log_head << "Searching article to send ..." << endl; |
// syslog << logfile::log_head << "Searching article to send ..." << endl; |
| 1217 |
|
|
| 1218 |
sql = "select count(*) as cc from innd_todo"; |
sql = "select count(*) as cc from innd_todo"; |
| 1219 |
|
|
| 1271 |
delete(p); |
delete(p); |
| 1272 |
|
|
| 1273 |
base_active::uThreadCount--; |
base_active::uThreadCount--; |
| 1274 |
syslog << logfile::log_head << "Delete send thread ... OK" << endl; |
// syslog << logfile::log_head << "Delete send thread ... OK" << endl; |
| 1275 |
} |
} |
| 1276 |
catch(CException* e) |
catch(CException* e) |
| 1277 |
{ |
{ |