예제 #1
0
function tg_apply_builder($page_id, $post_type = 'page', $print = TRUE)
{
    $ppb_form_data_order = get_post_meta($page_id, 'ppb_form_data_order');
    $ppb_page_content = '';
    if (isset($ppb_form_data_order[0])) {
        $ppb_form_item_arr = explode(',', $ppb_form_data_order[0]);
    }
    $ppb_shortcodes = array();
    require_once get_template_directory() . "/lib/contentbuilder.shortcode.lib.php";
    //pp_debug($ppb_shortcodes);
    if (isset($ppb_form_item_arr[0]) && !empty($ppb_form_item_arr[0])) {
        $ppb_shortcode_code = '';
        foreach ($ppb_form_item_arr as $key => $ppb_form_item) {
            $ppb_form_item_data = get_post_meta($page_id, $ppb_form_item . '_data');
            $ppb_form_item_size = get_post_meta($page_id, $ppb_form_item . '_size');
            $ppb_form_item_data_obj = json_decode($ppb_form_item_data[0]);
            //pp_debug(rawurldecode($ppb_form_item_data_obj->ppb_text_content));
            $ppb_shortcode_content_name = $ppb_form_item_data_obj->shortcode . '_content';
            if (isset($ppb_form_item_data_obj->{$ppb_shortcode_content_name})) {
                $ppb_shortcode_code = '[' . $ppb_form_item_data_obj->shortcode . ' size="' . $ppb_form_item_size[0] . '" ';
                //Get shortcode title
                $ppb_shortcode_title_name = $ppb_form_item_data_obj->shortcode . '_title';
                if (isset($ppb_form_item_data_obj->{$ppb_shortcode_title_name})) {
                    $ppb_shortcode_code .= 'title="' . esc_attr(rawurldecode($ppb_form_item_data_obj->{$ppb_shortcode_title_name}), ENT_QUOTES, "UTF-8") . '" ';
                }
                //Get shortcode attributes
                if (isset($ppb_shortcodes[$ppb_form_item_data_obj->shortcode])) {
                    $ppb_shortcode_arr = $ppb_shortcodes[$ppb_form_item_data_obj->shortcode];
                    foreach ($ppb_shortcode_arr['attr'] as $attr_name => $attr_item) {
                        $ppb_shortcode_attr_name = $ppb_form_item_data_obj->shortcode . '_' . $attr_name;
                        if (isset($ppb_form_item_data_obj->{$ppb_shortcode_attr_name})) {
                            $ppb_shortcode_code .= $attr_name . '="' . esc_attr(rawurldecode($ppb_form_item_data_obj->{$ppb_shortcode_attr_name})) . '" ';
                        }
                    }
                }
                $ppb_shortcode_code .= ']' . rawurldecode($ppb_form_item_data_obj->{$ppb_shortcode_content_name}) . '[/' . $ppb_form_item_data_obj->shortcode . ']';
            } else {
                if (isset($ppb_shortcodes[$ppb_form_item_data_obj->shortcode])) {
                    $ppb_shortcode_code = '[' . $ppb_form_item_data_obj->shortcode . ' size="' . $ppb_form_item_size[0] . '" ';
                    //Get shortcode title
                    $ppb_shortcode_title_name = $ppb_form_item_data_obj->shortcode . '_title';
                    if (isset($ppb_form_item_data_obj->{$ppb_shortcode_title_name})) {
                        $ppb_shortcode_code .= 'title="' . esc_attr(rawurldecode($ppb_form_item_data_obj->{$ppb_shortcode_title_name}), ENT_QUOTES, "UTF-8") . '" ';
                    }
                    //Get shortcode attributes
                    if (isset($ppb_shortcodes[$ppb_form_item_data_obj->shortcode])) {
                        $ppb_shortcode_arr = $ppb_shortcodes[$ppb_form_item_data_obj->shortcode];
                        foreach ($ppb_shortcode_arr['attr'] as $attr_name => $attr_item) {
                            $ppb_shortcode_attr_name = $ppb_form_item_data_obj->shortcode . '_' . $attr_name;
                            if (isset($ppb_form_item_data_obj->{$ppb_shortcode_attr_name})) {
                                $ppb_shortcode_code .= $attr_name . '="' . esc_attr(rawurldecode($ppb_form_item_data_obj->{$ppb_shortcode_attr_name})) . '" ';
                            }
                        }
                    }
                    $ppb_shortcode_code .= ']';
                }
            }
            //pp_debug($ppb_shortcode_code);
            if ($print) {
                echo tg_apply_content($ppb_shortcode_code);
            } else {
                $ppb_page_content .= tg_apply_content($ppb_shortcode_code);
            }
        }
    }
    if (!$print) {
        return $ppb_page_content;
    }
}
	<div class="inner_wrapper">
	
	<div id="page_main_content" class="sidebar_content full_width">
	
	<?php 
if (empty($term)) {
    ?>
	    <?php 
    echo tg_apply_content($post->post_content);
    ?>
	<?php 
} elseif (!empty($term)) {
    $obj_term = get_term_by('slug', $term, 'tourcats');
    ?>
	    <?php 
    echo tg_apply_content($obj_term->description);
    ?>
	<?php 
}
?>
	
	<div class="page_content_wrapper">
	<?php 
//Include custom tour search feature
get_template_part("/templates/template-tour-search");
?>
	</div>
	
	<?php 
if (empty($term)) {
    ?>
function ppb_service_content_func($atts, $content)
{
    //extract short code attr
    extract(shortcode_atts(array('size' => 'one', 'slug' => '', 'title' => '', 'subtitle' => '', 'items' => 3, 'padding' => 30, 'cat' => '', 'order' => 'default', 'custom_css' => ''), $atts));
    if (!is_numeric($items)) {
        $items = 3;
    }
    $sec_id = '';
    if (!empty($slug)) {
        $sec_id = 'id="' . esc_attr($slug) . '"';
    }
    $return_html = '<div ' . $sec_id . ' class="' . esc_attr($size) . ' withpadding ';
    if (!empty($layout) && $layout == 'fullwidth') {
        $return_html .= 'fullwidth ';
    }
    $return_html .= '" ';
    $custom_css .= 'padding:' . esc_attr($padding) . 'px 0 ' . esc_attr($padding) . 'px 0;';
    if (!empty($custom_css)) {
        $return_html .= 'style="' . esc_attr(urldecode($custom_css)) . '" ';
    }
    $return_html .= '>';
    $return_html .= '<div class="page_content_wrapper"><div class="inner"> ';
    if (!empty($content)) {
        $return_html .= '<div class="one_half">';
        //Add title and content
        if (!empty($title)) {
            $return_html .= '<h2 class="ppb_title">' . urldecode($title) . '</h2>';
        }
        if (!empty($subtitle)) {
            $return_html .= '<div class="ppb_subtitle">' . urldecode($subtitle) . '</div>';
        }
        $return_html .= do_shortcode(tg_apply_content($content));
        $return_html .= '</div>';
    }
    //display service content
    $return_html .= '<div class="one_half last">';
    $return_html .= do_shortcode('[tg_service_vertical cat="' . esc_attr($cat) . '" items="' . esc_attr($items) . '" align="left"]');
    $return_html .= '</div>';
    $return_html .= '</div></div></div>';
    return $return_html;
}
    $query_string .= '&posts_per_page=-1&' . $custom_tax . '=' . $term;
}
query_posts($query_string);
//Include project filterable options
get_template_part("/templates/template-portfolio-filterable");
?>
    
<div class="inner">

	<div class="inner_wrapper nopadding">
	
	<?php 
if (!empty($post->post_content) && empty($term)) {
    ?>
	    <div class="standard_wrapper"><?php 
    echo tg_apply_content($post->post_content);
    ?>
</div><br class="clear"/><br/>
	<?php 
} elseif (!empty($term) && !empty($ob_term->description)) {
    ?>
	    <div class="standard_wrapper"><?php 
    echo esc_html($ob_term->description);
    ?>
</div><br class="clear"/><br/>
	<?php 
}
?>
	
	<div id="page_main_content" class="sidebar_content full_width nopadding fixed_column">
	
예제 #5
0
?>
    		
	    	</div>
	    	
	    	<div class="one_third center">
	    	
	    		<?php 
$pp_contact_address = get_option('pp_contact_address');
if (!empty($pp_contact_address)) {
    ?>
	    		<h4><?php 
    echo _e('Address', THEMEDOMAIN);
    ?>
</h4>
	    		<?php 
    echo tg_apply_content($pp_contact_address);
}
?>
	    		
	    		<br/><br/>
	    		<div class="contact_social">
	    			<?php 
echo do_shortcode('[tg_social_icons style="dark" size=""]');
?>
	    		</div>
	    	
	    	</div>
	    	
	    	<div class="one_third last">
	    		<h4><?php 
echo _e('Leave a message', THEMEDOMAIN);
예제 #6
0
function ppb_three_images_block_func($atts, $content)
{
    //extract short code attr
    extract(shortcode_atts(array('size' => 'one', 'title' => '', 'image_portrait' => '', 'image_portrait_align' => 'left', 'image2' => '', 'image3' => '', 'display_caption' => 1, 'custom_css' => ''), $atts));
    if (empty($image_portrait_align)) {
        $image_portrait_align = 'left';
    }
    $return_html = '<div class="' . esc_attr($size) . '" ';
    if (!empty($custom_css)) {
        $return_html .= 'style="' . urldecode(esc_attr($custom_css)) . '" ';
    }
    $return_html .= '><div class="page_content_wrapper"><div class="inner">';
    if ($image_portrait_align == 'left') {
        //First column
        $return_html .= '<div class="one_half">';
        if (!empty($image_portrait)) {
            $return_html .= '<div class="image_classic_frame expand animate"><div class="image_wrapper">';
            $return_html .= '<a href="' . esc_url($image_portrait) . '" class="img_frame"><img src="' . esc_url($image_portrait) . '" alt="" class="portfolio_img"/></a>';
            $return_html .= '</div>';
            if (!empty($display_caption)) {
                //Get image meta data
                $image_id = pp_get_image_id($image_portrait);
                $image_caption = get_post_field('post_excerpt', $image_id);
                if (!empty($image_caption)) {
                    $return_html .= '<div class="image_caption">' . $image_caption . '</div>';
                }
            }
            $return_html .= '</div>';
        }
        $return_html .= '</div>';
        //Second column
        $return_html .= '<div class="one_half last">';
        if (!empty($image2)) {
            $return_html .= '<div class="image_classic_frame expand animate"><div class="image_wrapper">';
            $return_html .= '<a href="' . esc_url($image2) . '" class="img_frame"><img src="' . esc_url($image2) . '" alt="" class="portfolio_img"/></a>';
            $return_html .= '</div>';
            if (!empty($display_caption)) {
                //Get image meta data
                $image_id = pp_get_image_id($image2);
                $image_caption = get_post_field('post_excerpt', $image_id);
                if (!empty($image_caption)) {
                    $return_html .= '<div class="image_caption">' . $image_caption . '</div>';
                }
            }
            $return_html .= '</div>';
        }
        $return_html .= '<br class="clear"/>';
        if (!empty($image3)) {
            $return_html .= '<div class="image_classic_frame expand animate"><div class="image_wrapper">';
            $return_html .= '<a href="' . esc_url($image3) . '" class="img_frame"><img src="' . esc_url($image3) . '" alt="" class="portfolio_img"/></a>';
            $return_html .= '</div>';
            if (!empty($display_caption)) {
                //Get image meta data
                $image_id = pp_get_image_id($image3);
                $image_caption = get_post_field('post_excerpt', $image_id);
                if (!empty($image_caption)) {
                    $return_html .= '<div class="image_caption">' . $image_caption . '</div>';
                }
            }
            $return_html .= '</div>';
        }
        $return_html .= '</div>';
    } else {
        //First column
        $return_html .= '<div class="one_half">';
        if (!empty($image2)) {
            $return_html .= '<div class="image_classic_frame expand animate"><div class="image_wrapper">';
            $return_html .= '<a href="' . esc_url($image2) . '" class="img_frame"><img src="' . esc_url($image2) . '" alt="" class="portfolio_img"/></a>';
            $return_html .= '</div>';
            if (!empty($display_caption)) {
                //Get image meta data
                $image_id = pp_get_image_id($image2);
                $image_caption = get_post_field('post_excerpt', $image_id);
                if (!empty($image_caption)) {
                    $return_html .= '<div class="image_caption">' . $image_caption . '</div>';
                }
            }
            $return_html .= '</div>';
        }
        $return_html .= '<br class="clear"/>';
        if (!empty($image3)) {
            $return_html .= '<div class="image_classic_frame expand animate"><div class="image_wrapper">';
            $return_html .= '<a href="' . esc_url($image3) . '" class="img_frame"><img src="' . esc_url($image3) . '" alt="" class="portfolio_img"/></a>';
            $return_html .= '</div>';
            if (!empty($display_caption)) {
                //Get image meta data
                $image_id = pp_get_image_id($image3);
                $image_caption = get_post_field('post_excerpt', $image_id);
                if (!empty($image_caption)) {
                    $return_html .= '<div class="image_caption">' . $image_caption . '</div>';
                }
            }
            $return_html .= '</div>';
        }
        $return_html .= '</div>';
        //Second column
        $return_html .= '<div class="one_half last">';
        if (!empty($image_portrait)) {
            $return_html .= '<div class="image_classic_frame expand animate"><div class="image_wrapper">';
            $return_html .= '<a href="' . esc_url($image_portrait) . '" class="img_frame"><img src="' . esc_url($image_portrait) . '" alt="" class="portfolio_img"/></a>';
            $return_html .= '</div>';
            if (!empty($display_caption)) {
                //Get image meta data
                $image_id = pp_get_image_id($image_portrait);
                $image_caption = get_post_field('post_excerpt', $image_id);
                if (!empty($image_caption)) {
                    $return_html .= '<div class="image_caption">' . $image_caption . '</div>';
                }
            }
            $return_html .= '</div>';
        }
        $return_html .= '</div>';
    }
    $return_html .= '<br class="clear"/>';
    //Display Title
    if (!empty($title)) {
        $return_html .= '<br/><br/><h2 class="ppb_title animate">' . $title . '</h2>';
    }
    //Display Content
    if (!empty($title)) {
        $return_html .= '<div class="animate">' . do_shortcode(tg_apply_content($content)) . '</div>';
    }
    $return_html .= '</div>';
    $return_html .= '</div>';
    $return_html .= '</div>';
    return $return_html;
}
function ppb_contact_func($atts, $content)
{
    //extract short code attr
    extract(shortcode_atts(array('title' => '', 'address' => '', 'background' => '', 'background_parallax' => 'none', 'custom_css' => ''), $atts));
    $return_html = '<div class="one withsmallpadding ';
    if (!empty($background)) {
        $return_html .= 'withbg ';
    }
    if (!empty($background_parallax)) {
        $return_html .= 'parallax';
    }
    $return_html .= '" ';
    $parallax_data = '';
    //Get image width and height
    $background = esc_url($background);
    $pp_background_image_id = pp_get_image_id($background);
    if (!empty($pp_background_image_id)) {
        $background_image_arr = wp_get_attachment_image_src($pp_background_image_id, 'original');
        $background_image = $background_image_arr[0];
        $background_image_width = $background_image_arr[1];
        $background_image_height = $background_image_arr[2];
    } else {
        $background_image = $background;
        $background_image_width = '';
        $background_image_height = '';
    }
    //Check parallax background
    switch ($background_parallax) {
        case 'scroll_pos':
        case 'mouse_pos':
        case 'scroll_pos':
        case 'mouse_scroll_pos':
            $parallax_data = ' data-image="' . esc_attr($background_image) . '" data-width="' . esc_attr($background_image_width) . '" data-height="' . esc_attr($background_image_height) . '"';
            break;
    }
    if ((empty($background_parallax) or $background_parallax == 'none') && !empty($background)) {
        $return_html .= 'style="background-image:url(' . $background_image . ');background-size:cover;" ';
    }
    if (!empty($custom_css)) {
        $return_html .= 'style="' . urldecode($custom_css) . '" ';
    }
    $return_html .= $parallax_data;
    $return_html .= '>';
    $return_html .= '<div class="page_content_wrapper" style="text-align:center">';
    //Display Title
    if (!empty($title)) {
        $return_html .= '<h2 class="ppb_title">' . $title . '</h2>';
    }
    //Display Content
    if (!empty($content)) {
        $return_html .= '<div class="page_caption_desc">' . $content . '</div>';
    }
    //Display Horizontal Line
    if (empty($content)) {
        $return_html .= '<br/><br/>';
    }
    $return_html .= '<div style="text-align:left">';
    //Displat address
    $return_html .= '<div class="one_half">';
    $return_html .= do_shortcode(tg_apply_content(urldecode($address)));
    $return_html .= '</div>';
    //Display contact form
    $return_html .= '<div class="one_half last">';
    //Get contact form random ID
    $custom_id = time() . rand();
    $pp_contact_form = unserialize(get_option('pp_contact_form_sort_data'));
    wp_enqueue_script("jquery.validate", get_template_directory_uri() . "/js/jquery.validate.js", false, THEMEVERSION, true);
    wp_register_script("script-contact-form", get_template_directory_uri() . "/templates/script-contact-form.php?form=" . $custom_id . '&amp;skin=dark', false, THEMEVERSION, true);
    $params = array('ajaxurl' => admin_url('admin-ajax.php'), 'ajax_nonce' => wp_create_nonce('tgajax-post-contact-nonce'));
    wp_localize_script('script-contact-form', 'tgAjax', $params);
    wp_enqueue_script("script-contact-form", get_template_directory_uri() . "/templates/script-contact-form.php?form=" . $custom_id . '&amp;skin=dark', false, THEMEVERSION, true);
    $return_html .= '<div id="reponse_msg_' . $custom_id . '" class="contact_form_response"><ul></ul></div>';
    $return_html .= '<form id="contact_form_' . $custom_id . '" class="contact_form_wrapper" method="post" action="/wp-admin/admin-ajax.php">';
    $return_html .= '<input type="hidden" id="action" name="action" value="pp_contact_mailer"/>';
    if (is_array($pp_contact_form) && !empty($pp_contact_form)) {
        foreach ($pp_contact_form as $form_input) {
            switch ($form_input) {
                case 1:
                    $return_html .= '<label for="your_name">' . __('Name *', THEMEDOMAIN) . '</label>
    				<input id="your_name" name="your_name" type="text" class="required_field" placeholder="' . __('Name *', THEMEDOMAIN) . '"/>
    				';
                    break;
                case 2:
                    $return_html .= '<label for="email">' . __('Email *', THEMEDOMAIN) . '</label>
    				<input id="email" name="email" type="text" class="required_field email" placeholder="' . __('Email *', THEMEDOMAIN) . '"/>
    				';
                    break;
                case 3:
                    $return_html .= '<label for="message">' . __('Message *', THEMEDOMAIN) . '</label>
    				<textarea id="message" name="message" rows="7" cols="10" class="required_field" style="width:91%;" placeholder="' . __('Message *', THEMEDOMAIN) . '"></textarea>
    				';
                    break;
                case 4:
                    $return_html .= '<label for="address">' . __('Address', THEMEDOMAIN) . '</label>
    				<input id="address" name="address" type="text" placeholder="' . __('Address', THEMEDOMAIN) . '"/>
    				';
                    break;
                case 5:
                    $return_html .= '<label for="phone">' . __('Phone', THEMEDOMAIN) . '</label>
    				<input id="phone" name="phone" type="text" placeholder="' . __('Phone', THEMEDOMAIN) . '"/>
    				';
                    break;
                case 6:
                    $return_html .= '<label for="mobile">' . __('Mobile', THEMEDOMAIN) . '</label>
    				<input id="mobile" name="mobile" type="text" placeholder="' . __('Mobile', THEMEDOMAIN) . '"/>
    				';
                    break;
                case 7:
                    $return_html .= '<label for="company">' . __('Company Name', THEMEDOMAIN) . '</label>
    				<input id="company" name="company" type="text" placeholder="' . __('Company Name', THEMEDOMAIN) . '"/>
    				';
                    break;
                case 8:
                    $return_html .= '<label for="country">' . __('Country', THEMEDOMAIN) . '</label>				
    				<input id="country" name="country" type="text" placeholder="' . __('Country', THEMEDOMAIN) . '"/>
    				';
                    break;
            }
        }
    }
    $pp_contact_enable_captcha = get_option('pp_contact_enable_captcha');
    if (!empty($pp_contact_enable_captcha)) {
        $return_html .= '<div id="captcha-wrap">
    		<div class="captcha-box">
    			<img src="' . get_stylesheet_directory_uri() . '/get_captcha.php" alt="" id="captcha" />
    		</div>
    		<div class="text-box">
    			<label>Type the two words:</label>
    			<input name="captcha-code" type="text" id="captcha-code">
    		</div>
    		<div class="captcha-action">
    			<img src="' . get_stylesheet_directory_uri() . '/images/refresh.jpg"  alt="" id="captcha-refresh" />
    		</div>
    	</div>
    	<br class="clear"/><br/><br/>';
    }
    $return_html .= '<br/><br/><p>
    	<input id="contact_submit_btn" type="submit" class="solidbg" value="' . __('Send', THEMEDOMAIN) . '"/>
    </p>';
    $return_html .= '</form>';
    $return_html .= '</div>';
    $return_html .= '</div>';
    $return_html .= '</div>';
    $return_html .= '</div>';
    return $return_html;
}