예제 #1
0
function itro_popup_template()
{
    ?>
	<div id="itro_popup" style="visibility:hidden; display: none;">
	<?php 
    if (itro_get_option('age_restriction') == NULL) {
        if (itro_get_option('popup_time') != 0) {
            echo '<div id="popup_countdown" align="center">';
            _e('This popup will be closed in: ', 'itro-plugin');
            echo '<b id="timer"></b></div>';
        }
        $selected_cross = itroPath . 'images/close-icon.png';
        /* default image (black cross) */
        switch (itro_get_option('cross_selected')) {
            case 'white':
                $selected_cross = itroPath . 'images/close-icon-white.png';
                break;
            case 'white_border':
                $selected_cross = itroPath . 'images/close-icon-white-border.png';
                break;
        }
        echo '<img id="close_cross" src="' . $selected_cross . '" title="';
        _e('CLOSE', 'itro-plugin');
        echo '" onclick="jQuery(\'#itro_popup\').fadeOut(function(){itro_opaco.style.visibility=\'hidden\';})">';
    }
    ?>
		<div id="popup_content"><?php 
    $custom_field = stripslashes(itro_get_field('custom_html'));
    /* insert custom html code  */
    echo do_shortcode(str_replace("\r\n", '', $custom_field));
    /* return the string whitout new line */
    if (itro_get_option('age_restriction') == 'yes') {
        ?>
				<p id="age_button_area" style="text-align: center;">
					<input type="button" id="ageEnterButton" onClick="itro_set_cookie('popup_cookie','one_time_popup',<?php 
        echo itro_get_option('cookie_time_exp');
        ?>
); jQuery('#itro_popup').fadeOut(function(){itro_opaco.style.visibility='hidden';})" value="<?php 
        echo itro_get_option('enter_button_text');
        ?>
">
					<input type="button" id="ageLeaveButton" onClick="javascript:window.open('<?php 
        echo itro_get_option('leave_button_url');
        ?>
','_self');" value="<?php 
        echo itro_get_option('leave_button_text');
        ?>
">
				</p><?php 
    }
    ?>
		</div> 
	</div>
	<div id="itro_opaco" style="visibility:hidden"></div>
<?php 
}
예제 #2
0
			
			$px_opt_val[$i] = $_POST['px_' . $opt_name[$i]];
			itro_update_option( 'px_' . $opt_name[$i], $_POST['px_' . $opt_name[$i]] );
			$perc_opt_val[$i] = $_POST['perc_' . $opt_name[$i]];
			itro_update_option( 'perc_' . $opt_name[$i], $_POST['perc_' . $opt_name[$i]] );
		}
		else{ itro_update_option( 'select_' . $opt_name[$i], NULL ); }
	}
}

/* ordered field */
for($i=0;$i<count($field_name); $i++)
{
	/* Read in existing option value from database */
	
	$field_value[$i] = itro_get_field( $field_name[$i] );

	/* See if the user has posted us some information */
	/* If they did, this hidden field will be set to 'Y' */
	if( isset($_POST[ $submitted_form ]) && $_POST[ $submitted_form ] == 'Y' ) 
	{
		/* Read their posted value */
		if(isset($_POST[$field_name[$i]])) {$field_value[$i] = $_POST[ $field_name[$i] ]; }
		else{$field_value[$i] = NULL;}
		
		/* Save the posted value in the database */
		itro_update_field( $field_name[$i], $field_value[$i] );
	}
}

/* unsorted option and field */
function itro_popup_template()
{
    ?>
	<div id="itro_popup">
	<?php 
    if (itro_get_option('age_restriction') == NULL) {
        if (itro_get_option('popup_time') != 0) {
            echo '<div id="popup_countdown" align="center">';
            _e(itro_get_option('countdown_text'));
            echo '<b id="timer"></b></div>';
        }
        $selected_cross = itroPath . 'images/close-icon.png';
        /* default image (black cross) */
        switch (itro_get_option('cross_selected')) {
            case 'white':
                $selected_cross = itroPath . 'images/close-icon-white.png';
                break;
            case 'white_border':
                $selected_cross = itroPath . 'images/close-icon-white-border.png';
                break;
            case 'url':
                $selected_cross = itro_get_option('close_cross_url');
                break;
        }
        echo '<img id="close_cross" src="' . $selected_cross . '" alt="' . __('CLOSE', 'itro-plugin') . '" title="' . __('CLOSE', 'itro-plugin') . '" onclick="itro_exit_anim();">';
    }
    ?>
		<div id="popup_content"><?php 
    $custom_field = stripslashes(itro_get_field('custom_html'));
    /* insert custom html code  */
    $custom_field = str_replace("\r\n", '', $custom_field);
    _e(do_shortcode($custom_field));
    /* return the string whitout new line */
    if (itro_get_option('age_restriction') == 'yes') {
        ?>
				<p id="age_button_area" style="text-align: center;">
					<input type="button" id="ageEnterButton" onClick="itro_set_cookie('popup_cookie','one_time_popup',<?php 
        echo itro_get_option('cookie_time_exp');
        ?>
); itro_exit_anim(); javascript:window.open('<?php 
        _e(itro_get_option('enter_button_url'));
        ?>
','_self');" value="<?php 
        _e(itro_get_option('enter_button_text'));
        ?>
">
					<input type="button" id="ageLeaveButton" onClick="javascript:window.open('<?php 
        _e(itro_get_option('leave_button_url'));
        ?>
','_self');" value="<?php 
        _e(itro_get_option('leave_button_text'));
        ?>
">
				</p><?php 
    }
    ?>
		</div>
		<?php 
    if (itro_get_option('age_restriction') != 'yes') {
        ?>
		<div id="ipp_mobile_close_tab">
			<span id="ipp_mobile_close_txt"  onclick="itro_exit_anim();">CLOSE</span>
		</div> 
		<?php 
    }
    ?>
	</div>
	<div id="itro_opaco" <?php 
    if (itro_get_option('age_restriction') != 'yes' && itro_get_option('popup_unlockable') != 'yes') {
        ?>
 onclick="itro_exit_anim();" <?php 
    }
    ?>
 ></div>
<?php 
}
예제 #4
0
        $field_value = NULL;
    }
    /* Save the posted value in the database */
    itro_update_field('custom_html', $field_value);
    if (isset($_POST['selected_page_id'])) {
        $selected_page_id = json_encode($_POST['selected_page_id']);
        itro_update_option('selected_page_id', $selected_page_id);
    } else {
        itro_update_option('selected_page_id', NULL);
    }
    if (!empty($_POST['background_source'])) {
        itro_update_option('background_source', $_POST['background_source']);
    }
} else {
    //WP Editor Content
    $field_value = stripslashes(itro_get_field('custom_html'));
}
/* delete tables on plugin uninstall option */
if (isset($_POST['delete_data_hidden']) && $_POST['delete_data_hidden'] == 'Y') {
    // wp token check
    check_admin_referer('ipp_save_data', 'ipp_cleardb_nonce_fld');
    if (isset($_POST['delete_data'])) {
        itro_update_option('delete_data', $_POST['delete_data']);
    } else {
        itro_update_option('delete_data', NULL);
    }
}
/* Put an settings updated message on the screen */
if (isset($_POST[$submitted_form]) && $_POST[$submitted_form] == 'Y' || isset($_POST['delete_data_hidden']) && $_POST['delete_data_hidden'] == 'Y') {
    ?>
	<div class="updated"><p><strong><?php