Changeset 16
- Timestamp:
- 10/04/06 18:17:48 (5 years ago)
- File:
-
- 1 edited
-
QuoteEngine/QuoteEngine.tcl (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
QuoteEngine/QuoteEngine.tcl
r15 r16 20 20 # connect to database 21 21 # CHANGE ME 22 set db_handle [mysqlconnect -host localhost -user notopic -password moo -db quotes] 22 proc quote_connect { } { 23 global db_handle 24 25 set db_handle [mysqlconnect -host localhost -user notopic -password moo -db quotes] 26 27 if {$db_handle != ""} { 28 return 1 29 } else { 30 return 0 31 } 32 } 23 33 24 34 # url to site … … 48 58 # maximum number of quotes to show in channel when searching before switching 49 59 # to /msg'ing the user 50 set quote_chanmax 060 set quote_chanmax 5 51 61 52 62 ### code starts here (no need to edit stuff below currently) … … 69 79 return 1 70 80 } else { 71 return 081 return [quote_connect] 72 82 } 73 83 } … … 291 301 } 292 302 293 if {$count < 5} {303 if {$count < $quote_chanmax} { 294 304 puthelp "PRIVMSG $channel :\[\002$id\002\] $quote" 295 305 } else { … … 301 311 set remaining [mysqlresult $db_handle rows?] 302 312 if {$remaining > 0} { 313 if {$count < $quote_chanmax} { 314 set command "PRIVMSG $channel :" 315 } else { 316 set command "PRIVMSG $nick :" 317 } 318 303 319 regsub "#" $channel "" chan 304 320 if {$php_page != ""} { 305 puthelp " PRIVMSG $channel :(Plus $remaining more matches: $php_page?filter=${text}&channel=${chan}&search=search)"321 puthelp "${command}(Plus $remaining more matches: $php_page?filter=${text}&channel=${chan}&search=search)" 306 322 } else { 307 puthelp " PRIVMSG $channel :Plus $remaining other matches"323 puthelp "${command}Plus $remaining other matches" 308 324 } 309 325 } else { 310 326 if {$count == 1} { 311 puthelp " PRIVMSG $channel :(All of 1 match)"327 puthelp "${command}(All of 1 match)" 312 328 } else { 313 puthelp " PRIVMSG $channel :(All of $count matches)"329 puthelp "${command}(All of $count matches)" 314 330 } 315 331 } … … 487 503 } 488 504 505 quote_connect 489 506 putlog "QuoteEngine $quote_version loaded"
Note: See TracChangeset
for help on using the changeset viewer.
