• 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: Publish/unpublish form

Publish/unpublish form 8 years 7 months ago #32464

  • info1593
  • info1593's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 14
Hi

Is it possible to set a date for publishing af form, and unpublishing it again?

If not (can't find such a thing) is there a php script I can use for this?
Thinking setting the date in the script and when you're before that date/time, you get a message about the form not online yet, and the same for when it is offline.

Hope I have explained myself good enough! ;-)

Regards
Thomas
The administrator has disabled public write access.

Publish/unpublish form 8 years 7 months ago #32472

  • cosmin.cristea
  • cosmin.cristea's Avatar
  • OFFLINE
  • Platinum Boarder
  • Posts: 756
  • Thank you received: 144
There is no built-in functionality for this scenario, however using PHP scripts called on form display you can achieve this result. You would have to get the actual date and see if it's in the "Published" timeframe. If this is false, you would need to alter the $formLayout variable

e.g.
if (!condition) {
	$formLayout = "<p>Sorry, you can't access the form during this timeframe</p>";
 }

You can find more information on PHP scripts here:

https://www.rsjoomla.com/support/documentation/rsform-pro/getting-started/php-scripts.html
My help is not official customer support. To receive your support, submit a ticket by clicking here
Last Edit: 8 years 7 months ago by cosmin.cristea.
The administrator has disabled public write access.

Publish/unpublish form 8 years 7 months ago #32478

  • info1593
  • info1593's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 14
Thanks!
I have no clue of PHP scripts :-(
Can you help me out or do you know someone that can?

Regards
Thomas
Last Edit: 8 years 7 months ago by info1593.
The administrator has disabled public write access.

Publish/unpublish form 5 years 7 months ago #38463

  • brianpeat
  • brianpeat's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 4
  • Thank you received: 1
Just to follow up on this, I found a way to have a form display a message after a certain time. It uses the server time zone, but I'm sure someone with some coding skills could also add the time zone to the check.

It goes in the "Script called on form display field"
$enddate = new DateTime('2018-11-21 23:00:00');
$now = new DateTime();
 
if($enddate < $now) {
    $formLayout = '<h2>Sorry, this contest has ended.</h2>';
}
The administrator has disabled public write access.
The following user(s) said Thank You: info1593
  • 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!