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

Diff of /innwebd/base.cpp

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

Revision 1.4 by sysadm, Sun Jul 4 06:45:23 2004 UTC Revision 1.7 by sysadm, Mon Aug 2 19:47:45 2004 UTC
# Line 276  int base::bbs_post(const CString& head, Line 276  int base::bbs_post(const CString& head,
276                                                  this->Db.ExecuteSQL(sql);                                                  this->Db.ExecuteSQL(sql);
277                                                  rid = this->last_insert_id();                                                  rid = this->last_insert_id();
278    
279                                                  //Send notification message                                                  //Send notication message
280    
281                          msg_content.Format("[hi]SYS_R_Reply_Article[/hide]"                            msg_content.Format("[hide]SYS_R_Reply_Article[/hide]"
282                                                          "有人回复了您所发表的文章,快来[url recommend_view.php?id=%ld"                                                          "有人回复了您所发表的文章,快来[url recommend_view.php?id=%ld"
283                                                          "]看看[/url]《%s》吧!\n",rid,addslashes(subject));                                                          "]看看[/url]《%s》吧!\n",rid,addslashes(subject));
284    
285                                                  RS.GetFieldValue("UID",dbVar,SQL_C_SLONG);                                                  RS.GetFieldValue("UID",dbVar,SQL_C_SLONG);
286                                                  sql.Format("insert into bbs_msg(fromUID,toUID,ntent,send_dt,send_ip)"                                                  sql.Format("insert into bbs_msg(fromUID,toUID,ntent,send_dt,send_ip)"
287                                                                  " valulues(%ld,%ld,'%s',now(),'%s')",                                                                  " values(%ld,%ld,'%s',now(),'%s')",
288                                                                  this->innd_uid,dbVar.m_lVal,addslashes(msg_content),this->hostaddr);                                                                  this->innd_uid,dbVar.m_lVal,addslashes(msg_content),this->hostaddr);
289                                                  this->Db.ExecuteSQL(sql);                                                  this->Db.ExecuteSQL(sql);
290                                          }                                          }
# Line 292  int base::bbs_post(const CString& head, Line 292  int base::bbs_post(const CString& head,
292                                  RS.Close();                                  RS.Close();
293                          }                          }
294    
295                          sql.Format("insert delayed into innd_logfile(AID,art_id,msg_id,op) values"                          sql.Format("insert delayed into innd_log(AID,art_id,msg_id,op) values"
296                                  "(%ld,%ld,'%s','I')",                                  "(%ld,%ld,'%s','I')",
297                                  aid,art_id,addslashes(msg_id));                                  aid,art_id,addslashes(msg_id));
298                          this->Db.ExecuteSQL(sql);                          this->Db.ExecuteSQL(sql);
# Line 304  int base::bbs_post(const CString& head, Line 304  int base::bbs_post(const CString& head,
304          }          }
305          catch(CException* e)          catch(CException* e)
306          {          {
307                  syslog << logfile::log_head << "Error in bbs_post()" << endl;                  char strErrMsg[1024];
308                    e->GetErrorMessage(strErrMsg,1024);
309                    syslog << logfile::log_head << "Error in bbs_post() [" << strErrMsg << "]" << endl;
310                  e->Delete();                  e->Delete();
311                  return -1;                  return -1;
312          }          }
# Line 389  int base::bbs_delete(long id) Line 391  int base::bbs_delete(long id)
391                                  this->Db.ExecuteSQL(sql);                                  this->Db.ExecuteSQL(sql);
392                          }                          }
393    
394                          sql.Format("update innd_logfile set cancel=1 where AID=%ld",id);                          sql.Format("update innd_log set cancel=1 where AID=%ld",id);
395                          this->Db.ExecuteSQL(sql);                          this->Db.ExecuteSQL(sql);
396                  }                  }
397                  RS.Close();                  RS.Close();
398          }          }
399          catch(CException* e)          catch(CException* e)
400          {          {
401                  syslog << logfile::log_head << "Getting article error in bbs_delete()" << endl;                  char strErrMsg[1024];
402                    e->GetErrorMessage(strErrMsg,1024);
403                    syslog << logfile::log_head << "Getting article error in bbs_delete() [" << strErrMsg << "]" << endl;
404                  e->Delete();                  e->Delete();
405                  return -1;                  return -1;
406          }          }
# Line 459  int base::s_receive(CString& out_str, co Line 463  int base::s_receive(CString& out_str, co
463    
464  int base::begin(void)  int base::begin(void)
465  {  {
466            HANDLE hThread;
467          ULONG ulThreadId;          ULONG ulThreadId;
468          unsigned int time_wait = 0;          unsigned int time_wait = 0;
469    
470          if (!this->IsShutdown())          if (!this->IsShutdown())
471                  return 1;                  return 1;
472    
473          if (this->hThread = CreateThread(NULL,0,(LPTHREAD_START_ROUTINE)base::Thread,(LPVOID)this,0,&ulThreadId))          if (hThread = CreateThread(NULL,0,(LPTHREAD_START_ROUTINE)base::Thread,(LPVOID)this,0,&ulThreadId))
474          {          {
475                    CloseHandle(hThread);
476                  syslog << logfile::log_head << "Create thread ... OK" << endl;                  syslog << logfile::log_head << "Create thread ... OK" << endl;
477          }          }
478          else          else


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

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