# HG changeset patch # User Matti Hamalainen # Date 1614084037 -7200 # Node ID fdd20366406eaffeb9c2fcd91b0cf20b294e1c92 # Parent 3f5f9d0745a6b2c9bb26b0e87660a1b5493a67b3 quotedb: Cleanups. diff -r 3f5f9d0745a6 -r fdd20366406e quotedb.tcl --- a/quotedb.tcl Tue Feb 23 13:05:25 2021 +0200 +++ b/quotedb.tcl Tue Feb 23 14:40:37 2021 +0200 @@ -121,7 +121,7 @@ # if {![qdb_sql_exec $ucmd $utable $upublic $unick $uchan $usql]} { return 0 } ### Log some data - qdb_log "Added $utable #$quoteID ($unick/$uhand@$uchan): $utext" + qdb_log "Added ${utable} #${quoteID} (${unick}/${uhand}@${uchan}): ${utext}" ### Report success to user qdb_msg $ucmd $utable $upublic $unick $uchan "add_success" [list $quoteID] @@ -283,7 +283,7 @@ set usql "UPDATE ${utable}_votes SET vote=$uvote WHERE id=$qid" if {[qdb_sql_exec $ucmd $utable $upublic $unick $uchan $usql]} { set urating [qdb_get_rating_for_id $utable $uid] - qdb_log "$uhand changed vote to $uvote on #$uid / $utable, total $urating" + qdb_log "${uhand} changed vote to ${uvote} on #${uid} / ${utable}, total ${urating}" qdb_msg $ucmd $utable $upublic $unick $uchan "vote_updated" [list $uid $uvote $urating] return 1 } else { @@ -295,7 +295,7 @@ set usql "INSERT INTO ${utable}_votes (user,urlid,vote) VALUES ('[utl_escape $uhand]',$uid,$uvote)" if {[qdb_sql_exec $ucmd $utable $upublic $unick $uchan $usql]} { set urating [qdb_get_rating_for_id $utable $uid] - qdb_log "$uhand voted $uvote on #$uid / $utable, total $urating" + qdb_log "${uhand} voted ${uvote} on #${uid} / ${utable}, total ${urating}" qdb_msg $ucmd $utable $upublic $unick $uchan "you_voted" [list $uid $uvote $urating] } } @@ -309,15 +309,15 @@ if {$uindex >= 0} { append usql " WHERE ${utable}.id=$uindex GROUP BY ${utable}.id" - qdb_log "$unick searched $utable #$uindex" + qdb_log "${unick} searched ${utable} #${uindex}" } elseif {$uindex == -1} { append usql " GROUP BY ${utable}.id ORDER BY RANDOM() LIMIT 1" - qdb_log "$unick get random $utable" + qdb_log "${unick} get random ${utable}" } elseif {$uindex == -2} { append usql " GROUP BY ${utable}.id ORDER BY ${utable}.id DESC LIMIT 1" - qdb_log "$unick get latest $utable" + qdb_log "${unick} get latest ${utable}" } else { - qdb_log "$unick invalid qdb_get $utable index value." + qdb_log "${unick} invalid qdb_show ${utable} index value." return 0 }