Changeset 6 for QuoteEngine
- Timestamp:
- 04/30/06 16:45:44 (6 years ago)
- File:
-
- 1 edited
-
QuoteEngine/QuoteEngine.tcl (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
QuoteEngine/QuoteEngine.tcl
r1 r6 60 60 61 61 ################################################################################ 62 # quote_ping 63 # Check we're still connected to mysql 64 ################################################################################ 65 proc quote_ping { } { 66 global db_handle 67 68 if [::mysql::ping $dbhandle] { 69 return 0 70 } else { 71 return 1 72 } 73 } 74 75 ################################################################################ 62 76 # quote_add 63 77 # !addquote <text> … … 76 90 set handle $nick 77 91 } 92 93 if {![quote_ping]} { 94 putquick "PRIVMSG $channel :Sorry, lost database connection :(" 95 return 0 96 } 78 97 79 98 set sql "INSERT INTO quotes VALUES(null, " … … 114 133 if [matchattr $handle $quote_noflags] { return 0 } 115 134 135 if {![quote_ping]} { 136 putquick "PRIVMSG $channel :Sorry, lost database connection :(" 137 return 0 138 } 139 116 140 set where_clause "WHERE channel='$channel'" 117 141 if [regexp -- "--?all" $text] { … … 160 184 return 0 161 185 } 186 187 if {![quote_ping]} { 188 putquick "PRIVMSG $channel :Sorry, lost database connection :(" 189 return 0 190 } 162 191 163 192 set text [mysqlescape $text] … … 215 244 return 0 216 245 } 246 247 if {![quote_ping]} { 248 putquick "PRIVMSG $channel :Sorry, lost database connection :(" 249 return 0 250 } 217 251 218 252 set where_clause "AND channel='[mysqlescape $channel]'" … … 320 354 if [matchattr $handle $quote_noflags] { return 0 } 321 355 356 if {![quote_ping]} { 357 putquick "PRIVMSG $channel :Sorry, lost database connection :(" 358 return 0 359 } 360 322 361 set sql "SELECT COUNT(*) AS total FROM quotes WHERE channel='$channel'" 323 362 putloglev d * "QuoteEngine: executing $sql" … … 373 412 374 413 if [matchattr $handle $quote_noflags] { return 0 } 414 415 if {![quote_ping]} { 416 putquick "PRIVMSG $channel :Sorry, lost database connection :(" 417 return 0 418 } 375 419 376 420 set text [mysqlescape $text]
Note: See TracChangeset
for help on using the changeset viewer.
