/[LeafOK_CVS]/innwebd/base_active.cpp
ViewVC logotype

Diff of /innwebd/base_active.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.1 by sysadm, Sat Jul 3 05:21:57 2004 UTC Revision 1.6 by sysadm, Wed Dec 1 08:31:52 2004 UTC
# Line 1  Line 1 
1  /*******************************************************/  /*******************************************************/
2  /*                                                     */  /*                                                     */
3  /*  LeafOK Innd                                        */  /*  LeafOK Innbbsd                                     */
4  /*  Copyright (C) LeafOK.com, 2003-2004                */  /*  Copyright (C) LeafOK.com, 2003-2004                */
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                              */
# Line 476  int base_active::get_cancel(const char* Line 476  int base_active::get_cancel(const char*
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);
# Line 533  int base_active::post_article(const char Line 533  int base_active::post_article(const char
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    
# Line 617  int base_active::post_article(const char Line 616  int base_active::post_article(const char
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    
# Line 652  int base_active::post_cancel(const char* Line 651  int base_active::post_cancel(const char*
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    
# Line 720  int base_active::post_cancel(const char* Line 718  int base_active::post_cancel(const char*
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);
# Line 919  int base_active::ihave_article(const cha Line 917  int base_active::ihave_article(const cha
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    
# Line 1003  int base_active::ihave_article(const cha Line 1000  int base_active::ihave_article(const cha
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    
# Line 1045  int base_active::ihave_cancel(const char Line 1042  int base_active::ihave_cancel(const char
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    
# Line 1113  int base_active::ihave_cancel(const char Line 1109  int base_active::ihave_cancel(const char
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);
# Line 1217  bool base_active::check_todo_list(void) Line 1213  bool base_active::check_todo_list(void)
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    
# Line 1275  DWORD base_active::SendThread(LPVOID pPa Line 1271  DWORD base_active::SendThread(LPVOID pPa
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          {          {


Legend:
Removed lines/characters  
Changed lines/characters
  Added lines/characters

webmaster@leafok.com
ViewVC Help
Powered by ViewVC 1.3.0-beta1