changeset 670:fdd20366406e

quotedb: Cleanups.
author Matti Hamalainen <ccr@tnsp.org>
date Tue, 23 Feb 2021 14:40:37 +0200
parents 3f5f9d0745a6
children 3904fcfeeb9a
files quotedb.tcl
diffstat 1 files changed, 7 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- 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
   }