Skip to content

Commit

Permalink
Changes to slashcode to count the number of times a user has comments
Browse files Browse the repository at this point in the history
moderated up or down.

Schema changes included even though there isn't a high probability of there
being a 1.0.9 release from the MAIN branch.
  • Loading branch information
Xliff committed Sep 14, 2000
1 parent 02ffed3 commit 44acab0
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 14 deletions.
16 changes: 9 additions & 7 deletions public_html/comments.pl
Expand Up @@ -871,16 +871,18 @@ sub moderateCid {
});


# Adjust comment posters karma
# Adjust comment posters info
if ($cuid > 0) {
if ($val > 0) {
sqlUpdate("users_info", { -karma => "karma$val" },
"uid=$cuid AND karma<$I{maxkarma}"
);
sqlUpdate('users_info', {
-karma => "karma$val",
-upmods=> 'upmods+1',
}, "uid=$cuid AND karma<$I{maxkarma}");
} elsif ($val < 0) {
sqlUpdate("users_info", { -karma => "karma$val" },
"uid=$cuid"
);
sqlUpdate('users_info', {
-karma => "karma$val",
-downmods=> 'downmods+1',
}, "uid=$cuid AND karma>$I{minkarma}");
}
}

Expand Down
3 changes: 3 additions & 0 deletions sql/updates/1.0.9/db_update.sql
@@ -0,0 +1,3 @@
alter table users_info add downmods int DEFAULT 0;
alter table users_info add upmods int DEFAULT 0;

16 changes: 9 additions & 7 deletions themes/slashcode/htdocs/comments.pl
Expand Up @@ -871,16 +871,18 @@ sub moderateCid {
});


# Adjust comment posters karma
# Adjust comment posters info
if ($cuid > 0) {
if ($val > 0) {
sqlUpdate("users_info", { -karma => "karma$val" },
"uid=$cuid AND karma<$I{maxkarma}"
);
sqlUpdate('users_info', {
-karma => "karma$val",
-upmods=> 'upmods+1',
}, "uid=$cuid AND karma<$I{maxkarma}");
} elsif ($val < 0) {
sqlUpdate("users_info", { -karma => "karma$val" },
"uid=$cuid"
);
sqlUpdate('users_info', {
-karma => "karma$val",
-downmods=> 'downmods+1',
}, "uid=$cuid AND karma>$I{minkarma}");
}
}

Expand Down

0 comments on commit 44acab0

Please sign in to comment.