<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="bbPress/1.0.1" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>Gravity Support Forums Topic: limited access to a form for a logged in user,</title>
		<link>https://legacy.forums.gravityhelp.com/topic/limited-access-to-a-form-for-a-logged-in-user</link>
		<description>Gravity Support Forums Topic: limited access to a form for a logged in user,</description>
		<language>en-US</language>
		<pubDate>Sun, 19 Apr 2026 23:50:13 +0000</pubDate>
		<generator>http://bbpress.org/?v=1.0.1</generator>
		<textInput>
			<title><![CDATA[Search]]></title>
			<description><![CDATA[Search all topics from these forums.]]></description>
			<name>q</name>
			<link>https://legacy.forums.gravityhelp.com/search.php</link>
		</textInput>
		<atom:link href="https://legacy.forums.gravityhelp.com/rss/topic/limited-access-to-a-form-for-a-logged-in-user" rel="self" type="application/rss+xml" />

		<item>
			<title>Chris Hajer on "limited access to a form for a logged in user,"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/limited-access-to-a-form-for-a-logged-in-user#post-67911</link>
			<pubDate>Wed, 25 Jul 2012 13:03:51 +0000</pubDate>
			<dc:creator>Chris Hajer</dc:creator>
			<guid isPermaLink="false">67911@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Thanks a lot for posting that.  Much appreciated.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>scott@adszoom.com on "limited access to a form for a logged in user,"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/limited-access-to-a-form-for-a-logged-in-user#post-67829</link>
			<pubDate>Wed, 25 Jul 2012 03:17:49 +0000</pubDate>
			<dc:creator>scott@adszoom.com</dc:creator>
			<guid isPermaLink="false">67829@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;thanks Chris this is tested and works perfect!&#60;br /&#62;
&#60;pre&#62;&#60;code&#62;&#38;lt;?php add_action(&#38;#39;gform_pre_render_2&#38;#39;, &#38;#39;gform_limit_submissions&#38;#39;);
function gform_limit_submissions($form){
    global $wpdb;

    $limit_message = &#38;#39;&#38;lt;strong&#38;gt;Oops!&#38;lt;/strong&#38;gt; You may only submit a new classified ad&#38;lt;br /&#38;gt; every 5 minutes  and a total of 25 every 24 hours.&#38;lt;br /&#38;gt; You may want to read &#38;lt;br /&#38;gt;(&#38;lt;em&#38;gt; Posting your ads in high competition topics ....&#38;lt;/em&#38;gt; ) &#38;lt;br /&#38;gt; under (&#38;lt;em&#38;gt; Help / Edit  Ads&#38;lt;/em&#38;gt; )  tab above as you wait.&#38;lt;br /&#38;gt; Your last ads keywords selection should have bin &#38;lt;br /&#38;gt; chosen with pinpoint topic accuracy after reading&#38;lt;br /&#38;gt; this. Doing this step will make you money by&#38;lt;br /&#38;gt; putting your ads on page 1# of all search engines!&#38;lt;br /&#38;gt; &#38;lt;strong&#38;gt;Note:&#38;lt;/strong&#38;gt; If you post something in the &#38;lt;strong&#38;gt;wrong&#38;lt;/strong&#38;gt; category&#38;lt;br /&#38;gt; for example: a ( &#38;lt;em&#38;gt;house for rent&#38;lt;/em&#38;gt; ) in
( &#38;lt;em&#38;gt;services&#38;lt;/em&#38;gt;),&#38;lt;br /&#38;gt; it will be &#38;lt;strong&#38;gt;deleted&#38;lt;/strong&#38;gt; without warning within reason.&#38;lt;br /&#38;gt; You may also post &#38;lt;strong&#38;gt;duplicate&#38;lt;/strong&#38;gt; ads but change the &#38;lt;br /&#38;gt;title and keywords each time so its rated as&#38;lt;br /&#38;gt; ( &#38;lt;em&#38;gt;new content&#38;lt;/em&#38;gt; ). &#38;lt;br /&#38;gt;&#38;lt;br /&#38;gt;&#38;lt;br /&#38;gt;&#38;lt;br /&#38;gt;&#38;lt;br /&#38;gt;&#38;lt;br /&#38;gt;
&#38;lt;strong&#38;gt;Thank you&#38;lt;/strong&#38;gt; for your patients as we review your last&#38;lt;br /&#38;gt; classified ad.&#38;lt;br /&#38;gt; Less then 3 minutes to go!&#38;#39;;
    $limit_time = 300; // must be specified in seconds; 86400 seconds is equal to 24 hours

    /* You do not need to edit below this line */

    $current_user = wp_get_current_user();
    $last_submission = $wpdb-&#38;gt;get_var($wpdb-&#38;gt;prepare(&#38;quot;SELECT date_created FROM {$wpdb-&#38;gt;prefix}rg_lead WHERE created_by = %d and form_id = %d ORDER BY date_created DESC&#38;quot;, $current_user-&#38;gt;ID, $form[&#38;#39;id&#38;#39;]));

    if(empty($last_submission))
        return $form;

    $time_out = strtotime($last_submission) + $limit_time;
    $current_time = time();

    if($current_time &#38;gt; $time_out)
        return $form;

    $is_submit = rgpost(&#38;quot;is_submit_{$form[&#38;#39;id&#38;#39;]}&#38;quot;);

    if(!$is_submit) {
      add_filter(&#38;#39;gform_get_form_filter&#38;#39;, create_function(&#38;#39;&#38;#39;, &#38;quot;return &#38;#39;&#38;lt;div class=\&#38;quot;limit-message\&#38;quot;&#38;gt;$limit_message&#38;lt;/div&#38;gt;&#38;#39;;&#38;quot;) );
    }

    return $form;
}
?&#38;gt;&#60;/code&#62;&#60;/pre&#62;</description>
		</item>
		<item>
			<title>Chris Hajer on "limited access to a form for a logged in user,"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/limited-access-to-a-form-for-a-logged-in-user#post-67695</link>
			<pubDate>Tue, 24 Jul 2012 08:34:35 +0000</pubDate>
			<dc:creator>Chris Hajer</dc:creator>
			<guid isPermaLink="false">67695@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;I can't correlate line 120 to that code sample with 30 lines, but this line needs to be changed:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;[php]
add_filter(&#38;#39;gform_get_form_filter&#38;#39;, create_function(&#38;#39;&#38;#39;, &#38;quot;return &#38;#39;&#38;lt;div class=&#38;quot;limit-message&#38;quot;&#38;gt;$limit_message&#38;lt;/div&#38;gt;&#38;#39;;&#38;quot;) );&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;Change it to this:&#60;br /&#62;
&#60;pre&#62;&#60;code&#62;[php]
add_filter(&#38;#39;gform_get_form_filter&#38;#39;, create_function(&#38;#39;&#38;#39;, &#38;quot;return &#38;#39;&#38;lt;div class=\&#38;quot;limit-message\&#38;quot;&#38;gt;$limit_message&#38;lt;/div&#38;gt;&#38;#39;;&#38;quot;) );&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;The double quotes in the div need to be back slashed.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>scott@adszoom.com on "limited access to a form for a logged in user,"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/limited-access-to-a-form-for-a-logged-in-user#post-67661</link>
			<pubDate>Mon, 23 Jul 2012 23:44:50 +0000</pubDate>
			<dc:creator>scott@adszoom.com</dc:creator>
			<guid isPermaLink="false">67661@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hi &#60;/p&#62;
&#60;p&#62;Getting syntax error on line 120 &#60;/p&#62;
&#60;pre&#62;&#60;code&#62;add_filter(&#38;#39;gform_get_form_filter&#38;#39;, create_function(&#38;#39;&#38;#39;, &#38;quot;return &#38;#39;&#38;lt;div class=&#38;quot;limit-message&#38;quot;&#38;gt;$limit_message&#38;lt;/div&#38;gt;&#38;#39;;&#38;quot;) );
    }

    return $form;
}
?&#38;gt;&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;full code with changed form id only&#60;br /&#62;
&#60;pre&#62;&#60;code&#62;&#38;lt;?php add_action(&#38;#39;gform_pre_render_2&#38;#39;, &#38;#39;gform_limit_submissions&#38;#39;);
function gform_limit_submissions($form){
    global $wpdb;

    $limit_message = &#38;#39;You may only submit this form once every 24 hours.&#38;#39;;
    $limit_time = 86400; // must be specified in seconds; 86400 seconds is equal to 24 hours

    /* You do not need to edit below this line */

    $current_user = wp_get_current_user();
    $last_submission = $wpdb-&#38;gt;get_var($wpdb-&#38;gt;prepare(&#38;quot;SELECT date_created FROM {$wpdb-&#38;gt;prefix}rg_lead WHERE created_by = %d and form_id = %d ORDER BY date_created DESC&#38;quot;, $current_user-&#38;gt;ID, $form[&#38;#39;id&#38;#39;]));

    if(empty($last_submission))
        return $form;

    $time_out = strtotime($last_submission) + $limit_time;
    $current_time = time();

    if($current_time &#38;gt; $time_out)
        return $form;

    $is_submit = rgpost(&#38;quot;is_submit_{$form[&#38;#39;id&#38;#39;]}&#38;quot;);

    if(!$is_submit) {
        add_filter(&#38;#39;gform_get_form_filter&#38;#39;, create_function(&#38;#39;&#38;#39;, &#38;quot;return &#38;#39;&#38;lt;div class=&#38;quot;limit-message&#38;quot;&#38;gt;$limit_message&#38;lt;/div&#38;gt;&#38;#39;;&#38;quot;) );
    }

    return $form;
}
?&#38;gt;&#60;/code&#62;&#60;/pre&#62;</description>
		</item>
		<item>
			<title>Chris Hajer on "limited access to a form for a logged in user,"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/limited-access-to-a-form-for-a-logged-in-user#post-67641</link>
			<pubDate>Mon, 23 Jul 2012 22:12:01 +0000</pubDate>
			<dc:creator>Chris Hajer</dc:creator>
			<guid isPermaLink="false">67641@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;I'm sure it can be done.  I thought if you wanted to allow three times per 24 hours, you could limit it to once every 8 hours, but that's not equivalent (maybe I want to enter three times in 5 minutes and then come back tomorrow?)&#60;/p&#62;
&#60;p&#62;The way it works now is the time of the last submission is stored, and if that occurred less than &#34;limit_time&#34; seconds ago, prevent another submission.  To extend that, you could count submissions by this user which occurred less than &#34;limit_time&#34; seconds ago.  If there were less than &#34;submission_limit&#34; (a new variable to hold the number permitted in &#34;limit_time&#34;) entries, then allow another entry.  If the number of submissions is equal to to the &#34;submission_limit&#34;, then prevent another submission.&#60;/p&#62;
&#60;p&#62;Sounds like an interesting extension of this.  If you give it a go, please post your code here and we'l take a look.  Thanks.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>elizabethanne on "limited access to a form for a logged in user,"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/limited-access-to-a-form-for-a-logged-in-user#post-67637</link>
			<pubDate>Mon, 23 Jul 2012 21:46:14 +0000</pubDate>
			<dc:creator>elizabethanne</dc:creator>
			<guid isPermaLink="false">67637@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;this is great!  any thoughts on editing that code to limit it to x posts per time period, instead of just one per time period?  thank you!
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Chris Hajer on "limited access to a form for a logged in user,"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/limited-access-to-a-form-for-a-logged-in-user#post-67623</link>
			<pubDate>Mon, 23 Jul 2012 20:13:46 +0000</pubDate>
			<dc:creator>Chris Hajer</dc:creator>
			<guid isPermaLink="false">67623@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Sure thing.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>scott@adszoom.com on "limited access to a form for a logged in user,"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/limited-access-to-a-form-for-a-logged-in-user#post-67621</link>
			<pubDate>Mon, 23 Jul 2012 20:12:01 +0000</pubDate>
			<dc:creator>scott@adszoom.com</dc:creator>
			<guid isPermaLink="false">67621@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;thanks Chris
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Chris Hajer on "limited access to a form for a logged in user,"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/limited-access-to-a-form-for-a-logged-in-user#post-67620</link>
			<pubDate>Mon, 23 Jul 2012 20:09:40 +0000</pubDate>
			<dc:creator>Chris Hajer</dc:creator>
			<guid isPermaLink="false">67620@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Please see this.  I think it's exactly what you're looking for:&#60;br /&#62;
&#60;a href=&#34;http://gravitywiz.com/2012/04/25/limit-user-to-one-submission-per-time-period/&#34; rel=&#34;nofollow&#34;&#62;http://gravitywiz.com/2012/04/25/limit-user-to-one-submission-per-time-period/&#60;/a&#62;
&#60;/p&#62;</description>
		</item>
		<item>
			<title>scott@adszoom.com on "limited access to a form for a logged in user,"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/limited-access-to-a-form-for-a-logged-in-user#post-67617</link>
			<pubDate>Mon, 23 Jul 2012 19:57:14 +0000</pubDate>
			<dc:creator>scott@adszoom.com</dc:creator>
			<guid isPermaLink="false">67617@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Is there a way to limit the access to a form for a logged in user? &#60;/p&#62;
&#60;p&#62;Example: if the user just posted 3 new. We would like for that user to take a time out. So can the form then be un accessible to that user for a certain period? under &#34;form settings&#34; there is a &#34;limit number of entries &#34; and &#34; schedule form &#34; is it posible to make the form available for a certain amount of posts for that logged in user ? Giving the user the ability to post only say 3 posts per day?
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
