Skip to content

Instantly share code, notes, and snippets.

Avatar

Adam Anderly anderly

View GitHub Profile
@anderly
anderly / FrmProEntriesController.php
Created Apr 9, 2012
Changed set_cookie() function to use new cookie_expiration option.
View FrmProEntriesController.php
/* AJAX */
function set_cookie($entry_id, $form_id){
global $frm_form;
$form = $frm_form->getOne($form_id);
$form->options = stripslashes_deep(maybe_unserialize($form->options));
$expires = time() + 30000000;
if ( $form->options['cookie_expiration'] == 'midnight' ) {
$expires = mktime( 23, 59, 59, date( 'm' ), date( 'd' ), date( 'y' ) );
} elseif ( $form->options['cookie_expiration'] == 'one-day-from-now' ) {
$expires = time() + 60 * 60 * 24 * 1;