• 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!

TOPIC: Survey

Survey 11 years 18 hours ago #27478

Hello,

I try made with RSForm pro a survey only for registred users, goes some way to set the user can vote once only?

Thank you for replay.
The administrator has disabled public write access.

Survey 11 years 17 hours ago #27481

  • cosmin.cristea
  • cosmin.cristea's Avatar
  • OFFLINE
  • Platinum Boarder
  • Posts: 756
  • Thank you received: 144
This can be achieved with a custom script in "Scripts called on form display" (from Components > RSForm!Pro > Manage forms > select your form > Properties > PHP Scripts)
$max = 1;
 
$db = JFactory::getDbo();
$user = JFactory::getUser();
 
$db->setQuery("SELECT COUNT(`SubmissionId`) FROM #__rsform_submissions WHERE `UserId`='". $user->get('id')."'");
$submissions = $db->loadResult();
 
if ($submissions >= $max) {
  $formLayout = '<p>Sorry, you already voted.</p>';
}

You can define the max numbers of submissions (in your case votes) in the first line.
My help is not official customer support. To receive your support, submit a ticket by clicking here
The administrator has disabled public write access.
  • 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!