Here’s a video on how to limit the number of user votes per month.
Html bobswift |
---|
<iframe width="560" height="315" src="https://www.youtube.com/embed/dDn4eugpRH8" frameborder="0" gesture="media" allowfullscreen></iframe> |
Bitbucket file macro |
---|
showLineNumbers | true |
---|
title | LimitVotesPerMonth.sil |
---|
url | https://bitbucket.cprime.io/projects/CAP/repos/sil-script-library/raw/Screen_Listeners/LimitVotesPerMonth.sil?at=refs%2Fheads%2Fmaster |
---|
syntaxHighlighting | JavaScript |
---|
|
See also
...
Code Block |
---|
string [] votesMonth;
string userProps;
int month = month(currentDate()) - 1;
userProps = getUserProperty(currentUser(), "votesMonth");
if(isNotNull(userProps)) {
votesMonth = userProps;
if(isNotNull(votesMonth[month])) {
int count = votesMonth[month];
if(count >= 3) {
lfHide("votes");
}
}
} |