Add message to users with X time registered
#3
(2015-04-20, 12:17 AM)Rakes Wrote:
$plugin->add_hook('postbit', 'x_run');


function x_run(&$post) {
      if($post['regdate'] > strtotime('-2 years'))  // Make a static int afterwards
                $post['the_display_bit'] = 'omg 2 years';
}

Then add {$post['the_display_bit']} to the postbit template.

or this in the template postbit or postbit_classic

<if $post['regdate']+(60*60*24*365) <= TIME_NOW then>1 Year</if>

<if $post['regdate']+(60*60*24*730) <= TIME_NOW then>2 Years</if>

but imo a plugin is better.
Reply


Messages In This Thread
RE: Add message to users with X time registered - by Sazze - 2015-04-24, 07:59 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)