Voting System

  • Luisserafim
  • Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 2
  • Thank you received: 0

Luisserafim created the topic: Voting System

Hi!

Can I use BF to vote?

. I want a list of projects
. 1 person can only vote 1 time in 1 project
. 1 person can only vote 2 times (different projects)
. After voting 2 times the forms are blocked or the submit button in off

Tx in advance
#232421
  • Posts: 1740
  • Karma: 62
  • Thank you received: 217

mihaela replied the topic: Voting System

Hello,

I'm not sure if I understand how would you like to have arranged voting for list of projects. Would you have a form at the end where user can vote for all projects?

If you would like to have a form like that you could limit number of submission as explained in this piece of documentation crosstec.org/en/support/online-documenta...-of-submissions.html .

Also, you might find this useful crosstec.org/en/forums/15-usage/125024-p...missions.html#230266 .

Regards,

Mihaela
#232430
  • Luisserafim
  • Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 2
  • Thank you received: 0

Luisserafim replied the topic: Voting System

Hi Mihaela!

. I have a list of 10 projects
. 1 person can only vote 2 times but just 1 vote for project, you cannot vote 2 times in the same project.
. After voting 2 times (in diferent projects) the forms are blocked or the submit button in off

Tx in advance
#233422
  • Posts: 1740
  • Karma: 62
  • Thank you received: 217

mihaela replied the topic: Voting System

Hello again,

Please take a look at this piece of documentation crosstec.org/en/support/online-documenta...-of-submissions.html to see how to limit number of submissions by user.

The code you should put in form's Advanced properties > more options> Form Pieces > Before Form:
$user = JFactory::getUser();
$db = JFactory::getDbo();
$db->setQuery('SELECT COUNT(id) FROM #__facileforms_records WHERE user_id ="'.$user->id.'" AND form = 999');
$db->loadResult();
if($db->loadResult() > 1 ){
  // replace index.php with the url to an article explaining that the max. amount has been reached
  header("Location: https://crosstec.org/en/");
  exit;
}

As for this part "1 person can only vote 2 times but just 1 vote for project, you cannot vote 2 times in the same project", in which way user votes for a certain project?
Is there a list list element with a list of projects to vote for or how is this arranged?

You should put another database query in before form piece to get the previously submitted value (for the project) and then disable that option.

Regards,

Mihalea
#233424
Moderators: ForumSupporttomeperica
Time to create page: 0.070 seconds

Community Reward

Help us to create new extensions and plugins! With only $5 you help us a lot and get unlimited download access to all of our products, professional support and even more. Get your reward now!

Read More Here

News and Updates

Get informed about new downloads, updates and more in our News and Updates newsletter.

All Extensions Subscription

Get 1 year access to all of our current and future products and 1 year of professional support -- 99€

No support per domain or website installation limits! Includes all of our current and future Joomla!® extensions, Joomla!® templates for the duration of your membership. This means, by purchasing an All Extensions Subscription you'll have it all covered!

Get it from here

3rd Party Discount - 25% Off

We help you to keep your costs under control. If you are a new member and purchased a form building tool from a different form vendor, then you'll get a 25% discount on our subscription plans.

How to receive the discount:

Send us a quick email to sales@crosstec.org with a proof of purchase (for example a paypal receipt), await payment instructions and enjoy your membership!

Community Reward

Help us to create new extensions and plugins! With only $5 you help us a lot and get unlimited download access to all of our products, professional support and even more. Get your reward now!

Read More Here