logo

Extra Block Types (EBT) - New Layout Builder experience❗

Extra Block Types (EBT) - styled, customizable block types: Slideshows, Tabs, Cards, Accordions and many others. Built-in settings for background, DOM Box, javascript plugins. Experience the future of layout building today.

Demo EBT modules Download EBT modules

❗Extra Paragraph Types (EPT) - New Paragraphs experience

Extra Paragraph Types (EPT) - analogical paragraph based set of modules.

Demo EPT modules Download EPT modules

Scroll

Vote limit for anonymous users

22/02/2025, by Anonymous (not verified)

Hello.

Please let me know if there is a way to set a limit for anonymous users on the number of votes they can cast.

For example, there is a gallery of images, but I need the anonymous user to be able to vote for only one image - that is, just once.

 

 I tried to do it like this:

$curip = ip_address();
$result = db_query("SELECT count(vote_source) as 'count' FROM {votingapi_vote} WHERE vote_source = '$curip'");
$fetch = db_fetch_object($result);
$count = $fetch->count;

Then I tried to use it in the voting.module file and thumbs-up.tpl.php, but it doesn't work - I'm getting a server error

 

 Please advise, thanks