summaryrefslogtreecommitdiff
path: root/submission.inc
diff options
context:
space:
mode:
Diffstat (limited to 'submission.inc')
-rw-r--r--submission.inc9
1 files changed, 4 insertions, 5 deletions
diff --git a/submission.inc b/submission.inc
index c1adcc9d8..81dfb2339 100644
--- a/submission.inc
+++ b/submission.inc
@@ -12,10 +12,10 @@ function submission_score($id) {
function submission_vote($id, $vote, $comment) {
global $user;
-
+
include "config.inc";
-
- if (!getHistory($user->history, "s$id")) {
+
+ if (!user_getHistory($user->history, "s$id")) {
### Update submission's score- and votes-field:
db_query("UPDATE stories SET score = score $vote, votes = votes + 1 WHERE id = $id");
@@ -23,8 +23,7 @@ function submission_vote($id, $vote, $comment) {
if ($comment) db_query("INSERT INTO comments (sid, author, subject, comment, hostname, timestamp) VALUES($id, $user->id, '". addslashes(substr($comment, 0, 29)) ." ...', '". addslashes($comment) ."', '". getenv("REMOTE_ADDR") ."', '". time() ."')");
### Update user's history record:
- $user->setHistory("s$id", "$vote"); // s = submission
- $user->save();
+ user_setHistory($user, "s$id", "$vote"); // s = submission
### Update story table (if required):
$result = db_query("SELECT * FROM stories WHERE id = $id");