<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
	<title>Peter&#039;s Useful Crap - Topic: Login Redirect Users Registered Before X Date</title>
	<link>http://www.theblog.ca/peter-forum/peters-login-redirect/login-redirect-users-registered-before-x-date</link>
	<description><![CDATA[Useful tips on Canada, cell phones, banking, technology, WordPress, PHP and more]]></description>
	<generator>Simple:Press Version 5.5.1</generator>
	<atom:link href="http://www.theblog.ca/peter-forum/peters-login-redirect/login-redirect-users-registered-before-x-date/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>fcvolunteer on Login Redirect Users Registered Before X Date</title>
        	<link>http://www.theblog.ca/peter-forum/peters-login-redirect/login-redirect-users-registered-before-x-date#p3826</link>
        	<category>Peter's Login Redirect</category>
        	<guid isPermaLink="true">http://www.theblog.ca/peter-forum/peters-login-redirect/login-redirect-users-registered-before-x-date#p3826</guid>
        	        	<description><![CDATA[<p>I figured it out <img class="spSmiley" src="http://www.theblog.ca/wp-includes/images/smilies/icon_smile.gif" alt=":-)" class="spSmiley" />  I had installed the plugin as well so once I deleted it everything seems to work.</p>
<p>Thanks so much for the plugin and the code help!</p>
]]></description>
        	        	<pubDate>Fri, 15 Aug 2014 12:34:19 +0000</pubDate>
        </item>
        <item>
        	<title>fcvolunteer on Login Redirect Users Registered Before X Date</title>
        	<link>http://www.theblog.ca/peter-forum/peters-login-redirect/login-redirect-users-registered-before-x-date#p3824</link>
        	<category>Peter's Login Redirect</category>
        	<guid isPermaLink="true">http://www.theblog.ca/peter-forum/peters-login-redirect/login-redirect-users-registered-before-x-date#p3824</guid>
        	        	<description><![CDATA[<p>Wow! Thanks Peter, that was fast! I'm obviously making a stupid mistake because I'm getting the following error :-/</p>
<blockquote><p>Fatal error: Cannot redeclare redirectOnFirstLogin() (previously declared in /home/content/58/8803458/html/wp-content/plugins/peters_redirect_first_login_meta/peters_redirect_first_login_meta.php:11) in /home/content/58/8803458/html/wp-content/themes/JeremysJump/functions.php on line 112</p>
</blockquote>
<p>Here's my code:</p>
<p><input type="button" class="sfcodeselect" name="sfselectit4255" value="Select Code" onclick="spjSelectCode('sfcode4255');" /></p>
<div class="sfcode" id="sfcode4255">// Send new users to a special page<br />
function redirectOnFirstLogin( $redirect_to, $requested_redirect_to, $user )<br />
{<br />
    // URL to redirect to<br />
    $redirect_url = 'http://myrealurlhere.com/renew-registration';<br />
    // How many times to redirect the user<br />
    $num_redirects = 1;</p>
<p>	// If they're on the login page, don't do anything<br />
   // if( !isset( $user-&#62;user_login ) )<br />
   // {<br />
   //     return $redirect_to;<br />
   // }</p>
<p>    $key_name = 'redirect_on_first_login';<br />
    // Third parameter ensures that the result is a string<br />
    $current_redirect_value = get_user_meta( $user-&#62;ID, $key_name, true );<br />
	if( strtotime( $user-&#62;user_registered ) &#60; ( mktime( 0, 0, 0, 1, 1, 2014 ) )<br />
        &#38;&#38; ( '' == $current_redirect_value &#124;&#124; intval( $current_redirect_value ) &#60; $num_redirects )<br />
      )<br />
    {<br />
        if( '' != $current_redirect_value )<br />
        {<br />
            $num_redirects = intval( $current_redirect_value ) + 1;<br />
        }<br />
        update_user_meta( $user-&#62;ID, $key_name, $num_redirects );<br />
        return $redirect_url;<br />
    }<br />
    else<br />
    {<br />
        return $redirect_to;<br />
    }<br />
}</p>
<p>add_filter( 'login_redirect', 'redirectOnFirstLogin', 10, 3 );
</p>
</div>
]]></description>
        	        	<pubDate>Fri, 15 Aug 2014 12:11:59 +0000</pubDate>
        </item>
        <item>
        	<title>Peter on Login Redirect Users Registered Before X Date</title>
        	<link>http://www.theblog.ca/peter-forum/peters-login-redirect/login-redirect-users-registered-before-x-date#p3823</link>
        	<category>Peter's Login Redirect</category>
        	<guid isPermaLink="true">http://www.theblog.ca/peter-forum/peters-login-redirect/login-redirect-users-registered-before-x-date#p3823</guid>
        	        	<description><![CDATA[<p>Hi, you can build a date using PHP's mktime function.</p>
<p>Thus, your check can be something like this:</p>
<p>if( strtotime( $user-&#62;user_registered ) &#60; mktime( 0, 0, 0, 1, 1, 2014 ) )</p>
]]></description>
        	        	<pubDate>Fri, 15 Aug 2014 11:44:39 +0000</pubDate>
        </item>
        <item>
        	<title>fcvolunteer on Login Redirect Users Registered Before X Date</title>
        	<link>http://www.theblog.ca/peter-forum/peters-login-redirect/login-redirect-users-registered-before-x-date#p3822</link>
        	<category>Peter's Login Redirect</category>
        	<guid isPermaLink="true">http://www.theblog.ca/peter-forum/peters-login-redirect/login-redirect-users-registered-before-x-date#p3822</guid>
        	        	<description><![CDATA[<p>Hi Peter,</p>
<p>Thanks for the reply. Pardon my ignorance, I'm still a little confused about how to tweak the code. How do I get the message period to be a date instead of seconds? I need to make sure that it only redirects to my new registration form if the user has registered before 1/1/14?</p>
<p>Thanks!</p>
]]></description>
        	        	<pubDate>Fri, 15 Aug 2014 11:37:31 +0000</pubDate>
        </item>
        <item>
        	<title>Peter on Login Redirect Users Registered Before X Date</title>
        	<link>http://www.theblog.ca/peter-forum/peters-login-redirect/login-redirect-users-registered-before-x-date#p3820</link>
        	<category>Peter's Login Redirect</category>
        	<guid isPermaLink="true">http://www.theblog.ca/peter-forum/peters-login-redirect/login-redirect-users-registered-before-x-date#p3820</guid>
        	        	<description><![CDATA[<p>Hi, I think this should be possible by simply switching the comparison in the code examples in that post.</p>
<p>If you use the $user-&#62;user_registered timestamp, then you can make a comparison so that is less than a specific timestamp instead of greater than a specific timestamp.</p>
]]></description>
        	        	<pubDate>Tue, 12 Aug 2014 21:38:46 +0000</pubDate>
        </item>
        <item>
        	<title>fcvolunteer on Login Redirect Users Registered Before X Date</title>
        	<link>http://www.theblog.ca/peter-forum/peters-login-redirect/login-redirect-users-registered-before-x-date#p3819</link>
        	<category>Peter's Login Redirect</category>
        	<guid isPermaLink="true">http://www.theblog.ca/peter-forum/peters-login-redirect/login-redirect-users-registered-before-x-date#p3819</guid>
        	        	<description><![CDATA[<p>I have an event website that uses a Gravity Forms registration form to gather information, collect a registration fee, and create a username and password for my site. Once the form is submitted, they become a logged in site user. This works great for new users but I was having a problem with users who joined last year's event because they were able to bypass the registration form by logging in using their existing login info from last year and they weren't being sent to the registration form.</p>
<p>I've created a registration renewal form, that doesn't register them as a site user, and I'd like to redirect existing users to that form when they press "submit" from the login screen. I don't want new users to be redirected there when they login. I read your post: <a href="http://www.theblog.ca/wordpress-redirect-first-login"><a href="http://www.theblog.ca/wordpres" rel="nofollow">http://www.theblog.ca/wordpres</a>.....irst-login</a> and I'm wondering how I can accomplish the opposite of what you wrote here:</p>
<blockquote><p>use a date-based check so that all registered users before a certain date are ignored</p>
</blockquote>
<p>I'm trying to ignore all registered users after a certain date and only focus on those that were registered last year.</p>
<p>Hope that wasn't confusing.</p>
<p>Thanks!</p>
]]></description>
        	        	<pubDate>Tue, 12 Aug 2014 08:45:44 +0000</pubDate>
        </item>
</channel>
</rss>