コード例 #1
0
function print_blog_item($item_xml)
{
    wp_reset_query();
    global $paged;
    global $sidebar;
    global $blog_div_size_num_class;
    if (empty($paged)) {
        $paged = get_query_var('page') ? get_query_var('page') : 1;
    }
    // get the item class and size from array
    $item_type = find_xml_value($item_xml, 'item-size');
    $item_class = $blog_div_size_num_class[$item_type]['class'];
    $item_index = $blog_div_size_num_class[$item_type]['index'];
    $full_content = find_xml_value($item_xml, 'show-full-blog-post');
    if ($sidebar == "no-sidebar") {
        $item_size = $blog_div_size_num_class[$item_type]['size'];
    } else {
        if ($sidebar == "left-sidebar" || $sidebar == "right-sidebar") {
            $item_size = $blog_div_size_num_class[$item_type]['size2'];
        } else {
            $item_size = $blog_div_size_num_class[$item_type]['size3'];
        }
    }
    // get the blog meta value
    $header = find_xml_value($item_xml, 'header');
    $num_fetch = find_xml_value($item_xml, 'num-fetch');
    $num_excerpt = find_xml_value($item_xml, 'num-excerpt');
    $category = find_xml_value($item_xml, 'category');
    $category = $category == 'All' ? '' : $category;
    if (!empty($category)) {
        $category_term = get_term_by('name', $category, 'category');
        $category = $category_term->slug;
    }
    // print header
    if (!empty($header)) {
        echo '<h3 class="blog-header-title title-color mb15 gdl-title">' . $header . '</h3>';
    }
    // start fetching database
    query_posts(array('post_type' => 'post', 'paged' => $paged, 'category_name' => $category, 'posts_per_page' => $num_fetch));
    echo '<div id="blog-item-holder" class="blog-item-holder">';
    if ($item_type == '1/1 Full Thumbnail') {
        print_blog_full($item_class, $item_size, $item_index, $num_excerpt, $full_content);
    } else {
        if ($item_type == '1/1 Medium Thumbnail') {
            print_blog_medium($item_class, $item_size, $item_index, $num_excerpt);
        } else {
            if ($item_type == 'Widget Style') {
                print_blog_widget($item_class, $item_size, $item_index, $num_excerpt);
            } else {
                print_blog_grid($item_class, $item_size, $item_index, $num_excerpt);
            }
        }
    }
    echo '</div>';
    echo '<div class="clear"></div>';
    if (find_xml_value($item_xml, "pagination") == "Yes") {
        pagination();
    }
}
コード例 #2
0
ファイル: fontloader.php プロジェクト: hongviet119/dlvv
function get_uploaded_font()
{
    global $all_font;
    global $goodlayers_element;
    $upload_font_xml = get_option(THEME_SHORT_NAME . '_upload_font');
    $all_font['Custom Font'] = array('status' => 'disabled', 'type' => 'Cufon', 'is-used' => false);
    if (!empty($upload_font_xml)) {
        $xml = new DOMDocument();
        $xml->loadXML($upload_font_xml);
        foreach ($xml->documentElement->childNodes as $each_font) {
            $all_font[find_xml_value($each_font, 'name')] = array('status' => 'enabled', 'type' => 'Cufon', 'is-used' => false, 'path' => wp_get_attachment_url(find_xml_value($each_font, 'file')));
        }
    }
}
コード例 #3
0
ファイル: core.php プロジェクト: ConceptHaus/backup
function tva_ajaxdata()
{
    if (isset($_POST)) {
        $data_contents = $data_source = $type = '';
    }
    $type = isset($_POST['type']) ? $_POST['type'] : '';
    $data_source = isset($_POST['source']) ? $_POST['source'] : '';
    $query = isset($_POST['query']) ? $_POST['query'] : '';
    $data_offset = isset($_POST['data_offset']) ? $_POST['data_offset'] : '';
    $load_value = isset($_POST['load_value']) ? $_POST['load_value'] : '';
    $postlayout = isset($_POST['postlayout']) ? $_POST['postlayout'] : '';
    $grid_columns = isset($_POST['grid_columns']) ? $_POST['grid_columns'] : '';
    $config = isset($_POST['attributes']) ? $_POST['attributes'] : '';
    $attributes = !empty($config) ? explode('|', $config) : array();
    foreach ($attributes as $attribute) {
        list($key, $value) = explode(":", $attribute);
        $config_attributes[$key] = $value;
    }
    // Configuration Options
    $NV_gridcolumns = $grid_columns;
    $NV_slidercolumns = $load_value;
    $NV_groupgridcontent = !empty($config_attributes['content']) ? $config_attributes['content'] : '';
    $NV_imgwidth = !empty($config_attributes['img_width']) ? $config_attributes['img_width'] : '';
    $NV_imgheight = !empty($config_attributes['img_height']) ? $config_attributes['img_height'] : '';
    $NV_lightbox = !empty($config_attributes['lightbox']) ? $config_attributes['lightbox'] : '';
    $NV_imageeffect = !empty($config_attributes['imageeffect']) ? $config_attributes['imageeffect'] : '';
    $NV_customlayer = !empty($config_attributes['customlayer']) ? $config_attributes['customlayer'] : '';
    $NV_zoomhover = !empty($config_attributes['zoomhover']) ? $config_attributes['zoomhover'] : '';
    $NV_gridcolumns_text = !empty($NV_gridcolumns) ? $NV_slidercolumns_text = numberToWords($NV_gridcolumns) : '';
    $columnpadding = !empty($config_attributes['columnpadding']) ? $config_attributes['columnpadding'] : '';
    $NV_shortcode_id = !empty($config_attributes['shortcodeid']) ? $config_attributes['shortcodeid'] : '';
    $NV_blackwhite = '';
    if ($NV_imageeffect == 'shadowblackwhite' || $NV_imageeffect == 'frameblackwhite' || $NV_imageeffect == 'blackwhite') {
        $NV_blackwhite = 'blackwhite';
        if ($NV_imageeffect == 'shadowblackwhite') {
            $NV_imageeffect = 'shadow';
        }
        if ($NV_imageeffect == 'frameblackwhite') {
            $NV_imageeffect = 'frame';
        }
        if ($NV_imageeffect == 'blackwhite') {
            $NV_imageeffect = 'none';
        }
    }
    if ($data_source == 'data-4') {
        if (!is_array($query)) {
            $slide_sets = rtrim($query, ',');
            $slide_sets = explode(",", $query);
        } else {
            $slide_sets = implode(",", $query);
            // needed to upgrades of older versions
            $slide_sets = explode(",", $query);
        }
        $sorted_slidesets = array();
        foreach ($slide_sets as $slide_set) {
            if (is_numeric($slide_set)) {
                $slide_id = $slide_set;
                $slide_name = get_the_title($slide_set);
                $sorted_slidesets[$slide_name] = $slide_id;
            } else {
                $name = get_page_by_title($slide_set, 'OBJECT', "slide-sets");
                $slide_id = $name->ID;
                $slide_name = $slide_set;
                $sorted_slidesets[$slide_name] = $slide_id;
            }
        }
        ksort($sorted_slidesets);
        $slide_sets = $sorted_slidesets;
        $slide_set_array = array();
        $postcount = 0;
        $slidecount = 0;
        $data_id = $data_offset;
        foreach ($slide_sets as $slide_set) {
            $slide_xml = get_post_meta($slide_set, 'slide_manager_xml', true);
            $slide_data = new DOMDocument();
            $slide_data->loadXML($slide_xml);
            $slide_set = $slide_data->documentElement;
            foreach ($slide_set->childNodes as $slide) {
                // Get Attached / Post Image Data
                $get_image_src = wp_get_attachment_image_src(find_xml_value($slide, 'image'), 'full');
                // Get Image Meta Data Attachment ID
                $attachment_meta = themeva_attachment_data(find_xml_value($slide, 'image'));
                $slide_set_array[$slidecount]['img'] = $get_image_src;
                $slide_set_array[$slidecount]['img_url'] = $get_image_src[0];
                $slide_set_array[$slidecount]['media_url'] = find_xml_value($slide, 'media_url');
                $slide_set_array[$slidecount]['embed_type'] = find_xml_value($slide, 'embed_type');
                $slide_set_array[$slidecount]['autoplay'] = find_xml_value($slide, 'autoplay');
                $slide_set_array[$slidecount]['title'] = find_xml_value($slide, 'title') != '' ? find_xml_value($slide, 'title') : $attachment_meta['title'];
                $slide_set_array[$slidecount]['description'] = find_xml_value($slide, 'description') != '' ? find_xml_value($slide, 'description') : $attachment_meta['description'];
                $slide_set_array[$slidecount]['link_url'] = find_xml_value($slide, 'link_url');
                $slide_set_array[$slidecount]['css_classes'] = find_xml_value($slide, 'css_classes');
                $slide_set_array[$slidecount]['readmore_link'] = find_xml_value($slide, 'readmore_link');
                $slide_set_array[$slidecount]['timeout'] = find_xml_value($slide, 'timeout');
                $slide_set_array[$slidecount]['filter_tags'] = find_xml_value($slide, 'filter_tags');
                $slidecount++;
            }
        }
        $slide_set_array = array_slice($slide_set_array, $data_offset, $load_value);
        foreach ($slide_set_array as $slide_set) {
            $NV_disablegallink = $NV_movieurl = $NV_previewimgurl = $NV_cssclasses = $NV_galexturl = $NV_videotype = $NV_videoautoplay = $NV_posttitle = $NV_description = $NV_slidetimeout = $img = '';
            $img = $slide_set['img'];
            $NV_previewimgurl = $slide_set['img_url'];
            $NV_movieurl = $slide_set['media_url'];
            $NV_videotype = $slide_set['embed_type'];
            $NV_videoautoplay = $slide_set['autoplay'];
            $NV_posttitle = $slide_set['title'];
            $NV_description = $slide_set['description'];
            $NV_galexturl = $slide_set['link_url'];
            $NV_cssclasses = $slide_set['css_classes'];
            $NV_disablereadmore = $slide_set['readmore_link'];
            $NV_slidetimeout = $slide_set['timeout'];
            $tags_array = $slide_set['filter_tags'];
            $NV_disablegallink = empty($NV_galexturl) ? 'yes' : '';
            $NV_disablereadmore = $NV_disablereadmore == 'off' ? 'yes' : '';
            $NV_videoautoplay = $NV_videoautoplay == 'on' ? '1' : '0';
            $categories = '';
            // Enter Categories into an Array
            if (!empty($tags_array)) {
                $tags_array = str_replace(" ", "", $tags_array);
                $tags_array = explode(',', $tags_array);
                foreach ($tags_array as $tag) {
                    $categories .= $tag . $NV_shortcode_id . ',';
                }
                $replace_arr = array(' ', ',');
                $replace_with = array('_', ' ');
                $categories = str_replace($replace_arr, $replace_with, $categories);
            }
            // Assign unique video ID
            $video_id = $postcount + $data_id;
            $postcount++;
            $data_id++;
            $output = '';
            $NV_show_slider = $type;
            // Check is Timthumb is Enabled or Disabled
            if (of_get_option('timthumb_disable') != 'disable' && empty($NV_customlayer)) {
                require_once NV_FILES . '/adm/functions/BFI_Thumb.php';
                if (!empty($NV_imgwidth)) {
                    $params['width'] = $NV_imgwidth;
                }
                if (!empty($NV_imgheight)) {
                    $params['height'] = $NV_imgheight;
                }
                if ($NV_imgzoomcrop == '0') {
                    $params['crop'] = true;
                }
                if ($NV_imageeffect == 'circular') {
                    $params['height'] = $params['width'];
                }
                $NV_imagepath = bfi_thumb(dyn_getimagepath($NV_previewimgurl), $params);
            } else {
                $NV_imagepath = dyn_getimagepath($NV_previewimgurl);
            }
            require get_slider_frame($type);
            $data_contents .= $output;
        }
    }
    die($data_contents);
}
コード例 #4
0
function gdl_gallery_shortcode($atts, $content = null)
{
    extract(shortcode_atts(array('title' => '', 'width' => '200', 'height' => '200', 'margin' => '20', 'row_num' => '100', 'type' => '', 'galid' => ''), $atts));
    $gdl_gallery = "";
    $row_num = intval($row_num);
    $current_num = 1;
    $gallery_post = get_posts(array('post_type' => 'gallery', 'name' => $title, 'numberposts' => 1));
    $slider_xml_string = get_post_meta($gallery_post[0]->ID, 'post-option-gallery-xml', true);
    $slider_xml_dom = new DOMDocument();
    if (!empty($slider_xml_string)) {
        $slider_xml_dom->loadXML($slider_xml_string);
        // Normal gallery type
        if (empty($type)) {
            foreach ($slider_xml_dom->documentElement->childNodes as $slider) {
                $link_type = find_xml_value($slider, 'linktype');
                $image_url = wp_get_attachment_image_src(find_xml_value($slider, 'image'), $width . 'x' . $height);
                $alt_text = get_post_meta(find_xml_value($slider, 'image'), '_wp_attachment_image_alt', true);
                if ($current_num % $row_num == 0) {
                    $gdl_gallery = $gdl_gallery . '<div class="gallery-thumbnail-image alignleft" style="margin-bottom: ' . $margin . 'px;">';
                } else {
                    $gdl_gallery = $gdl_gallery . '<div class="gallery-thumbnail-image alignleft" style="margin-right: ' . $margin . 'px; margin-bottom: ' . $margin . 'px;">';
                }
                if ($link_type == 'Link to URL') {
                    $link = find_xml_value($slider, 'link');
                    $gdl_gallery = $gdl_gallery . '<a href="' . $link . '">';
                    $gdl_gallery = $gdl_gallery . '<img class="gdl-gallery-image" src="' . $image_url[0] . '" alt="' . $alt_text . '" />';
                    $gdl_gallery = $gdl_gallery . '</a>';
                } else {
                    if ($link_type == 'Lightbox') {
                        $image_full = wp_get_attachment_image_src(find_xml_value($slider, 'image'), 'full');
                        $gdl_gallery = $gdl_gallery . '<a data-rel="prettyPhoto[bkpGallery' . $galid . ']" href="' . $image_full[0] . '"  title="">';
                        $gdl_gallery = $gdl_gallery . '<img class="gdl-gallery-image" src="' . $image_url[0] . '" alt="' . $alt_text . '" />';
                        $gdl_gallery = $gdl_gallery . '</a>';
                    } else {
                        $gdl_gallery = $gdl_gallery . '<img class="gdl-gallery-image" src="' . $image_url[0] . '" alt="' . $alt_text . '" />';
                    }
                }
                $gdl_gallery = $gdl_gallery . '</div>';
                // gallery-thumbnail-image
                $current_num++;
            }
            $gdl_gallery = $gdl_gallery . '<div class="clear"></div>';
            // Thumbnail gallery type
        } else {
            $thumbnail_id = get_post_thumbnail_id($gallery_post[0]->ID);
            $thumbnail_full = wp_get_attachment_image_src($thumbnail_id, 'full');
            $thumbnail_url = wp_get_attachment_image_src($thumbnail_id, $width . 'x' . $height);
            $alt_text = get_post_meta($thumbnail_id, '_wp_attachment_image_alt', true);
            $gdl_gallery = $gdl_gallery . '<div class="gallery-thumbnail-image alignleft" style="margin-right: ' . $margin . 'px; margin-bottom: ' . $margin . 'px;">';
            $gdl_gallery = $gdl_gallery . '<a data-rel="prettyPhoto[bkpGallery' . $galid . ']" href="' . $thumbnail_full[0] . '" >';
            $gdl_gallery = $gdl_gallery . '<img src="' . $thumbnail_url[0] . '" alt="' . $alt_text . '" />';
            $gdl_gallery = $gdl_gallery . '</a>';
            foreach ($slider_xml_dom->documentElement->childNodes as $slider) {
                $image_full = wp_get_attachment_image_src(find_xml_value($slider, 'image'), 'full');
                $gdl_gallery = $gdl_gallery . '<a data-rel="prettyPhoto[bkpGallery' . $galid . ']" href="' . $image_full[0] . '"  title=""></a>';
            }
            $gdl_gallery = $gdl_gallery . '</div>';
        }
    }
    return $gdl_gallery;
}
コード例 #5
0
function print_panel_upload_font($title, $values)
{
    extract($values);
    ?>
		
		<div class="panel-body" id="panel-body">
			<div class="panel-body-gimmick"></div>
			<div class="panel-title panel-add-more-title">
				<?php 
    _e($title, 'gdl_back_office');
    ?>
			</div>
			<div id="add-more-font" class="add-more-font"></div>
			<br class="clear">
			<div id="added-font" class="added-font">
				<div class="default-font-item" id="font-item">
					<div class="inner-font-item">
						<div class="panel-font-title"><?php 
    _e('Font Name', 'gdl_back_office');
    ?>
</div>
						<input type="text" id="<?php 
    echo $name;
    ?>
" class="gdl_upload_font_name" readonly>
					</div>
					<div class="inner-font-item">
						<div class="panel-font-title"><?php 
    _e('Font File', 'gdl_back_office');
    ?>
</div>
						<input type="hidden" id="<?php 
    echo $file;
    ?>
"  class="font-attachment-id">
						<input type="text" class="upload-font-text" readonly>
						<input class="upload-font-button" type="button" value="Upload" />
					</div>
					<div class="panel-delete-font"></div>
				</div>
				<?php 
    if (!empty($value)) {
        $xml = new DOMDocument();
        $xml->loadXML($value);
        foreach ($xml->documentElement->childNodes as $each_font) {
            ?>
				
					<div class="font-item" id="font-item">
						<div class="inner-font-item">
							<div class="panel-font-title"><?php 
            _e('Font Name', 'gdl_back_office');
            ?>
</div>
							<input type="text" name="<?php 
            echo $name;
            ?>
[]" id="<?php 
            echo $name;
            ?>
" value="<?php 
            echo find_xml_value($each_font, 'name');
            ?>
" class="gdl_upload_font_name" readonly>
						</div>
						<div class="inner-font-item">
							<div class="panel-font-title"><?php 
            _e('Font File', 'gdl_back_office');
            ?>
</div>
							<input type="hidden" name="<?php 
            echo $file;
            ?>
[]" id="<?php 
            echo $file;
            ?>
" class="font-attachment-id" value="<?php 
            $attachment_id = find_xml_value($each_font, 'file');
            echo $attachment_id;
            ?>
" >
							<input type="text" class="upload-font-text" value="<?php 
            echo empty($attachment_id) ? '' : wp_get_attachment_url($attachment_id);
            ?>
" readonly>
							<input class="upload-font-button" type="button" value="Upload" />
						</div>
						<div class="panel-delete-font"></div>
					</div>
					
				<?php 
        }
    }
    ?>
				
			</div>
		</div>
		<?php 
}
コード例 #6
0
ファイル: meta-template.php プロジェクト: uglmee/kikiku.com
function print_image_picker($args)
{
    extract($args);
    ?>
		
			<div class="meta-body image-picker-wrapper">
				<div class="meta-input-slider">
					<div class="image-picker" id="image-picker">
						<input type='hidden' class="slider-num" id="slider-num" name='<?php 
    echo isset($name['slider-num']) ? $name['slider-num'] . '[]' : '';
    ?>
' value=<?php 
    echo empty($value) ? 0 : $value->childNodes->length;
    ?>
 />
						<div class="selected-image" id="selected-image">
							<div id="selected-image-none"></div>
							<ul>
								<li id="default" class="default">
									<div class="selected-image-wrapper">
										<img src="#"/>
										<div class="selected-image-element">
											<div id="edit-image" class="edit-image"></div>
											<div id="unpick-image" class="unpick-image"></div>
											<br class="clear">
										</div>
									</div>
									<input type="hidden" class='slider-image-url' id='<?php 
    echo $name['image'];
    ?>
' />
									<div id="slider-detail-wrapper" class="slider-detail-wrapper">
									<div id="slider-detail" class="slider-detail"> 	
										<div class="meta-title meta-detail-title"><?php 
    _e('SLIDER TITLE', 'gdl_back_office');
    ?>
</div> 
										<div class="meta-detail-input meta-input"><input type="text" id='<?php 
    echo $name['title'];
    ?>
' /></div><br class="clear">
										<hr class="separator">
										<div class="meta-title meta-detail-title"><?php 
    _e('SLIDER CAPTION', 'gdl_back_office');
    ?>
</div>
										<div class="meta-detail-input meta-input"><textarea id='<?php 
    echo $name['caption'];
    ?>
' ></textarea></div><br class="clear">
										<hr class="separator">
										<div class="meta-title meta-detail-title"><?php 
    _e('LINK TYPE', 'gdl_back_office');
    ?>
</div> 
										<div class="meta-input meta-detail-input">
											<div class="combobox">
												<select id='<?php 
    echo $name['linktype'];
    ?>
'>
													<option selected >No Link</option>
													<option>Lightbox</option>
													<option>Link to URL</option>	
													<option>Link to Video</option>
												</select>
											</div>
											<div class="meta-title meta-detail-title ml0 mt5" rel="url"><?php 
    _e('URL PATH', 'gdl_back_office');
    ?>
</div> 
											<div class="meta-title meta-detail-title ml0 mt5" rel="video"><?php 
    _e('VIDEO PATH (ONLY FOR ANYTHING SLIDER)', 'gdl_back_office');
    ?>
</div> 
											<div><input class="mt10" type="text"  id='<?php 
    echo $name['link'];
    ?>
' /></div>
										</div>
										<br class="clear">
										<div class="meta-detail-done-wrapper">
											<input type="button" id="gdl-detail-edit-done" class="gdl-button" value="Done" /><br class="clear">
										</div>
									</div>
									</div>
								</li>
								
								<?php 
    if (!empty($value)) {
        foreach ($value->childNodes as $slider) {
            ?>
 
										
											<li class="slider-image-init">
												<div class="selected-image-wrapper">
													<img src="<?php 
            $thumb_src_preview = wp_get_attachment_image_src(find_xml_value($slider, 'image'), '160x110');
            echo $thumb_src_preview[0];
            ?>
"/>
													<div class="selected-image-element">
														<div id="edit-image" class="edit-image"></div>
														<div id="unpick-image" class="unpick-image"></div>
														<br class="clear">
													</div>
												</div>
												<input type="hidden" class='slider-image-url' name='<?php 
            echo $name['image'];
            ?>
[]' id='<?php 
            echo $name['image'];
            ?>
[]' value="<?php 
            echo find_xml_value($slider, 'image');
            ?>
" /> 
												<div id="slider-detail-wrapper" class="slider-detail-wrapper">
												<div id="slider-detail" class="slider-detail">								
													<div class="meta-title meta-detail-title"><?php 
            _e('SLIDER TITLE', 'gdl_back_office');
            ?>
</div> 
													<div class="meta-detail-input meta-input"><input type="text" name='<?php 
            echo $name['title'];
            ?>
[]' id='<?php 
            echo $name['title'];
            ?>
[]' value="<?php 
            echo find_xml_value($slider, 'title');
            ?>
" /></div><br class="clear">
													<hr class="separator">
													<div class="meta-title meta-detail-title"><?php 
            _e('SLIDER CAPTION', 'gdl_back_office');
            ?>
</div>
													<div class="meta-detail-input meta-input"><textarea name='<?php 
            echo $name['caption'];
            ?>
[]' id='<?php 
            echo $name['caption'];
            ?>
[]' ><?php 
            echo find_xml_value($slider, 'caption');
            ?>
</textarea></div><br class="clear">
													<hr class="separator">
													<div class="meta-title meta-detail-title"><?php 
            _e('LINK TYPE', 'gdl_back_office');
            ?>
</div>
													<div class="meta-input meta-detail-input">
														<div class="combobox">
															<?php 
            $linktype_val = find_xml_value($slider, 'linktype');
            ?>
															<select name='<?php 
            echo $name['linktype'];
            ?>
[]' id='<?php 
            echo $name['linktype'];
            ?>
' >
																<option <?php 
            echo $linktype_val == 'No Link' ? "selected" : '';
            ?>
 >No Link</option>
																<option <?php 
            echo $linktype_val == 'Lightbox' ? "selected" : '';
            ?>
>Lightbox</option>
																<option <?php 
            echo $linktype_val == 'Link to URL' ? "selected" : '';
            ?>
>Link to URL</option>
																<option <?php 
            echo $linktype_val == 'Link to Video' ? "selected" : '';
            ?>
>Link to Video</option>
															</select>
														</div>
														<div class="meta-title meta-detail-title ml0 mt5" rel="url"><?php 
            _e('URL PATH', 'gdl_back_office');
            ?>
</div> 
														<div class="meta-title meta-detail-title ml0 mt5" rel="video"><?php 
            _e('VIDEO PATH (ONLY FOR ANYTHING SLIDER)', 'gdl_back_office');
            ?>
</div> 
														<div><input class="mt10" type="text" name='<?php 
            echo $name['link'];
            ?>
[]' id='<?php 
            echo $name['link'];
            ?>
[]' value="<?php 
            echo find_xml_value($slider, 'link');
            ?>
" /></div>
													</div>
													<br class="clear">
													<div class="meta-detail-done-wrapper">
														<input type="button" id="gdl-detail-edit-done" class="gdl-button" value="Done" /><br class="clear">
													</div>
												</div>
												</div>
												</li> 
												
											<?php 
        }
    }
    ?>
	
								
							</ul>
							<br class=clear>
							<div id="show-media" class="show-media">
								<span id="show-media-text"></span>
								<div id="show-media-image"></div>
							</div>
						</div>
						<div class="media-image-gallery-wrapper">
							<div class="media-image-gallery" id="media-image-gallery">
								<?php 
    get_media_image();
    ?>
							</div>
						</div>
					</div>
				</div>
				<br class=clear>
			</div>
			
		<?php 
}
コード例 #7
0
ファイル: page.php プロジェクト: rameyrobo/surprisebakeshop
                print_stunning_text($item_xml);
                break;
            case 'Tab':
                print_item_size(find_xml_value($item_xml, 'size'));
                print_tab_item($item_xml);
                break;
            case 'Testimonial':
                print_item_size(find_xml_value($item_xml, 'size'), 'wrapper');
                print_testimonial($item_xml);
                break;
            case 'Toggle-Box':
                print_item_size(find_xml_value($item_xml, 'size'));
                print_toggle_box_item($item_xml);
                break;
            default:
                print_item_size(find_xml_value($item_xml, 'size'));
                break;
        }
        echo "</div>";
    }
}
echo "</div>";
// end of gdl-page-item
get_sidebar('left');
echo "</div>";
// gdl-page-float-left
get_sidebar('right');
?>
			
			<br class="clear">
		</div>
コード例 #8
0
function register_non_admin_scripts()
{
    global $post, $post_id;
    global $cp_is_responsive;
    global $crunchpress_element;
    global $wp_scripts;
    $cp_page_xml = get_post_meta($post_id, 'page-option-item-xml', true);
    $slider_type = get_post_meta($post_id, "page-option-top-slider-types", true);
    $social_networking = '';
    $site_loader = '';
    $element_loader = '';
    $cp_general_settings = get_option('general_settings');
    if ($cp_general_settings != '') {
        $cp_logo = new DOMDocument();
        $cp_logo->loadXML($cp_general_settings);
        $social_networking = find_xml_value($cp_logo->documentElement, 'social_networking');
        $site_loader = find_xml_value($cp_logo->documentElement, 'site_loader');
        $element_loader = find_xml_value($cp_logo->documentElement, 'element_loader');
        $topweather_icon = find_xml_value($cp_logo->documentElement, 'topweather_icon');
    }
    wp_enqueue_script('jquery');
    wp_register_script('cp-load', CP_PATH_URL . '/frontend/js/cp_loader.js', false, '1.0', true);
    wp_localize_script('cp-load', 'loader', array('site_loader' => $site_loader, 'element_loader' => $element_loader));
    wp_enqueue_script('cp-load');
    wp_register_script('cp-underscore-min', CP_PATH_URL . '/frontend/js/underscore-min.js', false, '1.0', true);
    wp_enqueue_script('cp-underscore-min');
    $topcounter_circle = get_themeoption_value('topcounter_circle', 'general_settings');
    $countd_event_category = get_themeoption_value('countd_event_category', 'general_settings');
    $color_scheme = get_themeoption_value('color_scheme', 'general_settings');
    if (class_exists('CP_Shortcodes')) {
        if ($topcounter_circle == 'enable') {
            wp_register_script('cp-countdown', CP_PATH_URL . '/frontend/js/jquery_countdown.js', false, '1.0', true);
            wp_enqueue_script('cp-countdown');
        }
    }
    if (is_singular() && get_option('thread_comments')) {
        wp_enqueue_script('comment-reply');
    }
    //BootStrap Script Loaded
    wp_register_script('cp-bootstrap', CP_PATH_URL . '/frontend/js/bootstrap.js', array('jquery'), '1.0', true);
    wp_localize_script('cp-bootstrap', 'ajax_var', array('url' => admin_url('admin-ajax.php'), 'nonce' => wp_create_nonce('ajax-nonce')));
    wp_enqueue_script('cp-bootstrap');
    //Custom Script Loaded
    wp_register_script('cp-scripts', CP_PATH_URL . '/frontend/js/frontend_scripts.js', false, '1.0', true);
    wp_enqueue_script('cp-scripts');
    // wp_register_script('cp-jquery-mmenu-min', CP_PATH_URL.'/frontend/js/jquery-mmenu-min.js', false, '1.0', true);
    // wp_enqueue_script('cp-jquery-mmenu-min');
    $maintenance_mode = get_themeoption_value('maintenance_mode', 'general_settings');
    if ($maintenance_mode == 'enable') {
        wp_register_script('cp-countdown', CP_PATH_URL . '/frontend/js/jquery_countdown.js', false, '1.0', true);
        wp_enqueue_script('cp-countdown');
    }
    if (isset($post)) {
        $content = strip_tags(get_the_content($post_id));
        if (has_shortcode($post->post_content, 'event_counter_box')) {
            wp_register_script('cp-countdown', CP_PATH_URL . '/frontend/js/jquery_countdown.js', false, '1.0', true);
            wp_enqueue_script('cp-countdown');
        }
        if (has_shortcode($post->post_content, 'slider')) {
            wp_register_script('cp-bx-slider', CP_PATH_URL . '/frontend/shortcodes/bxslider.min.js', false, '1.0', true);
            wp_enqueue_script('cp-bx-slider');
            wp_register_script('cp-fitvids-slider', CP_PATH_URL . '/frontend/shortcodes/jquery.fitvids.js', false, '1.0', true);
            wp_enqueue_script('cp-fitvids-slider');
        }
        if (has_shortcode($post->post_content, 'counter_circle')) {
            wp_register_script('cp-easy-chart', CP_PATH_URL . '/frontend/shortcodes/easy-pie-chart.js', false, '1.0', true);
            wp_enqueue_script('cp-easy-chart');
            wp_register_script('cp-excanvas', CP_PATH_URL . '/frontend/shortcodes/excanvas.js', false, '1.0', true);
            wp_enqueue_script('cp-excanvas');
        }
        if (has_shortcode($post->post_content, 'counters_circle')) {
            wp_register_script('cp-easy-chart', CP_PATH_URL . '/frontend/shortcodes/easy-pie-chart.js', false, '1.0', true);
            wp_enqueue_script('cp-easy-chart');
            wp_register_script('cp-excanvas', CP_PATH_URL . '/frontend/shortcodes/excanvas.js', false, '1.0', true);
            wp_enqueue_script('cp-excanvas');
        }
    }
    //calling all the scripts for progress circle
    $topcounter_circle = get_themeoption_value('topcounter_circle', 'general_settings');
    $countd_event_category = get_themeoption_value('countd_event_category', 'general_settings');
    $color_scheme = get_themeoption_value('color_scheme', 'general_settings');
    if (class_exists('CP_Shortcodes')) {
        if ($topcounter_circle == 'enable') {
            wp_register_script('cp-countdown', CP_PATH_URL . '/frontend/js/jquery_countdown.js', false, '1.0', true);
            wp_enqueue_script('cp-countdown');
        }
    }
    global $wp_scripts, $post;
    wp_register_script('html5shiv', CP_PATH_URL . '/frontend/js/html5shive.js', array(), '1.5.1', false);
    wp_enqueue_script('html5shiv');
    $wp_scripts->add_data('html5shiv', 'conditional', 'lt IE 9');
    //Widget Active
    if (is_active_widget('', '', 'twitter_widget')) {
        wp_register_script('cp-bx-slider', CP_PATH_URL . '/frontend/shortcodes/bxslider.min.js', false, '1.0', true);
        wp_enqueue_script('cp-bx-slider');
        wp_register_script('cp-bx-fitdiv', CP_PATH_URL . '/frontend/js/jquery.fitvids.js', false, '1.0', true);
        wp_enqueue_script('cp-bx-fitdiv');
    }
    // Search and archive page
    if (is_search() || is_archive()) {
        // wp_register_script('cp-anything-slider', CP_PATH_URL.'/frontend/anythingslider/js/jquery.anythingslider.js', false, '1.0', true);
        // wp_enqueue_script('cp-anything-slider');
        // Post post_type
    } else {
        if (isset($post) && $post->post_type == 'sermons' && !is_home()) {
            //Jplayer Music Started
            wp_register_script('cp-jplayer', CP_PATH_URL . '/frontend/js/jquery.jplayer.min.js', false, '1.0', true);
            wp_enqueue_script('cp-jplayer');
            wp_register_script('prettyPhoto', CP_PATH_URL . '/frontend/js/jquery.prettyphoto.js', false, '1.0', true);
            wp_enqueue_script('prettyPhoto');
            wp_register_script('cp-pscript', CP_PATH_URL . '/frontend/js/pretty_script.js', false, '1.0', true);
            wp_enqueue_script('cp-pscript');
            wp_enqueue_style('prettyPhoto', CP_PATH_URL . '/frontend/css/prettyphoto.css');
        } else {
            if (isset($post) && $post->post_type == 'event' && !is_home()) {
                //Call the Countdown
                wp_register_script('cp-countdown', CP_PATH_URL . '/frontend/js/jquery_countdown.js', false, '1.0', true);
                wp_enqueue_script('cp-countdown');
            } else {
                if (isset($post) && $post->post_type == 'post' && !is_home()) {
                    if (!is_home()) {
                        $cp_post_thumbnail = '';
                        $post_detail_xml = get_post_meta($post->ID, 'post_detail_xml', true);
                        if ($post_detail_xml != '') {
                            $cp_post_xml = new DOMDocument();
                            $cp_post_xml->loadXML($post_detail_xml);
                            $cp_post_thumbnail = find_xml_value($cp_post_xml->documentElement, 'post_thumbnail');
                            if ($cp_post_thumbnail == 'Slider') {
                                wp_register_script('cp-bx-slider', CP_PATH_URL . '/frontend/js/bxslider.min.js', false, '1.0', true);
                                wp_enqueue_script('cp-bx-slider');
                                wp_register_script('cp-bx-fitdiv', CP_PATH_URL . '/frontend/js/jquery.fitvids.js', false, '1.0', true);
                                wp_enqueue_script('cp-bx-fitdiv');
                            }
                        }
                    }
                    // Page post_type
                } else {
                    if (isset($post) && $post->post_type == 'page') {
                        global $post, $cp_page_xml, $slider_type, $cp_top_slider_type;
                        $cp_page_xml = get_post_meta($post->ID, 'page-option-item-xml', true);
                        $cp_top_slider_switch = get_post_meta($post->ID, 'page-option-top-slider-on', true);
                        $slider_type = get_post_meta($post->ID, "page-option-top-slider-types", true);
                        $cp_top_slider_type = get_post_meta($post->ID, 'page-option-top-slider-types', true);
                        if (strpos($cp_page_xml, '<Column>') > -1) {
                            wp_register_script('cp-countdown', CP_PATH_URL . '/frontend/js/jquery_countdown.js', false, '1.0', true);
                            wp_enqueue_script('cp-countdown');
                            wp_register_script('cp-easy-chart', CP_PATH_URL . '/frontend/shortcodes/easy-pie-chart.js', false, '1.0', true);
                            wp_enqueue_script('cp-easy-chart');
                            wp_register_script('cp-excanvas', CP_PATH_URL . '/frontend/shortcodes/excanvas.js', false, '1.0', true);
                            wp_enqueue_script('cp-excanvas');
                            wp_register_script('cp-bx-slider', CP_PATH_URL . '/frontend/shortcodes/bxslider.min.js', false, '1.0', true);
                            wp_enqueue_script('cp-bx-slider');
                            wp_register_script('cp-bx-fitdiv', CP_PATH_URL . '/frontend/js/jquery.fitvids.js', false, '1.0', true);
                            wp_enqueue_script('cp-bx-fitdiv');
                        }
                        // if using Accordicns
                        if (strpos($cp_page_xml, '<Accordion>') > -1) {
                            wp_enqueue_script('jquery-ui-accordion');
                            wp_register_script('cp-accordian-script', CP_PATH_URL . '/frontend/js/accordian_script.js', false, '1.0', true);
                            wp_enqueue_script('cp-accordian-script');
                        }
                        // if using tabs
                        if (strpos($cp_page_xml, '<Tab>') > -1) {
                            //wp_enqueue_script('jquery-ui-accordion');
                            wp_enqueue_script('jquery-ui-tabs');
                            wp_register_script('cp-tabs-script', CP_PATH_URL . '/frontend/js/tabs_script.js', false, '1.0', true);
                            wp_enqueue_script('cp-tabs-script');
                        }
                        // if using Testimonial
                        if (strpos($cp_page_xml, '<Client-Slider>') > -1) {
                            wp_register_script('cp-content-slider', CP_PATH_URL . '/frontend/js/jquery_content_slider.js', false, '1.0', true);
                            wp_enqueue_script('cp-content-slider');
                        }
                        // if using timeline
                        if (strpos($cp_page_xml, '<Timeline>') > -1) {
                            wp_register_script('cp-bx-slider', CP_PATH_URL . '/frontend/js/bxslider.min.js', false, '1.0', true);
                            wp_enqueue_script('cp-bx-slider');
                            wp_register_script('cp-bx-fitdiv', CP_PATH_URL . '/frontend/js/jquery.fitvids.js', false, '1.0', true);
                            wp_enqueue_script('cp-bx-fitdiv');
                        }
                        if (strpos($cp_page_xml, '<Sermons>') > -1) {
                            wp_register_script('prettyPhoto', CP_PATH_URL . '/frontend/js/jquery.prettyphoto.js', false, '1.0', true);
                            wp_enqueue_script('prettyPhoto');
                            wp_register_script('cp-pscript', CP_PATH_URL . '/frontend/js/pretty_script.js', false, '1.0', true);
                            wp_enqueue_script('cp-pscript');
                            //Jplayer Music Started
                            wp_register_script('cp-jplayer', CP_PATH_URL . '/frontend/js/jquery.jplayer.min.js', false, '1.0', true);
                            wp_enqueue_script('cp-jplayer');
                            //Playlist Script
                            wp_register_script('cp-jplayer-playlist', CP_PATH_URL . '/frontend/js/jplayer.playlist.min.js', false, '1.0', true);
                            wp_enqueue_script('cp-jplayer-playlist');
                        }
                        if (strpos($cp_page_xml, '<Gallery>') > -1) {
                            wp_register_script('prettyPhoto', CP_PATH_URL . '/frontend/js/jquery.prettyphoto.js', false, '1.0', true);
                            wp_enqueue_script('prettyPhoto');
                            wp_register_script('cp-pscript', CP_PATH_URL . '/frontend/js/pretty_script.js', false, '1.0', true);
                            wp_enqueue_script('cp-pscript');
                        }
                        // If using Flex Slider
                        if (strpos($cp_page_xml, '<slider-type>Flex-Slider</slider-type>') > -1 || $slider_type == 'Flex-Slider' and $cp_top_slider_switch == 'Yes') {
                            wp_register_script('cp-flex-slider', CP_PATH_URL . '/frontend/js/jquery.flexslider.js', false, '1.0', true);
                            wp_enqueue_script('cp-flex-slider');
                        }
                        //Layer Slider Scripts
                        if (strpos($cp_page_xml, '<slider-type>Layer-Slider</slider-type>') > -1 || $slider_type == 'Layer-Slider' and $cp_top_slider_switch == 'Yes') {
                            if (class_exists('LS_Sliders')) {
                                // Include in the footer?
                                $footer = get_option('ls_include_at_footer', false) ? true : false;
                                // Register LayerSlider resources
                                wp_register_script('layerslider', LS_ROOT_URL . '/static/js/layerslider.kreaturamedia.jquery.js', array('jquery'), LS_PLUGIN_VERSION, $footer);
                                wp_register_script('greensock', LS_ROOT_URL . '/static/js/greensock.js', false, '1.11.2', $footer);
                                wp_register_script('layerslider-transitions', LS_ROOT_URL . '/static/js/layerslider.transitions.js', false, LS_PLUGIN_VERSION, $footer);
                                wp_enqueue_style('layerslider', LS_ROOT_URL . '/static/css/layerslider.css', false, LS_PLUGIN_VERSION);
                                // User resources
                                $uploads = wp_upload_dir();
                                if (file_exists($uploads['basedir'] . '/layerslider.custom.transitions.js')) {
                                    wp_register_script('ls-user-transitions', $uploads['baseurl'] . '/layerslider.custom.transitions.js', false, LS_PLUGIN_VERSION, $footer);
                                }
                                if (file_exists($uploads['basedir'] . '/layerslider.custom.css')) {
                                    wp_enqueue_style('ls-user-css', $uploads['baseurl'] . '/layerslider.custom.css', false, LS_PLUGIN_VERSION);
                                }
                                if (get_option('ls_conditional_script_loading', false) == false) {
                                    wp_enqueue_script('layerslider');
                                    wp_enqueue_script('greensock');
                                    wp_enqueue_script('layerslider-transitions');
                                    wp_enqueue_script('ls-user-transitions');
                                }
                            }
                        }
                        //Bx Slider Scripts
                        if (strpos($cp_page_xml, '<slider-type>Bx-Slider</slider-type>') > -1) {
                            wp_register_script('cp-bx-slider', CP_PATH_URL . '/frontend/js/bxslider.min.js', false, '1.0', true);
                            wp_enqueue_script('cp-bx-slider');
                            wp_register_script('cp-bx-fitdiv', CP_PATH_URL . '/frontend/js/jquery.fitvids.js', false, '1.0', true);
                            wp_enqueue_script('cp-bx-fitdiv');
                        }
                        //Bx Slider Scripts
                        if ($slider_type == 'Bx-Slider' and $cp_top_slider_switch == 'Yes') {
                            wp_register_script('cp-bx-slider', CP_PATH_URL . '/frontend/js/bxslider.min.js', false, '1.0', true);
                            wp_enqueue_script('cp-bx-slider');
                            wp_register_script('cp-bx-fitdiv', CP_PATH_URL . '/frontend/js/jquery.fitvids.js', false, '1.0', true);
                            wp_enqueue_script('cp-bx-fitdiv');
                        }
                        // If using Events
                        if (strpos($cp_page_xml, '<Events>') > -1) {
                            wp_register_script('cp-countdown', CP_PATH_URL . '/frontend/js/jquery_countdown.js', false, '1.0', true);
                            wp_enqueue_script('cp-countdown');
                        }
                        // ifcp_top_slider_switch = get_post_meta($post->ID,'page-option-top-slider-on', true); using Accordicns
                        if (strpos($cp_page_xml, '<Accordion>') > -1) {
                            wp_enqueue_script('jquery-ui-accordion');
                            wp_register_script('cp-accordian-script', CP_PATH_URL . '/frontend/js/accordian_script.js', false, '1.0', true);
                            wp_enqueue_script('cp-accordian-script');
                        }
                        // If using Anything Slider
                        if (strpos($cp_page_xml, '<slider-type>Anything</slider-type>') == 233 || $slider_type == 'Anything' and $cp_top_slider_switch == 'Yes') {
                            wp_register_script('cp-anything-slider', CP_PATH_URL . '/frontend/anythingslider/js/jquery.anythingslider.js', false, '1.0', true);
                            wp_enqueue_script('cp-anything-slider');
                            wp_register_script('cp-anything-slider-fx', CP_PATH_URL . '/frontend/anythingslider/js/jquery.anythingslider.fx.js', false, '1.0', true);
                            wp_enqueue_script('cp-anything-slider-fx');
                        }
                        // If using NewsSlider
                        if (strpos($cp_page_xml, '<News-Slider>') > -1) {
                            wp_register_script('cp-bx-slider', CP_PATH_URL . '/frontend/js/bxslider.min.js', false, '1.0', true);
                            wp_enqueue_script('cp-bx-slider');
                            wp_register_script('cp-bx-fitdiv', CP_PATH_URL . '/frontend/js/jquery.fitvids.js', false, '1.0', true);
                            wp_enqueue_script('cp-bx-fitdiv');
                        }
                        // If using filterable plugin
                        if (strpos($cp_page_xml, '<show-filterable>Yes</show-filterable>') > -1) {
                            wp_register_script('filterable', CP_PATH_URL . '/frontend/js/jquery-filterable.js', false, '1.0', true);
                            wp_enqueue_script('filterable');
                        }
                        // If using filterable plugin
                        if (strpos($cp_page_xml, '<filterable>Yes</filterable>') > -1) {
                            wp_register_script('filterable', CP_PATH_URL . '/frontend/js/jquery-filterable.js', false, '1.0', true);
                            wp_enqueue_script('filterable');
                            wp_register_script('jquery-easing-1.3', CP_PATH_URL . '/frontend/js/jquery-easing-1.3.js', false, '1.0', true);
                            wp_enqueue_script('jquery-easing-1.3');
                        }
                        if (strpos($cp_page_xml, '<eventview>Calendar View</eventview>') > -1) {
                            wp_register_script('cp-calender-view', CP_PATH_URL . '/framework/javascript/fullcalendar/fullcalendar.js', false, '1.0', true);
                            wp_enqueue_script('cp-calender-view');
                        }
                    }
                }
            }
        }
    }
}
コード例 #9
0
ファイル: cp-option.php プロジェクト: pcco/portal-redesign
function general_options()
{
    foreach ($_REQUEST as $keys => $values) {
        ${$keys} = trim($values);
    }
    $return_data = array('success' => '-1', 'alert' => 'Save option failed, please try contacting your host provider to increase the post_max_size and suhosin.post.max_vars varialble on the server.');
    ?>
<div class="cp-wrapper bootstrap_admin cp-margin-left"> 

    <!--content area start -->	  
	<div class="hbg top_navigation row-fluid">
		<div class="cp-logo span2">
			<img src="<?php 
    echo CP_PATH_URL;
    ?>
/framework/images/logo.png" class="logo" alt="logo" />
		</div>
		<div class="sidebar span10">
			<?php 
    echo top_navigation_html_tooltip();
    ?>
		</div>
	 <?php 
    //echo top_navigation_html();
    ?>
	</div>
	<div class="content-area-main row-fluid"> 
	 
      <!--sidebar start -->
      <div class="sidebar-wraper span2">
        <div class="sidebar-sublinks">
          <ul id="wp_t_o_right_menu">
            <li id="active_tab" class="logo" >
              <?php 
    _e('Logo Settings', 'crunchpress');
    ?>
            </li>
            <li class="color_style">
              <?php 
    _e('Style & Color Scheme', 'crunchpress');
    ?>
              </li>
            <li class="hr_settings">
              <?php 
    _e('Header Settings', 'crunchpress');
    ?>
              </li>
            <li class="ft_settings">
              <?php 
    _e('Footer Settings', 'crunchpress');
    ?>
              </li>
            <li class="misc_settings">
              <?php 
    _e('MISC Settings', 'crunchpress');
    ?>
              </li>
			  <li class="maintenance_mode_settings">
              <?php 
    _e('Maintenance Mode Settings', 'crunchpress');
    ?>
              </li>
			  
            <?php 
    if (!class_exists('Envato_WordPress_Theme_Upgrader')) {
    } else {
        ?>
            <li class="envato_api">
              <?php 
        _e('User API Settings', 'crunchpress');
        ?>
              </li>
            <?php 
    }
    ?>
          </ul>
        </div>
      </div>
      <!--sidebar end --> 
      <!--content start -->
      <div class="content-area span10">
	  <?php 
    //echo top_navigation_html();
    ?>
        <form id="options-panel-form" name="cp-panel-form">
          <div class="panel-elements" id="panel-elements">
            <div class="panel-element" id="panel-element-save-complete">
              <div class="panel-element-save-text">
                <?php 
    _e('Save Options Complete', 'crunchpress');
    ?>
                .</div>
              <div class="panel-element-save-arrow"></div>
            </div>
            <div class="panel-element">
              <?php 
    if (isset($action) and $action == 'general_options') {
        $general_logo_xml = '<general_settings>';
        $general_logo_xml = $general_logo_xml . create_xml_tag('header_logo', htmlspecialchars(stripslashes($header_logo)));
        $general_logo_xml = $general_logo_xml . create_xml_tag('logo_width', $logo_width);
        $general_logo_xml = $general_logo_xml . create_xml_tag('logo_height', $logo_height);
        $general_logo_xml = $general_logo_xml . create_xml_tag('select_layout_cp', $select_layout_cp);
        //$general_logo_xml = $general_logo_xml . create_xml_tag('boxed_scheme',$boxed_scheme);
        $general_logo_xml = $general_logo_xml . create_xml_tag('color_scheme', $color_scheme);
        $general_logo_xml = $general_logo_xml . create_xml_tag('select_bg_pat', $select_background_patren);
        $general_logo_xml = $general_logo_xml . create_xml_tag('bg_scheme', $bg_scheme);
        $general_logo_xml = $general_logo_xml . create_xml_tag('body_patren', $body_patren);
        $general_logo_xml = $general_logo_xml . create_xml_tag('color_patren', $color_patren);
        $general_logo_xml = $general_logo_xml . create_xml_tag('body_image', $body_image);
        $general_logo_xml = $general_logo_xml . create_xml_tag('position_image_layout', $position_image_layout);
        $general_logo_xml = $general_logo_xml . create_xml_tag('image_repeat_layout', $image_repeat_layout);
        $general_logo_xml = $general_logo_xml . create_xml_tag('image_attachment_layout', $image_attachment_layout);
        $general_logo_xml = $general_logo_xml . create_xml_tag('contact_us_code', htmlspecialchars(stripslashes($contact_us_code)));
        $general_logo_xml = $general_logo_xml . create_xml_tag('topcounter_circle', $topcounter_circle);
        $general_logo_xml = $general_logo_xml . create_xml_tag('countd_event_category', $countd_event_category);
        $general_logo_xml = $general_logo_xml . create_xml_tag('header_css_code', htmlspecialchars(stripslashes($header_css_code)));
        $general_logo_xml = $general_logo_xml . create_xml_tag('google_webmaster_code', htmlspecialchars(stripslashes($google_webmaster_code)));
        $general_logo_xml = $general_logo_xml . create_xml_tag('topbutton_icon', $topbutton_icon);
        $general_logo_xml = $general_logo_xml . create_xml_tag('topcart_icon', $topcart_icon);
        $general_logo_xml = $general_logo_xml . create_xml_tag('topsocial_icon', $topsocial_icon);
        $general_logo_xml = $general_logo_xml . create_xml_tag('select_footer_cp', $select_footer_cp);
        $general_logo_xml = $general_logo_xml . create_xml_tag('footer_style_apply', $footer_style_apply);
        $general_logo_xml = $general_logo_xml . create_xml_tag('footer_upper_layout', $footer_upper_layout);
        $general_logo_xml = $general_logo_xml . create_xml_tag('copyright_code', htmlspecialchars(stripslashes($copyright_code)));
        $general_logo_xml = $general_logo_xml . create_xml_tag('social_networking', $social_networking);
        $general_logo_xml = $general_logo_xml . create_xml_tag('top_count_header', $top_count_header);
        $general_logo_xml = $general_logo_xml . create_xml_tag('footer_banner', htmlspecialchars(stripslashes($footer_banner)));
        $general_logo_xml = $general_logo_xml . create_xml_tag('footer_col_layout', $footer_col_layout);
        $general_logo_xml = $general_logo_xml . create_xml_tag('breadcrumbs', $breadcrumbs);
        $general_logo_xml = $general_logo_xml . create_xml_tag('rtl_layout', $rtl_layout);
        $general_logo_xml = $general_logo_xml . create_xml_tag('site_loader', $site_loader);
        $general_logo_xml = $general_logo_xml . create_xml_tag('element_loader', $element_loader);
        $general_logo_xml = $general_logo_xml . create_xml_tag('maintenance_mode', $maintenance_mode);
        $general_logo_xml = $general_logo_xml . create_xml_tag('maintenace_title', htmlspecialchars(stripslashes($maintenace_title)));
        $general_logo_xml = $general_logo_xml . create_xml_tag('countdown_time', $countdown_time);
        $general_logo_xml = $general_logo_xml . create_xml_tag('email_mainte', $email_mainte);
        $general_logo_xml = $general_logo_xml . create_xml_tag('mainte_description', htmlspecialchars(stripslashes($mainte_description)));
        $general_logo_xml = $general_logo_xml . create_xml_tag('social_icons_mainte', $social_icons_mainte);
        $general_logo_xml = $general_logo_xml . create_xml_tag('tf_username', $tf_username);
        $general_logo_xml = $general_logo_xml . create_xml_tag('tf_sec_api', $tf_sec_api);
        $general_logo_xml = $general_logo_xml . '</general_settings>';
        if (!save_option('general_settings', get_option('general_settings'), $general_logo_xml)) {
            die(json_encode($return_data));
        }
        die(json_encode(array('success' => '0')));
    }
    ?>
            </div>
            <?php 
    $header_logo_upload = '';
    $logo_width = '';
    $logo_height = '';
    $select_layout_cp = '';
    //$boxed_scheme = '';
    $select_bg_pat = '';
    $scheme_color_scheme = '';
    $color_scheme = '';
    //$color_scheme_1 = '';
    $border_color = '';
    $button_color = '';
    $button_hover_color = '';
    $color_patren = '';
    $bg_scheme = '';
    $body_patren = '';
    $body_image = '';
    $position_image_layout = '';
    $image_repeat_layout = '';
    $image_attachment_layout = '';
    $contact_us_code = '';
    $header_css_code = '';
    $google_webmaster_code = '';
    $topbutton_icon = '';
    $footer_upper_layout = '';
    $select_header_cp = '';
    $header_style_apply = '';
    $about_header = '';
    $topcart_icon = '';
    $topcounter_circle = '';
    $countd_event_category = '';
    $topsocial_icon = '';
    $topsearch_icon = '';
    $copyright_code = '';
    $footer_banner = '';
    $footer_col_layout = '';
    $social_networking = '';
    $top_count_header = '';
    $footer_logo = '';
    $footer_logo_width = '';
    $footer_logo_height = '';
    $footer_layout = '';
    $breadcrumbs = '';
    $rtl_layout = '';
    $site_loader = '';
    $element_loader = '';
    $maintenance_mode = '';
    $maintenace_title = '';
    $countdown_time = '';
    $email_mainte = '';
    $mainte_description = '';
    $social_icons_mainte = '';
    $tf_username = '';
    $tf_sec_api = '';
    $cp_general_settings = get_option('general_settings');
    if ($cp_general_settings != '') {
        $cp_logo = new DOMDocument();
        $cp_logo->loadXML($cp_general_settings);
        $header_logo = find_xml_value($cp_logo->documentElement, 'header_logo');
        $logo_width = find_xml_value($cp_logo->documentElement, 'logo_width');
        $logo_height = find_xml_value($cp_logo->documentElement, 'logo_height');
        $select_layout_cp = find_xml_value($cp_logo->documentElement, 'select_layout_cp');
        //$boxed_scheme = find_xml_value($cp_logo->documentElement,'boxed_scheme');
        $color_scheme = find_xml_value($cp_logo->documentElement, 'color_scheme');
        //$color_scheme_1 = find_xml_value($cp_logo->documentElement,'color_scheme_1');
        $select_bg_pat = find_xml_value($cp_logo->documentElement, 'select_bg_pat');
        $bg_scheme = find_xml_value($cp_logo->documentElement, 'bg_scheme');
        $body_patren = find_xml_value($cp_logo->documentElement, 'body_patren');
        $color_patren = find_xml_value($cp_logo->documentElement, 'color_patren');
        $body_image = find_xml_value($cp_logo->documentElement, 'body_image');
        $position_image_layout = find_xml_value($cp_logo->documentElement, 'position_image_layout');
        $image_repeat_layout = find_xml_value($cp_logo->documentElement, 'image_repeat_layout');
        $image_attachment_layout = find_xml_value($cp_logo->documentElement, 'image_attachment_layout');
        $contact_us_code = find_xml_value($cp_logo->documentElement, 'contact_us_code');
        $topcounter_circle = find_xml_value($cp_logo->documentElement, 'topcounter_circle');
        $countd_event_category = find_xml_value($cp_logo->documentElement, 'countd_event_category');
        $header_css_code = find_xml_value($cp_logo->documentElement, 'header_css_code');
        $google_webmaster_code = find_xml_value($cp_logo->documentElement, 'google_webmaster_code');
        $topbutton_icon = find_xml_value($cp_logo->documentElement, 'topbutton_icon');
        $topcart_icon = find_xml_value($cp_logo->documentElement, 'topcart_icon');
        $topsocial_icon = find_xml_value($cp_logo->documentElement, 'topsocial_icon');
        $select_footer_cp = find_xml_value($cp_logo->documentElement, 'select_footer_cp');
        $footer_style_apply = find_xml_value($cp_logo->documentElement, 'footer_style_apply');
        $footer_upper_layout = find_xml_value($cp_logo->documentElement, 'footer_upper_layout');
        $copyright_code = find_xml_value($cp_logo->documentElement, 'copyright_code');
        $footer_banner = find_xml_value($cp_logo->documentElement, 'footer_banner');
        $footer_col_layout = find_xml_value($cp_logo->documentElement, 'footer_col_layout');
        $social_networking = find_xml_value($cp_logo->documentElement, 'social_networking');
        $breadcrumbs = find_xml_value($cp_logo->documentElement, 'breadcrumbs');
        $rtl_layout = find_xml_value($cp_logo->documentElement, 'rtl_layout');
        $site_loader = find_xml_value($cp_logo->documentElement, 'site_loader');
        $element_loader = find_xml_value($cp_logo->documentElement, 'element_loader');
        $maintenance_mode = find_xml_value($cp_logo->documentElement, 'maintenance_mode');
        $maintenace_title = find_xml_value($cp_logo->documentElement, 'maintenace_title');
        $countdown_time = find_xml_value($cp_logo->documentElement, 'countdown_time');
        $email_mainte = find_xml_value($cp_logo->documentElement, 'email_mainte');
        $mainte_description = find_xml_value($cp_logo->documentElement, 'mainte_description');
        $social_icons_mainte = find_xml_value($cp_logo->documentElement, 'social_icons_mainte');
        $tf_username = find_xml_value($cp_logo->documentElement, 'tf_username');
        $tf_sec_api = find_xml_value($cp_logo->documentElement, 'tf_sec_api');
    }
    ?>
            <ul class="logo_tab">
              <li id="logo" class="logo_dimenstion active_tab">
                <ul class="panel-body recipe_class logo_upload row-fluid">
                  <?php 
    $image_src_head = '';
    if (!empty($header_logo)) {
        $image_src_head = wp_get_attachment_image_src($header_logo, 'full');
        $image_src_head = empty($image_src_head) ? '' : $image_src_head[0];
    }
    ?>
					<li class="panel-input span8 eql_height">
						<span class="panel-title">
							<h3 for="header_logo" >
							  <?php 
    _e('Logo', 'crunchpress');
    ?>
							</h3>
						</span>
						<div class="content_con">
							<input name="header_logo" type="hidden" class="clearme" id="upload_image_attachment_id" value="<?php 
    echo $header_logo;
    ?>
" />
							<input name="header_link" id="upload_image_text" class="clearme upload_image_text" type="text" value="<?php 
    echo $image_src_head;
    ?>
" />
							<input class="upload_image_button" type="button" value="Upload" />
						</div>
						<p> <?php 
    _e('Upload logo image here, PNG, Gif, JPEG, JPG format supported only.', 'crunchpress');
    ?>
 </p>  
					</li>
					<li class="panel-right-box span4 eql_height">
						<div class="admin-logo-image">
						  <?php 
    if (!empty($header_logo)) {
        $image_src_head = wp_get_attachment_image_src($header_logo, 'full');
        $image_src_head = empty($image_src_head) ? '' : $image_src_head[0];
        $thumb_src_preview = wp_get_attachment_image_src($header_logo, array(150, 150));
        ?>
									<img class="clearme img-class" src="<?php 
        if (!empty($image_src_head)) {
            echo $thumb_src_preview[0];
        }
        ?>
" alt="logo" />
									<span class="close-me"></span>
						  <?php 
    }
    ?>
						</div>
					</li>
                </ul>
                <div class="clear"></div>
                <ul class="panel-body recipe_class row-fluid">
                  <li class="panel-input span8">
					  <span class="panel-title">
						<h3 for="logo_width" >
						  <?php 
    _e('Width', 'crunchpress');
    ?>
						</h3>
					  </span>
                    <div id="logo_width" class="sliderbar" rel="logo_bar"></div>
                    <input type="hidden" name="logo_width" value="<?php 
    echo $logo_width;
    ?>
">
					<p> <?php 
    _e('Please scroll Left to Right to adjust logo image width, you can also use Arrow keys UP,Down - Left,Right.', 'crunchpress');
    ?>
 </p>                  
                  </li>
                  <li class="span4 right-box-sec" id="slidertext"><?php 
    echo $logo_width;
    ?>
 <?php 
    _e('px', 'crunchpress');
    ?>
 </li>
                </ul>
                <div class="clear"></div>
                <ul class="panel-body recipe_class row-fluid">
                  <li class="panel-input span8">
					  <span class="panel-title">
						<h3 for="logo_height" >
						  <?php 
    _e('Height', 'crunchpress');
    ?>
						</h3>
					  </span>
                    <div id="logo_height" class="sliderbar" rel="logo_bar"></div>
                    <input type="hidden" name="logo_height" value="<?php 
    echo $logo_height;
    ?>
">
					<p> <?php 
    _e('Please scroll Left to Right to adjust logo image height, you can also use Arrow keys UP,Down - Left,Right.', 'crunchpress');
    ?>
 </p>  
                  </li>
				  <li class="span4 right-box-sec" id="slidertext"><?php 
    echo $logo_height;
    ?>
 <?php 
    _e('px', 'crunchpress');
    ?>
 </li>
                </ul>
              </li>
              <li id="color_style" class="style_color_scheme">
                <ul class="panel-body recipe_class row-fluid">
                  <li class="panel-input span8">
					<span class="panel-title">
						<h3 for="select_layout_cp">
						  <?php 
    _e('SELECT LAYOUT', 'crunchpress');
    ?>
						</h3>
					</span>
                    <div class="combobox">
                      <select name="select_layout_cp" class="select_layout_cp" id="select_layout_cp">
                        <option <?php 
    if ($select_layout_cp == 'full_layout') {
        echo 'selected';
    }
    ?>
 value="full_layout" class="full_layout">Full Layout</option>
                        <option <?php 
    if ($select_layout_cp == 'boxed_layout') {
        echo 'selected';
    }
    ?>
 value="boxed_layout" class="box_layout">Box Layout</option>
                      </select>
                    </div>
					<p> <?php 
    _e('Please select website layout Full or Boxed.', 'crunchpress');
    ?>
 </p>
                  </li>
                  <li class="span4 logo_upload">
					<div class="admin-logo-image">
						<img src="<?php 
    echo CP_PATH_URL;
    ?>
/images/full_version.jpg" class="full_v" />
						<img src="<?php 
    echo CP_PATH_URL;
    ?>
/images/boxed_version.jpg" class="boxed_v" />
					</div>	
				  </li>
                </ul>
                <!--<div class="clear"></div>
						<ul id="boxed_layout" class="panel-body recipe_class ">
							<li class="panel-title">
								<label for="boxed_scheme" > <?php 
    _e('BOXED LAYOUT BACKGROUND', 'crunchpress');
    ?>
 </label>
							</li>				
							<li class="panel-input">
								<input type="text" name="boxed_scheme" class="color-picker" value="<?php 
    //if($boxed_scheme <> ''){echo $boxed_scheme;}
    ?>
"/>
							</li>
							<li class="description">Please select any color from color palette to use as color scheme, leaving blank color scheme will be auto selected as default.</li>
						</ul>-->
                <div class="clear"></div>
                <ul class="panel-body recipe_class row-fluid">
                   <li class="panel-input span8">
					<span class="panel-title">
						<h3 for="color_scheme" >
						  <?php 
    _e('COLOR SCHEME', 'crunchpress');
    ?>
						</h3>
					</span>
					<div class="color-picker-container">
						<input type="text" name="color_scheme" class="color-picker" value="<?php 
    if ($color_scheme != '') {
        echo $color_scheme;
    }
    ?>
" />
					</div>
					<p> <?php 
    _e('Please select any color from color palette to use as color scheme (it will effect on all headings and anchors), leaving blank color scheme will be auto selected as default.', 'crunchpress');
    ?>
 </p>
                  </li>
                  <li class="span4 right-box-sec"> </li>
                </ul>
				<div class="clear"></div>
                <ul class="panel-body recipe_class row-fluid"> 
                  <li class="panel-input span8">
				  <span class="panel-title">
                    <h3>
                      <?php 
    _e('SELECT BACKGROUND TYPE', 'crunchpress');
    ?>
                    </h3>
                  </span>
                    <div class="combobox">
                      <select name="select_background_patren" class="select_background_patren" id="select_background_patren">
                        <option <?php 
    if ($select_bg_pat == 'Background-Patren') {
        echo 'selected';
    }
    ?>
 value="Background-Patren" class="select_bg_patren"> <?php 
    _e('Background Pattern', 'crunchpress');
    ?>
 </option>
                        <option <?php 
    if ($select_bg_pat == 'Background-Color') {
        echo 'selected';
    }
    ?>
 value="Background-Color" class="select_bg_color"> <?php 
    _e('Background Color', 'crunchpress');
    ?>
 </option>
                        <option <?php 
    if ($select_bg_pat == 'Background-Image') {
        echo 'selected';
    }
    ?>
 value="Background-Image" class="select_bg_image"> <?php 
    _e('Background Image', 'crunchpress');
    ?>
 </option>
                      </select>
                    </div>
					<p> <?php 
    _e('Please select background pattern or background color.', 'crunchpress');
    ?>
 </p>
                  </li>
                  <li id="select_bg_patren" class="span4 pattern-container">
				  <?php 
    $options = array('1' => array('value' => '1', 'image' => '/framework/images/pattern/pattern-1.png'), '2' => array('value' => '2', 'image' => '/framework/images/pattern/pattern-2.png'), '3' => array('value' => '3', 'image' => '/framework/images/pattern/pattern-3.png'), '4' => array('value' => '4', 'image' => '/framework/images/pattern/pattern-4.png'), '5' => array('value' => '5', 'image' => '/framework/images/pattern/pattern-5.png'), '6' => array('value' => '6', 'image' => '/framework/images/pattern/pattern-6.png'), '7' => array('value' => '7', 'image' => '/framework/images/pattern/pattern-7.png'), '8' => array('value' => '8', 'image' => '/framework/images/pattern/pattern-8.png'), '9' => array('value' => '9', 'image' => '/framework/images/pattern/pattern-9.png'), '10' => array('value' => '10', 'image' => '/framework/images/pattern/pattern-10.png'), '11' => array('value' => '11', 'image' => '/framework/images/pattern/pattern-11.png'), '12' => array('value' => '12', 'image' => '/framework/images/pattern/pattern-12.png'), '13' => array('value' => '13', 'image' => '/framework/images/pattern/pattern-13.png'), '14' => array('value' => '14', 'image' => '/framework/images/pattern/pattern-14.png'), '15' => array('value' => '15', 'image' => '/framework/images/pattern/pattern-15.png'), '16' => array('value' => '16', 'image' => '/framework/images/pattern/pattern-16.png'), '17' => array('value' => '17', 'image' => '/framework/images/pattern/pattern-17.png'), '18' => array('value' => '18', 'image' => '/framework/images/pattern/pattern-18.png'), '19' => array('value' => '19', 'image' => '/framework/images/pattern/pattern-19.png'), '20' => array('value' => '20', 'image' => '/framework/images/pattern/pattern-20.png'), '21' => array('value' => '21', 'image' => '/framework/images/pattern/pattern-21.png'), '22' => array('value' => '22', 'image' => '/framework/images/pattern/pattern-22.png'), '23' => array('value' => '23', 'image' => '/framework/images/pattern/pattern-45.png'));
    $value = '';
    $default = '';
    foreach ($options as $option) {
        ?>
                    <div class='radio-image-wrapper'>
                      <label for="<?php 
        echo $option['value'];
        ?>
">
                      <img src=<?php 
        echo CP_PATH_URL . $option['image'];
        ?>
 class="color_patren" alt="color_patren">
                      <div id="check-list"></div>
                      </label>
                      <input type="radio" class="checkbox_class" name="color_patren" value="<?php 
        echo $option['image'];
        ?>
" <?php 
        if ($color_patren == $option['image']) {
            echo 'checked';
        } else {
            if ($color_patren == '' && $default == $option['image']) {
                echo 'checked';
            }
        }
        ?>
 id="<?php 
        echo $option['value'];
        ?>
" class=""
										>
                    </div>
                    <?php 
    }
    ?>
 
				  </li>
                </ul>
                <div class="clear"></div>
                <ul id="select_bg_color" class="panel-body recipe_class row-fluid">
                  
                  <li class="panel-input span8">
				  <span class="panel-title">
                    <h3 for="bg_scheme" >
                      <?php 
    _e('BACKGROUND COLOR', 'crunchpress');
    ?>
                    </h3>
                  </span>
                    <div class="color-picker-container">
						<input type="text" name="bg_scheme" class="color-picker" value="<?php 
    if ($bg_scheme != '') {
        echo $bg_scheme;
    }
    ?>
"/>
					</div>
					<p> <?php 
    _e('Please select any color from color palette to use as background color, leaving blank background will be auto selected as default background.', 'crunchpress');
    ?>
 </p>
                  </li>
                  <li class="span4 right-box-sec"></li>
                </ul>
                <div class="clear"></div>
                <ul id="bg_upload_id" class="recipe_class logo_upload row-fluid">
                  <li class="panel-input span8 ">
					  <span class="panel-title">
						<h3 for="body_patren" >
						  <?php 
    _e('Upload Background Pattern', 'crunchpress');
    ?>
						</h3>
					  </span>
					  <?php 
    $image_src_head = '';
    if (!empty($header_logo)) {
        $image_src_head = wp_get_attachment_image_src($body_patren, 'full');
        $image_src_head = empty($image_src_head) ? '' : $image_src_head[0];
        //$thumb_src_preview = wp_get_attachment_image_src( $header_logo, '150x150');
        //echo '<img src="' . $thumb_src_preview[0] . '" />';
    }
    ?>
					<div class="content_con">
						<input name="body_patren" class="emptyme" type="hidden" id="upload_image_attachment_id" value="<?php 
    echo $body_patren;
    ?>
" />
						<input id="upload_image_text" class="emptyme upload_image_text" type="text" value="<?php 
    echo $image_src_head;
    ?>
" />
						<input class="upload_image_button" type="button" value="Upload" />
					</div>
					<p> <?php 
    _e('Upload background pattern for your theme this option provide you access to put your own image to use as background pattern.', 'crunchpress');
    ?>
 </p>
                  </li>
                  
				   <li class="panel-right-box span4">
					   <div class="admin-logo-image">
						  <?php 
    if (!empty($body_patren)) {
        $image_src_head = wp_get_attachment_image_src($body_patren, 'full');
        $image_src_head = empty($image_src_head) ? '' : $image_src_head[0];
        $thumb_src_preview = wp_get_attachment_image_src($body_patren, array(150, 150));
        ?>
						  <img class="clearme img-class" src="<?php 
        if (!empty($image_src_head)) {
            echo $thumb_src_preview[0];
        }
        ?>
" /><span class="close-me"></span>
						  <?php 
    }
    ?>
						</div>
					</li>
                </ul>
                <ul id="image_upload_id" class="recipe_class logo_upload row-fluid">
                 
                  <li class="panel-input span8">
					   <span class="panel-title">
						<h3 for="body_image" >
						  <?php 
    _e('Upload Background Image', 'crunchpress');
    ?>
						</h3>
					  </span>
					  <?php 
    $image_src_head = '';
    if (!empty($body_image)) {
        $image_src_head = wp_get_attachment_image_src($body_image, 'full');
        $image_src_head = empty($image_src_head) ? '' : $image_src_head[0];
        //$thumb_src_preview = wp_get_attachment_image_src( $header_logo, '150x150');
        //echo '<img src="' . $thumb_src_preview[0] . '" />';
    }
    ?>
                    <div class="content_con">
						<input name="body_image" class="clearme" type="hidden" id="upload_image_attachment_id" value="<?php 
    echo $body_image;
    ?>
" />
						<input id="upload_image_text" class="clearme upload_image_text" type="text" value="<?php 
    echo $image_src_head;
    ?>
" />
						<input class="upload_image_button" type="button" value="Upload" />
					</div>
					<p> <?php 
    _e('Upload background Image for your theme this option provide you access to put your own image to use as background Image.', 'crunchpress');
    ?>
 </p>
                  </li>
				   <li class="span4 description" >
					   <div class="admin-logo-image">
						  <?php 
    if (!empty($body_image)) {
        $image_src_head = wp_get_attachment_image_src($body_image, 'full');
        $image_src_head = empty($image_src_head) ? '' : $image_src_head[0];
        $thumb_src_preview = wp_get_attachment_image_src($body_image, array(150, 150));
        ?>
						  <img class="clearme img-class" src="<?php 
        if (!empty($image_src_head)) {
            echo $thumb_src_preview[0];
        }
        ?>
" /><span class="close-me"></span>
						  <?php 
    }
    ?>
						</div>
					</li>
					
                </ul>
                <div class="clear"></div>
				<div class="row-fluid">
                <ul class="recipe_class image_upload_options span4">
                 
                  <li class="panel-radioimage panel-input full-width">
				   <span class="panel-title">
                    <h3 for="position_image_layout">
                      <?php 
    _e('Image Position', 'crunchpress');
    ?>
                    </h3>
                  </span>
				  <div class="combobox cp-select-wrap">
					<select name="position_image_layout" class="position_image_layout" id="position_image_layout">
							<?php 
    $value = '';
    $options = array('1' => array('value' => 'top', 'title' => 'Position Top'), '2' => array('value' => 'right', 'title' => 'Position Right'), '3' => array('value' => 'left', 'title' => 'Position Left'), '4' => array('value' => 'bottom', 'title' => 'Position Bottom'), '5' => array('value' => 'center', 'title' => 'Position Center'));
    foreach ($options as $option) {
        ?>
									<option <?php 
        if ($position_image_layout == $option['value']) {
            echo 'selected';
        }
        ?>
 value="<?php 
        echo $option['value'];
        ?>
" class="position_image_layout"><?php 
        echo $option['title'];
        ?>
</option>
								<?php 
    }
    ?>
                    </select>
					</div>
					<p> <?php 
    _e('You can manage background image position in this area.', 'crunchpress');
    ?>
 </p>
                  </li>
				  
                </ul>
                <ul class="panel-body recipe_class image_upload_options span4">
                  <li class="panel-input full-width">
				  <span class="panel-title">
                    <h3 for="image_repeat_layout">
                      <?php 
    _e('SELECT BACKGROUND TYPE', 'crunchpress');
    ?>
                    </h3>
                  </span>
                    <div class="combobox cp-select-wrap">
                      <select name="image_repeat_layout" class="image_repeat_layout" id="image_repeat_layout">
					  			<?php 
    $value = '';
    $options = array('1' => array('value' => 'no-repeat', 'title' => 'No Repeat'), '2' => array('value' => 'repeat-x', 'title' => 'Repeat Horizontal'), '3' => array('value' => 'repeat-y', 'title' => 'Repeat Vertical'), '4' => array('value' => 'repeat', 'title' => 'Repeat'));
    foreach ($options as $option) {
        ?>
							<option <?php 
        if ($image_repeat_layout == $option['value']) {
            echo 'selected';
        }
        ?>
 value="<?php 
        echo $option['value'];
        ?>
" class="select_bg_patren"><?php 
        echo $option['title'];
        ?>
</option>
						<?php 
    }
    ?>
                      </select>
                    </div>
					<p> <?php 
    _e('You can manage your image repeat whether its repeated horizontal verticle or both.', 'crunchpress');
    ?>
 </p>
                  </li>
                </ul>
                <ul class="recipe_class image_upload_options span4">
                  
                  <li class="panel-radioimage panel-input full-width">
				  <span class="panel-title ">
                    <h3 for="image_attachment_layout">
                      <?php 
    _e('Image Attachment', 'crunchpress');
    ?>
                    </h3>
                  </span>
				  <div class="combobox cp-select-wrap">
				   <select name="image_attachment_layout" class="image_attachment_layout" id="image_attachment_layout">
						<?php 
    $value = '';
    $options = array('1' => array('value' => 'fixed', 'title' => 'Fixed'), '2' => array('value' => 'scroll', 'title' => 'Scroll'));
    foreach ($options as $option) {
        ?>
							<option <?php 
        if ($image_attachment_layout == $option['value']) {
            echo 'selected';
        }
        ?>
 value="<?php 
        echo $option['value'];
        ?>
" class="image_attachment_layout"><?php 
        echo $option['title'];
        ?>
</option>                   
						<?php 
    }
    ?>
					</select>
					</div>
					<p> <?php 
    _e('You can manage your background image attachment fixed or scroll.', 'crunchpress');
    ?>
 </p>
                  </li>
				 
                </ul>
				</div>
              </li>
              <li id="hr_settings" class="logo_dimenstion">
				<div class="row-fluid">
					<ul class="panel-body recipe_class span6">
						<li class="panel-input full-width">
							<span class="panel-title">
								<h3 >
									<?php 
    _e('TOP BAR', 'crunchpress');
    ?>
								</h3>
							</span>
							<label for="topbutton_icon">
								<div class="checkbox-switch <?php 
    echo $topbutton_icon == 'enable' || $topbutton_icon == '' && empty($default) ? 'checkbox-switch-on' : 'checkbox-switch-off';
    ?>
"></div>
							</label>
							<input type="checkbox" name="topbutton_icon" class="checkbox-switch" value="disable" checked>
							<input type="checkbox" name="topbutton_icon" id="topbutton_icon" class="checkbox-switch" value="enable" 
							<?php 
    echo $topbutton_icon == 'enable' || $topbutton_icon == '' && empty($default) ? 'checked' : '';
    ?>
>
							<!--<p><?php 
    _e('You can turn On/Off Top Bar. Note: Turning it off Search and Top Social Networking Icons will be activated.', 'crunchpress');
    ?>
</p>-->
							<p><?php 
    _e('You can turn On/Off Top Bar. Social Icons, Sign in Sign up search everything will be disappear onces you turn it off.', 'crunchpress');
    ?>
</p>
						</li>
					</ul>
					<ul class="panel-body recipe_class span6">
						<li class="panel-input full-width">
							<span class="panel-title">
								<h3>
									<?php 
    _e('TOP CONTACT US FIELD', 'crunchpress');
    ?>
								</h3>
							</span>
							<textarea name="contact_us_code" id="contact_us_code" ><?php 
    echo $contact_us_code == '' ? esc_textarea($contact_us_code) : esc_textarea($contact_us_code);
    ?>
</textarea>
							<p><?php 
    _e('Please add html or shortcodes for top contact us links.', 'crunchpress');
    ?>
</p>
						</li>				 
					</ul>
					
				</div>	
				<div class="row-fluid">
					<ul class="panel-body recipe_class span4">
						<li class="panel-input full-width">
							<span class="panel-title">
								<h3>
									<?php 
    _e('TOP COUNTER', 'crunchpress');
    ?>
								</h3>
							</span>
							<label for="topcounter_circle">
								<div class="checkbox-switch <?php 
    echo $topcounter_circle == 'enable' || $topcounter_circle == '' && empty($default) ? 'checkbox-switch-on' : 'checkbox-switch-off';
    ?>
"></div>
							</label>
							<input type="checkbox" name="topcounter_circle" class="checkbox-switch" value="disable" checked>
							<input type="checkbox" name="topcounter_circle" id="topcounter_circle" class="checkbox-switch" value="enable" 
							<?php 
    echo $topcounter_circle == 'enable' || $topcounter_circle == '' && empty($default) ? 'checked' : '';
    ?>
>
							<!--<p><?php 
    _e('You can turn On/Off Top Bar. Note: Turning it off Search and Top Social Networking Icons will be activated.', 'crunchpress');
    ?>
</p>-->
							<p><?php 
    _e('You can turn On/Off top counter from here.', 'crunchpress');
    ?>
</p>
						</li>
					</ul>
					<ul class="panel-body recipe_class span4">
						 <li class="panel-input full-width">
							<span class="panel-title">
								<h3>
								  <?php 
    _e('SELECT EVENT FOR COUNTDOWN', 'crunchpress');
    ?>
								</h3>
							</span>
							<div class="combobox">
								<select name="countd_event_category" class="countd_event_category" id="countd_event_category">
								<?php 
    foreach (get_title_list_array('event') as $values) {
        ?>
									<option <?php 
        if ($values->ID == $countd_event_category) {
            echo 'selected';
        }
        ?>
 value="<?php 
        echo $values->ID;
        ?>
"><?php 
        echo $values->post_title;
        ?>
</option>
									<?php 
    }
    ?>
								</select>
							</div>
							<p> <?php 
    _e('Please select event from dropdown to show its countdown.', 'crunchpress');
    ?>
 </p>
						  </li>
					</ul>   
					<ul class="panel-body recipe_class span4">
					  <li class="panel-input full-width">
						<span class="panel-title">
							<h3 for="" >
								<?php 
    _e('TOP SOCIAL NETWORK ICONS', 'crunchpress');
    ?>
							</h3>
						</span>
						<label for="topsocial_icon">
							<div class="checkbox-switch <?php 
    echo $topsocial_icon == 'enable' || $topsocial_icon == '' && empty($default) ? 'checkbox-switch-on' : 'checkbox-switch-off';
    ?>
"></div>
						</label>
						<input type="checkbox" name="topsocial_icon" class="checkbox-switch" value="disable" checked>
						<input type="checkbox" name="topsocial_icon" id="topsocial_icon" class="checkbox-switch" value="enable" <?php 
    echo $topsocial_icon == 'enable' || $topsocial_icon == '' && empty($default) ? 'checked' : '';
    ?>
>
						<p><?php 
    _e('You can turn On/Off Top social network icons from main menu.', 'crunchpress');
    ?>
</p>
					  </li>
					</ul>
				</div>
				<div class="row-fluid">
					<ul class="panel-body recipe_class span6">
						<li class="panel-input full-width">
							<span class="panel-title">
								<h3 for="header_css_code" >
									<?php 
    _e('HEADER CODE', 'crunchpress');
    ?>
								</h3>
							</span>
							<textarea name="header_css_code" id="header_css_code" ><?php 
    echo $header_css_code == '' ? esc_textarea($header_css_code) : esc_textarea($header_css_code);
    ?>
</textarea>
							<p><?php 
    _e('Please write css code for you theme if you want to put some extra code in css for styling purpose only.', 'crunchpress');
    ?>
</p>
						</li>				 
					</ul>
					<ul class="panel-body recipe_class span6">
						<li class="panel-input full-width">
							<span class="panel-title">
								<h3 for="google_webmaster_code" >
									<?php 
    _e('GOOGLE WEBMASTER VERIFY CODE', 'crunchpress');
    ?>
								</h3>
							</span>
							<textarea name="google_webmaster_code" id="google_webmaster_code" ><?php 
    if ($google_webmaster_code != '') {
        echo esc_textarea($google_webmaster_code);
    }
    ?>
</textarea>
							<p><?php 
    _e('Please paste google, Bing, yahoo etc analytics code here to validate your site in webmaster.', 'crunchpress');
    ?>
</p>
						</li> 
					</ul>    
				</div>
              </li>
            <li id="ft_settings" class="logo_dimenstion">
				<div class="row-fluid">
					<ul class="panel-body recipe_class span4">
					  <li class="panel-input full-width">
					  <span class="panel-title">
						<h3 for="" >
						  <?php 
    _e('SOCIAL ICONS', 'crunchpress');
    ?>
						</h3>
					  </span>
						<label for="social_networking">
						<div class="checkbox-switch <?php 
    echo $social_networking == 'enable' || $social_networking == '' && empty($default) ? 'checkbox-switch-on' : 'checkbox-switch-off';
    ?>
"></div>
						</label>
						<input type="checkbox" name="social_networking" class="checkbox-switch" value="disable" checked>
						<input type="checkbox" name="social_networking" id="social_networking" class="checkbox-switch" value="enable" <?php 
    echo $social_networking == 'enable' || $social_networking == '' && empty($default) ? 'checked' : '';
    ?>
>
								<div class="clear"></div>
							<p> <?php 
    _e('You can turn On/Off footer social networking profile icons.', 'crunchpress');
    ?>
</p>
					  </li>
					</ul>
					<ul class="panel-body recipe_class span4">
						<li class="panel-input full-width">
							<span class="panel-title">
								<h3 for="copyright_code" >
									<?php 
    _e('COPY RIGHT TEXT', 'crunchpress');
    ?>
								</h3>
							</span>
							<input type="text" name="copyright_code" id="copyright_code" value="<?php 
    echo $copyright_code == '' ? esc_html($copyright_code) : esc_html($copyright_code);
    ?>
" />
							<div class="clear"></div>
							<p><?php 
    _e('Please paste here your copy right text.', 'crunchpress');
    ?>
</p>
						</li>
					</ul>
					<ul class="recipe_class span4">
						<li class="panel-radioimage panel-input full-width">
							<span class="panel-title">
								<h3 for="">
								  <?php 
    _e('FOOTER WIDGET LAYOUT', 'crunchpress');
    ?>
								</h3>
							</span>
							<?php 
    $value = '';
    $options = array('1' => array('value' => 'footer-style1', 'image' => '/framework/images/footer-style1.png'), '6' => array('value' => 'footer-style6', 'image' => '/framework/images/footer-style6.png'));
    foreach ($options as $option) {
        ?>
							<div class='radio-image-wrapper'>
								<label for="<?php 
        echo $option['value'];
        ?>
">
								  <img src=<?php 
        echo CP_PATH_URL . $option['image'];
        ?>
 class="footer_col_layout" alt="footer_col_layout" />
								  <div id="check-list"></div>
								</label>
								<input type="radio" name="footer_col_layout" value="<?php 
        echo $option['value'];
        ?>
" id="<?php 
        echo $option['value'];
        ?>
" class="dd"
								<?php 
        if ($footer_col_layout == $option['value']) {
            echo 'checked';
        }
        ?>
>
							</div>
							<?php 
    }
    ?>
							<div class="clear"></div>
							<p> <?php 
    _e('Please select home page layout style.', 'crunchpress');
    ?>
</p>
						</li>
					</ul>
				</div>
            </li>
              <li id="misc_settings">
				<div class="row-fluid">
					<ul class="panel-body recipe_class span6">
					  <li class="panel-input full-width">
					   <span class="panel-title">
						<h3 for="" >
						  <?php 
    _e('BREADCRUMBS', 'crunchpress');
    ?>
						</h3>
					  </span>
						<label for="breadcrumbs">
						<div class="checkbox-switch <?php 
    echo $breadcrumbs == 'enable' || $breadcrumbs == '' && empty($default) ? 'checkbox-switch-on' : 'checkbox-switch-off';
    ?>
"></div>
						</label>
						<input type="checkbox" name="breadcrumbs" class="checkbox-switch" value="disable" checked>
						<input type="checkbox" name="breadcrumbs" id="breadcrumbs" class="checkbox-switch" value="enable" <?php 
    if ($breadcrumbs == 'enable') {
        echo '';
    }
    echo $breadcrumbs == 'enable' || $breadcrumbs == '' && empty($default) ? 'checked' : '';
    ?>
>
						<p> <?php 
    _e('You can turn On/Off BreadCrumbs from Top of the page.', 'crunchpress');
    ?>
</p>
					  </li>
					  
					</ul>
					<ul class="panel-body recipe_class span6">
						<li class="panel-input full-width">
							<span class="panel-title">
								<h3 for="rtl_layout" >
									<?php 
    _e('RTL LAYOUTS', 'crunchpress');
    ?>
								</h3>
							</span>
							<label for="rtl_layout">
								<div class="checkbox-switch <?php 
    echo $rtl_layout == 'enable' || $rtl_layout == '' && empty($default) ? 'checkbox-switch-on' : 'checkbox-switch-off';
    ?>
"></div>
							</label>
							<input type="checkbox" name="rtl_layout" class="checkbox-switch" value="disable" checked>
							<input type="checkbox" name="rtl_layout" id="rtl_layout" class="checkbox-switch" value="enable" <?php 
    echo $rtl_layout == 'enable' || $rtl_layout == '' && empty($default) ? 'checked' : '';
    ?>
>
							<p> <?php 
    _e('You can turn On/Off RTL Layout of website.', 'crunchpress');
    ?>
 </p>
						</li>
					</ul>
					<!--<ul class="panel-body recipe_class span3">
					  
					  <li class="panel-input full-width">
					  <span class="panel-title">
						<h3 for="site_loader" >
						  <?php 
    _e('TURN ON/OFF LOADER', 'crunchpress');
    ?>
						</h3>
					  </span>
						<label for="site_loader">
						<div class="checkbox-switch <?php 
    echo $site_loader == 'enable' || $site_loader == '' && empty($default) ? 'checkbox-switch-on' : 'checkbox-switch-off';
    ?>
"></div>
						</label>
						<input type="checkbox" name="site_loader" class="checkbox-switch" value="disable" checked>
						<input type="checkbox" name="site_loader" id="site_loader" class="checkbox-switch" value="enable" <?php 
    echo $site_loader == 'enable' || $site_loader == '' && empty($default) ? 'checked' : '';
    ?>
>
								<p> <?php 
    _e('You can turn On/Off site Loader of website.', 'crunchpress');
    ?>
</p>
					  </li>
					  
					</ul>
					<ul class="panel-body recipe_class span3">
					  
					  <li class="panel-input full-width">
					  <span class="panel-title">
						<h3 for="element_loader" >
						  <?php 
    _e('TURN ON/OFF ELEMENT LOAD ON SCROLL', 'crunchpress');
    ?>
						</h3>
					  </span>
						<label for="element_loader">
						<div class="checkbox-switch <?php 
    echo $element_loader == 'enable' || $element_loader == '' && empty($default) ? 'checkbox-switch-on' : 'checkbox-switch-off';
    ?>
"></div>
						</label>
						<input type="checkbox" name="element_loader" class="checkbox-switch" value="disable" checked>
						<input type="checkbox" name="element_loader" id="element_loader" class="checkbox-switch" value="enable" <?php 
    echo $element_loader == 'enable' || $element_loader == '' && empty($default) ? 'checked' : '';
    ?>
>
								<p><?php 
    _e('You can turn On/Off element Loader of website.', 'crunchpress');
    ?>
</p>
					  </li>
					  
					</ul>-->
				</div>
              </li>
			  <li id="maintenance_mode_settings">
				<div class="row-fluid">
					<ul class="panel-body recipe_class span3">
						<li class="panel-input full-width">
						   <span class="panel-title">
							<h3 for="" >
							  <?php 
    _e('Maintenance Mode', 'crunchpress');
    ?>
							</h3>
						  </span>
							<label for="maintenance_mode">
							<div class="checkbox-switch <?php 
    echo $maintenance_mode == 'enable' || $maintenance_mode == '' && empty($default) ? 'checkbox-switch-on' : 'checkbox-switch-off';
    ?>
"></div>
							</label>
							<input type="checkbox" name="maintenance_mode" class="checkbox-switch" value="disable" checked>
							<input type="checkbox" name="maintenance_mode" id="maintenance_mode" class="checkbox-switch" value="enable" 
							<?php 
    if ($maintenance_mode == 'enable') {
        echo '';
    }
    echo $maintenance_mode == 'enable' || $maintenance_mode == '' && empty($default) ? 'checked' : '';
    ?>
>
							<p><?php 
    _e('You can turn On/Off Maintenance mode from here.', 'crunchpress');
    ?>
</p>
						</li>
					</ul>
					<ul class="panel-body recipe_class span3">
						<li class="panel-input full-width">
							<span class="panel-title">
								<h3>
									<?php 
    _e('Maintenance Title', 'crunchpress');
    ?>
								</h3>
							</span>
							<input type="text" name="maintenace_title" id="maintenace_title" value="<?php 
    echo $maintenace_title == '' ? esc_html($maintenace_title) : esc_html($maintenace_title);
    ?>
" />
							<div class="clear"></div>
							<p><?php 
    _e('Please add title on maintenance page.', 'crunchpress');
    ?>
</p>
						</li>
					</ul>
					<ul class="panel-body recipe_class span3">
						<li class="panel-input full-width">
							<span class="panel-title">
								<h3>
									<?php 
    _e('Countdown Time', 'crunchpress');
    ?>
								</h3>
							</span>
							<input type="text" name="countdown_time" id="countdown_time" value="<?php 
    echo $countdown_time == '' ? esc_html($countdown_time) : esc_html($countdown_time);
    ?>
" />
							<div class="clear"></div>
							<p><?php 
    _e('Please select time span when your site will be live and counter will countdown seconds to mints and days till that on maintenance page.', 'crunchpress');
    ?>
</p>
						</li>
					</ul>
					<ul class="panel-body recipe_class span3">
						<li class="panel-input full-width">
							<span class="panel-title">
								<h3>
									<?php 
    _e('Email', 'crunchpress');
    ?>
								</h3>
							</span>
							<input type="text" name="email_mainte" id="email_mainte" value="<?php 
    echo $email_mainte == '' ? esc_html($email_mainte) : esc_html($email_mainte);
    ?>
" />
							<div class="clear"></div>
							<p><?php 
    _e('Add email where you want to post subscriptions.', 'crunchpress');
    ?>
</p>
						</li>
					</ul>
				</div>
				<div class="row-fluid">
					<ul class="panel-body recipe_class span8">
						<li class="panel-input full-width">
							<span class="panel-title">
								<h3 for="mainte_description" >
									<?php 
    _e('Description', 'crunchpress');
    ?>
								</h3>
							</span>
							<textarea name="mainte_description" id="mainte_description" ><?php 
    if ($mainte_description != '') {
        echo esc_textarea($mainte_description);
    }
    ?>
</textarea>
							<p><?php 
    _e('Please add description text for your website maintenance.', 'crunchpress');
    ?>
</p>
						</li> 
					</ul>    
					<ul class="panel-body recipe_class span4">
						<li class="panel-input full-width">
						   <span class="panel-title">
							<h3 for="" >
							  <?php 
    _e('Social Icons', 'crunchpress');
    ?>
							</h3>
						  </span>
							<label for="social_icons_mainte">
							<div class="checkbox-switch <?php 
    echo $social_icons_mainte == 'enable' || $social_icons_mainte == '' && empty($default) ? 'checkbox-switch-on' : 'checkbox-switch-off';
    ?>
"></div>
							</label>
							<input type="checkbox" name="social_icons_mainte" class="checkbox-switch" value="disable" checked>
							<input type="checkbox" name="social_icons_mainte" id="social_icons_mainte" class="checkbox-switch" value="enable" 
							<?php 
    if ($social_icons_mainte == 'enable') {
        echo '';
    }
    echo $social_icons_mainte == 'enable' || $social_icons_mainte == '' && empty($default) ? 'checked' : '';
    ?>
>
							<p><?php 
    _e('You can turn On/Off Maintenance mode social icons that are showing at bottom of page.', 'crunchpress');
    ?>
</p>
						</li>
					</ul>
				</div>	
              </li>
              <?php 
    if (!class_exists('Envato_WordPress_Theme_Upgrader')) {
    } else {
        ?>
              <li id="envato_api" class="envato_api">
                <ul class="panel-body recipe_class">
                 
                  <li class="panel-input">
					   <span class="panel-title">
						<h3 for="tf_username" >
						  <?php 
        _e('Username', 'crunchpress');
        ?>
						</h3>
					  </span>
                    <input type="text" name="tf_username" id="tf_username" value="<?php 
        echo $tf_username == '' ? esc_html($tf_username) : esc_html($tf_username);
        ?>
" />
					<span><?php 
        _e('Please enter your Theme Forest username.', 'crunchpress');
        ?>
  <br />
                    <p><?php 
        _e('For example: denonstudio', 'crunchpress');
        ?>
  </p></span>
                  </li>
                  
                </ul>
                <ul class="panel-body recipe_class">
                  
                  <li class="panel-input">
				  <span class="panel-title">
                    <h3 for="tf_sec_api" >
                      <?php 
        _e('API Key', 'crunchpress');
        ?>
                    </h3>
                  </span>
                    <input type="text" name="tf_sec_api" id="tf_sec_api" value="<?php 
        echo $tf_sec_api == '' ? esc_html($tf_sec_api) : esc_html($tf_sec_api);
        ?>
" />
                  </li>
                  <span class="right-box-sec"> <?php 
        _e('Please paste here your theme forest Secret API Key.', 'crunchpress');
        ?>
  <br />
                     <p><?php 
        _e('For example: xxxxxxxav7hny3p1ptm7xxxxxxxx', 'crunchpress');
        ?>
 <p></span>
                </ul>
              </li>
              <?php 
    }
    ?>
            </ul>
            <div class="clear"></div>
            <div class="panel-element-tail">
              <div class="tail-save-changes">
                <div class="loading-save-changes"></div>
                <input type="submit" value="<?php 
    echo __('Save Changes', 'crunchpress');
    ?>
">
                <input type="hidden" name="action" value="general_options">
                <!--<input type="hidden" name="security" value="<?php 
    //echo wp_create_nonce(plugin_basename(__FILE__))
    ?>
">--> 
              </div>
            </div>
          </div>
        </form>
      </div>
      <!--content End --> 
    </div>
    <!--content area end --> 
  </div>
<?php 
}
コード例 #10
0
ファイル: page-item.php プロジェクト: hongviet119/dlvv
function print_contact_form($item_xml)
{
    global $gdl_admin_translator;
    if ($gdl_admin_translator == 'enable') {
        $gdl_name_string = get_option(THEME_SHORT_NAME . '_translator_name_contact_form', 'Name');
        $gdl_name_error_string = get_option(THEME_SHORT_NAME . '_translator_name_error_contact_form', 'Please enter your name');
        $gdl_email_string = get_option(THEME_SHORT_NAME . '_translator_email_contact_form', 'Email');
        $gdl_email_error_string = get_option(THEME_SHORT_NAME . '_translator_email_error_contact_form', 'Please enter a valid email address');
        $gdl_message_string = get_option(THEME_SHORT_NAME . '_translator_message_contact_form', 'Message');
        $gdl_message_error_string = get_option(THEME_SHORT_NAME . '_translator_message_error_contact_form', 'Please enter message');
        $gdl_submit_button = get_option(THEME_SHORT_NAME . '_translator_submit_contact_form', 'Submit');
    } else {
        $gdl_name_string = __('Name', 'gdl_front_end');
        $gdl_name_error_string = __('Please enter your name', 'gdl_front_end');
        $gdl_email_string = __('Email', 'gdl_front_end');
        $gdl_email_error_string = __('Please enter a valid email address', 'gdl_front_end');
        $gdl_message_string = __('Message', 'gdl_front_end');
        $gdl_message_error_string = __('Please enter message', 'gdl_front_end');
        $gdl_submit_button = __('Submit', 'gdl_front_end');
    }
    ?>
		<div class="contact-form-wrapper">
			<form class="gdl-contact-form">
				<ol class="forms">
					<li class="form-input">
						<strong><?php 
    echo $gdl_name_string;
    ?>
 *</strong>
						<input type="text" name="name" class="require-field" />
						<div class="error">* <?php 
    echo $gdl_name_error_string;
    ?>
</div>
					</li>
					<li class="form-input">
						<strong><?php 
    echo $gdl_email_string;
    ?>
 *</strong>
						<input type="text" name="email" class="require-field email" />
						<div class="error">* <?php 
    echo $gdl_email_error_string;
    ?>
</div>
					</li>
					<li class="form-textarea"><strong><?php 
    echo $gdl_message_string;
    ?>
 *</strong>
						<textarea name="message" class="require-field"></textarea>
						<div class="error">* <?php 
    echo $gdl_message_error_string;
    ?>
</div> 
					</li>
					<li class="hidden"><input type="hidden" name="receiver" value="<?php 
    echo find_xml_value($item_xml, 'email');
    ?>
"></li>
					<li class="sending-result" id="sending-result" ><div class="message-box-wrapper green"></div></li>
					<li class="buttons">
						<button type="submit" class="contact-submit button"><?php 
    echo $gdl_submit_button;
    ?>
</button>
						<div class="contact-loading">
					</li>
				</ol>
			</form>
			<div class="clear"></div>
		</div>	
	<?php 
}
コード例 #11
0
ファイル: single.php プロジェクト: pcco/portal-redesign
     $cp_post_xml = new DOMDocument();
     $cp_post_xml->loadXML($post_detail_xml);
     $post_social = find_xml_value($cp_post_xml->documentElement, 'post_social');
     $sidebar = find_xml_value($cp_post_xml->documentElement, 'sidebar_post');
     $right_sidebar = find_xml_value($cp_post_xml->documentElement, 'right_sidebar_post');
     $left_sidebar = find_xml_value($cp_post_xml->documentElement, 'left_sidebar_post');
     $thumbnail_types = find_xml_value($cp_post_xml->documentElement, 'post_thumbnail');
     $video_url_type = find_xml_value($cp_post_xml->documentElement, 'video_url_type');
     $select_slider_type = find_xml_value($cp_post_xml->documentElement, 'select_slider_type');
 }
 $select_layout_cp = '';
 $cp_general_settings = get_option('general_settings');
 if ($cp_general_settings != '') {
     $cp_logo = new DOMDocument();
     $cp_logo->loadXML($cp_general_settings);
     $select_layout_cp = find_xml_value($cp_logo->documentElement, 'select_layout_cp');
 }
 $sidebar_class = '';
 $content_class = '';
 //Get Sidebar for page
 $sidebar_class = sidebar_func($sidebar);
 $header_style = '';
 $html_class_banner = '';
 $html_class = print_header_class($header_style);
 if ($html_class != '') {
     $html_class_banner = 'banner';
 }
 $item_margin = '';
 $breadcrumbs = get_themeoption_value('breadcrumbs', 'general_settings');
 if ($breadcrumbs == 'disable') {
     $item_margin = 'item_margin_top';
コード例 #12
0
function social_settings()
{
    foreach ($_REQUEST as $keys => $values) {
        ${$keys} = trim($values);
    }
    $return_data = array('success' => '-1', 'alert' => 'Save option failed, please try contacting your host provider to increase the post_max_size and suhosin.post.max_vars varialble on the server.');
    ?>
<div class="cp-wrapper bootstrap_admin cp-margin-left"> 

    <!--content area start -->	  
	<div class="hbg top_navigation row-fluid">
		<div class="cp-logo span2">
			<img src="<?php 
    echo CP_PATH_URL;
    ?>
/framework/images/logo.png" class="logo" />
		</div>
		<div class="sidebar span10">
			<?php 
    echo top_navigation_html_tooltip();
    ?>
		</div>
	 <?php 
    //echo top_navigation_html();
    ?>
	</div>
	<div class="content-area-main row-fluid"> 
	
      <!--sidebar start -->
      <div class="sidebar-wraper span2">
        <div class="sidebar-sublinks">
       <ul id="wp_t_o_right_menu">
					<li class="social_networking" id="active_tab"><?php 
    _e('Social Networking', 'crunchpress');
    ?>
</li>
					<li class="social_sharing"><?php 
    _e('Social Sharing', 'crunchpress');
    ?>
</li>
				</ul>
        </div>
      </div>
		  <!--sidebar end --> 
		  <!--content start -->
		  <div class="content-area span10">
		  <?php 
    //echo top_navigation_html();
    ?>
			<form id="options-panel-form" name="cp-panel-form">
			  <div class="panel-elements" id="panel-elements">
				<div class="panel-element" id="panel-element-save-complete">
				  <div class="panel-element-save-text">
					<?php 
    _e('Save Options Complete', 'crunchpress');
    ?>
					.</div>
				  <div class="panel-element-save-arrow"></div>
				</div>
				<div class="panel-element">
			<?php 
    //Social Sharing and Networking Values Saving as XML
    if (isset($action) and $action == 'social_settings') {
        $social_xml = '<social_settings>';
        $social_xml = $social_xml . create_xml_tag('facebook_network', htmlspecialchars(stripslashes($facebook_network)));
        $social_xml = $social_xml . create_xml_tag('twitter_network', htmlspecialchars(stripslashes($twitter_network)));
        $social_xml = $social_xml . create_xml_tag('delicious_network', htmlspecialchars(stripslashes($delicious_network)));
        $social_xml = $social_xml . create_xml_tag('google_plus_network', htmlspecialchars(stripslashes($google_plus_network)));
        //$social_xml = $social_xml . create_xml_tag('su_network',$su_network);
        $social_xml = $social_xml . create_xml_tag('linked_in_network', htmlspecialchars(stripslashes($linked_in_network)));
        //$social_xml = $social_xml . create_xml_tag('digg_network',$digg_network);
        //$social_xml = $social_xml . create_xml_tag('myspace_network',$myspace_network);
        //$social_xml = $social_xml . create_xml_tag('reddit_network',$reddit_network);
        $social_xml = $social_xml . create_xml_tag('youtube_network', htmlspecialchars(stripslashes($youtube_network)));
        $social_xml = $social_xml . create_xml_tag('flickr_network', htmlspecialchars(stripslashes($flickr_network)));
        //$social_xml = $social_xml . create_xml_tag('picasa_network',$picasa_network);
        $social_xml = $social_xml . create_xml_tag('vimeo_network', htmlspecialchars(stripslashes($vimeo_network)));
        $social_xml = $social_xml . create_xml_tag('pinterest_network', htmlspecialchars(stripslashes($pinterest_network)));
        $social_xml = $social_xml . create_xml_tag('Instagram_network', htmlspecialchars(stripslashes($Instagram_network)));
        $social_xml = $social_xml . create_xml_tag('github_network', htmlspecialchars(stripslashes($github_network)));
        $social_xml = $social_xml . create_xml_tag('skype_network', htmlspecialchars(stripslashes($skype_network)));
        //Social Sharing
        $social_xml = $social_xml . create_xml_tag('facebook_sharing', htmlspecialchars(stripslashes($facebook_sharing)));
        $social_xml = $social_xml . create_xml_tag('twitter_sharing', htmlspecialchars(stripslashes($twitter_sharing)));
        $social_xml = $social_xml . create_xml_tag('stumble_sharing', htmlspecialchars(stripslashes($stumble_sharing)));
        $social_xml = $social_xml . create_xml_tag('delicious_sharing', htmlspecialchars(stripslashes($delicious_sharing)));
        $social_xml = $social_xml . create_xml_tag('googleplus_sharing', htmlspecialchars(stripslashes($googleplus_sharing)));
        $social_xml = $social_xml . create_xml_tag('digg_sharing', htmlspecialchars(stripslashes($digg_sharing)));
        $social_xml = $social_xml . create_xml_tag('myspace_sharing', htmlspecialchars(stripslashes($myspace_sharing)));
        $social_xml = $social_xml . create_xml_tag('reddit_sharing', htmlspecialchars(stripslashes($reddit_sharing)));
        $social_xml = $social_xml . '</social_settings>';
        if (!save_option('social_settings', get_option('social_settings'), $social_xml)) {
            die(json_encode($return_data));
        }
        die(json_encode(array('success' => '0')));
    }
    //Social Networking
    $facebook_network = '';
    $twitter_network = '';
    $delicious_network = '';
    $google_plus_network = '';
    $su_network = '';
    $linked_in_network = '';
    $digg_network = '';
    $myspace_network = '';
    $reddit_network = '';
    $youtube_network = '';
    $flickr_network = '';
    $picasa_network = '';
    $vimeo_network = '';
    $pinterest_network = '';
    $Instagram_network = '';
    $github_network = '';
    $skype_network = '';
    //Social Sharing
    $facebook_sharing = '';
    $twitter_sharing = '';
    $stumble_sharing = '';
    $delicious_sharing = '';
    $googleplus_sharing = '';
    $digg_sharing = '';
    $myspace_sharing = '';
    $reddit_sharing = '';
    //Getting Values from database
    $cp_social_settings = get_option('social_settings');
    if ($cp_social_settings != '') {
        $cp_social = new DOMDocument();
        $cp_social->loadXML($cp_social_settings);
        //Social Networking Values
        $facebook_network = find_xml_value($cp_social->documentElement, 'facebook_network');
        $twitter_network = find_xml_value($cp_social->documentElement, 'twitter_network');
        $delicious_network = find_xml_value($cp_social->documentElement, 'delicious_network');
        $google_plus_network = find_xml_value($cp_social->documentElement, 'google_plus_network');
        //$su_network = find_xml_value($cp_social->documentElement,'su_network');
        $linked_in_network = find_xml_value($cp_social->documentElement, 'linked_in_network');
        //$digg_network = find_xml_value($cp_social->documentElement,'digg_network');
        //$myspace_network = find_xml_value($cp_social->documentElement,'myspace_network');
        //$reddit_network = find_xml_value($cp_social->documentElement,'reddit_network');
        $youtube_network = find_xml_value($cp_social->documentElement, 'youtube_network');
        //$flickr_network = find_xml_value($cp_social->documentElement,'flickr_network');
        //$picasa_network = find_xml_value($cp_social->documentElement,'picasa_network');
        $vimeo_network = find_xml_value($cp_social->documentElement, 'vimeo_network');
        $pinterest_network = find_xml_value($cp_social->documentElement, 'pinterest_network');
        // Social Sharing Values
        $facebook_sharing = find_xml_value($cp_social->documentElement, 'facebook_sharing');
        $twitter_sharing = find_xml_value($cp_social->documentElement, 'twitter_sharing');
        $stumble_sharing = find_xml_value($cp_social->documentElement, 'stumble_sharing');
        $delicious_sharing = find_xml_value($cp_social->documentElement, 'delicious_sharing');
        $googleplus_sharing = find_xml_value($cp_social->documentElement, 'googleplus_sharing');
        $digg_sharing = find_xml_value($cp_social->documentElement, 'digg_sharing');
        $myspace_sharing = find_xml_value($cp_social->documentElement, 'myspace_sharing');
        $reddit_sharing = find_xml_value($cp_social->documentElement, 'reddit_sharing');
    }
    ?>
				
				</div>
						<ul class="social_networking">
							<!--Social Networking Start -->
							<li id="social_networking" class="social_network_class active_tab">
								<div class="row-fluid">
									<ul class="panel-body recipe_class span4">											
										<li class="panel-input full-width">
											<span class="panel-title">
												<h3 for="facebook_network" > <?php 
    _e('Facebook', 'crunchpress');
    ?>
 </h3>
											</span>	
											<input type="text" name="facebook_network" id="facebook_network" value="<?php 
    if ($facebook_network != '') {
        echo esc_url($facebook_network);
    }
    ?>
" />
											<div class="admin-social-image">
												<span class="facebook"><i class="fa fa-facebook"></i></span>
											</div>
											<p><?php 
    _e('Please paste your Profile URl', 'crunchpress');
    ?>
</p>
										</li>
									</ul>
									<ul class="panel-body recipe_class span4">
										<li class="panel-input full-width">
											<span class="panel-title">
												<h3 for="twitter_network" > <?php 
    _e('Twitter', 'crunchpress');
    ?>
 </h3>
											</span>
											<input type="text" name="twitter_network" id="twitter_network" value="<?php 
    if ($twitter_network != '') {
        echo esc_url($twitter_network);
    }
    ?>
" />
											<div class="admin-social-image">
												<span class="twitter"><i class="fa fa-twitter"></i></span>
											</div>
											<p> <?php 
    _e('Please paste your Profile URl', 'crunchpress');
    ?>
 </p>
										</li>
									</ul>
									<ul class="panel-body recipe_class span4">	
										<li class="panel-input full-width">
											<span class="panel-title">
												<h3 for="delicious_network" > <?php 
    _e('Delicious', 'crunchpress');
    ?>
 </h3>
											</span>
											<input type="text" name="delicious_network" id="delicious_network" value="<?php 
    if ($delicious_network != '') {
        echo esc_url($delicious_network);
    }
    ?>
" />
											<div class="admin-social-image">
												<span class="delicious"><i class="fa fa-delicious"></i></span>
											</div>
											<p> <?php 
    _e('Please paste your Profile URl', 'crunchpress');
    ?>
</p> 
										</li>
									</ul>
								</div>
								<div class="row-fluid">
									<ul class="panel-body recipe_class span4">												
										<li class="panel-input full-width ">
											<span class="panel-title">
												<h3 for="google_plus_network" > <?php 
    _e('Google Plus', 'crunchpress');
    ?>
 </h3>
											</span>	
											<input type="text" name="google_plus_network" id="google_plus_network" value="<?php 
    if ($google_plus_network != '') {
        echo esc_url($google_plus_network);
    }
    ?>
" />
											<div class="admin-social-image">
												<span class="googleplus"><i class="fa fa-google-plus"></i></span>
											</div>
											<p> <?php 
    _e('Please paste your Profile URl', 'crunchpress');
    ?>
 </p>
										</li>
									</ul>
								
									<!--<ul class="panel-body recipe_class">
										<li class="panel-title">
											<label for="su_network" > <?php 
    _e('Stumble Upon', 'crunchpress');
    ?>
 </h3>
										</li>				
										<li class="panel-input full-width">
											<input type="text" name="su_network" id="su_network" value="<?php 
    if ($su_network != '') {
        echo esc_url($su_network);
    }
    ?>
" />
											<div class="admin-social-image">
												<span class="su_network">&nbsp;</span>
											</div>
										</li>
										<li class="description">Please paste your Profile URl</li>
									</ul>-->
								
									<ul class="panel-body recipe_class span4">
												
										<li class="panel-input full-width ">
											<span class="panel-title">
											<h3 for="linked_in_network" > <?php 
    _e('Linked In', 'crunchpress');
    ?>
 </h3>
										</span>	
											<input type="text" name="linked_in_network" id="linked_in_network" value="<?php 
    if ($linked_in_network != '') {
        echo esc_url($linked_in_network);
    }
    ?>
" />
											<div class="admin-social-image">
												<span class="linkedin"><i class="fa fa-linkedin"></i></span>
											</div>
											<p> <?php 
    _e('Please paste your Profile URl', 'crunchpress');
    ?>
 </p>
										</li>
									</ul>
							
									<!--<ul class="panel-body recipe_class">
										<li class="panel-title">
											<label for="digg_network" > <?php 
    _e('Digg', 'crunchpress');
    ?>
 </h3>
										</li>				
										<li class="panel-input full-width">
											<input type="text" name="digg_network" id="digg_network" value="<?php 
    if ($digg_network != '') {
        echo esc_url($digg_network);
    }
    ?>
" />
											<div class="admin-social-image">
												<span class="digg">&nbsp;</span>
											</div>
										</li>
										<li class="description">Please paste your Profile URl</li>
									</ul>
									<div class="clear"></div>
									<ul class="panel-body recipe_class">
										<li class="panel-title">
											<label for="myspace_network" > <?php 
    _e('Myspace', 'crunchpress');
    ?>
 </h3>
										</li>				
										<li class="panel-input full-width">
											<input type="text" name="myspace_network" id="myspace_network" value="<?php 
    if ($myspace_network != '') {
        echo esc_url($myspace_network);
    }
    ?>
" />
											<div class="admin-social-image">
												<span class="myspace">&nbsp;</span>
											</div>
										</li>
										<li class="description">Please paste your Profile URl</li>
									</ul>
									<div class="clear"></div>
									<ul class="panel-body recipe_class">
										<li class="panel-title">
											<label for="reddit_network" > <?php 
    _e('Reddit', 'crunchpress');
    ?>
 </h3>
										</li>				
										<li class="panel-input full-width">
											<input type="text" name="reddit_network" id="reddit_network" value="<?php 
    if ($reddit_network != '') {
        echo esc_url($reddit_network);
    }
    ?>
" />
											<div class="admin-social-image">
												<span class="reddit">&nbsp;</span>
											</div>
										</li>
										<li class="description">Please paste your Profile URl</li>
									</ul>
									<div class="clear"></div>-->
									<ul class="panel-body recipe_class span4">
														
										<li class="panel-input full-width">
										<span class="panel-title">
											<h3 for="youtube_network" > <?php 
    _e('Youtube', 'crunchpress');
    ?>
 </h3>
										</span>
											<input type="text" name="youtube_network" id="youtube_network" value="<?php 
    if ($youtube_network != '') {
        echo esc_url($youtube_network);
    }
    ?>
" />
											<div class="admin-social-image">
												<span class="youtube"><i class="fa fa-youtube"></i></span>
											</div>
											<p> <?php 
    _e('Please paste your Profile URl', 'crunchpress');
    ?>
 </p>
										</li>
									</ul>
								</div>
								<div class="row-fluid">
									<ul class="panel-body recipe_class span4">
													
										<li class="panel-input full-width ">
										<span class="panel-title">
											<h3 for="flickr_network" > <?php 
    _e('Flickr', 'crunchpress');
    ?>
 </h3>
										</span>	
											<input type="text" name="flickr_network" id="flickr_network" value="<?php 
    if ($flickr_network != '') {
        echo esc_url($flickr_network);
    }
    ?>
" />
											<div class="admin-social-image">
												<span class="flickr"><i class="fa fa-flickr"></i></span>
											</div>
											<p> <?php 
    _e('Please paste your Profile URl', 'crunchpress');
    ?>
 </p>
										</li>
									</ul>
									<!--<div class="clear"></div>
									<ul class="panel-body recipe_class">
										<li class="panel-title">
											<label for="picasa_network" > <?php 
    _e('Picasa', 'crunchpress');
    ?>
 </h3>
										</li>				
										<li class="panel-input full-width">
											<input type="text" name="picasa_network" id="picasa_network" value="<?php 
    if ($picasa_network != '') {
        echo esc_url($picasa_network);
    }
    ?>
" />
											<div class="admin-social-image">
												<span class="picasa">&nbsp;</span>
											</div>
										</li>
										<li class="description">Please paste your Profile URl</li>
									</ul>-->
								
									<ul class="panel-body recipe_class span4">
											
										<li class="panel-input full-width ">
											<span class="panel-title">
											<h3 for="vimeo_network" > <?php 
    _e('Vimeo', 'crunchpress');
    ?>
 </h3>
										</span>		
											<input type="text" name="vimeo_network" id="vimeo_network" value="<?php 
    if ($vimeo_network != '') {
        echo esc_url($vimeo_network);
    }
    ?>
" />
											<div class="admin-social-image">
												<span class="vimeo"><i class="fa fa-vimeo-square"></i></span>
											</div>
											<p> <?php 
    _e('Please paste your Profile URl', 'crunchpress');
    ?>
 </p>
										</li>
									</ul>
									<ul class="panel-body recipe_class span4">
													
										<li class="panel-input full-width ">
										<span class="panel-title">
											<h3 for="pinterest_network" > <?php 
    _e('Pinterest', 'crunchpress');
    ?>
 </h3>
										</span>	
											<input type="text" name="pinterest_network" id="pinterest_network" value="<?php 
    if ($pinterest_network != '') {
        echo esc_url($pinterest_network);
    }
    ?>
" />
											<div class="admin-social-image">
												<span class="pinterest"><i class="fa fa-pinterest"></i></span>
											</div>
											<p> <?php 
    _e('Please paste your Profile URl', 'crunchpress');
    ?>
 </p>
										</li>
									</ul>	
								</div>
								<div class="row-fluid">
									<ul class="panel-body recipe_class span4">
													
										<li class="panel-input full-width ">
										<span class="panel-title">
											<h3> <?php 
    _e('Instagram', 'crunchpress');
    ?>
 </h3>
										</span>	
											<input type="text" name="Instagram_network" id="Instagram_network" value="<?php 
    if ($Instagram_network != '') {
        echo esc_url($Instagram_network);
    }
    ?>
" />
											<div class="admin-social-image">
												<span class="instagram"><i class="fa fa-instagram"></i></span>
											</div>
											<p> <?php 
    _e('Please paste your Profile URl', 'crunchpress');
    ?>
 </p>
										</li>
									</ul>
									<ul class="panel-body recipe_class span4">
										<li class="panel-input full-width ">
											<span class="panel-title">
											<h3> <?php 
    _e('Github', 'crunchpress');
    ?>
 </h3>
										</span>		
											<input type="text" name="github_network" id="github_network" value="<?php 
    if ($github_network != '') {
        echo esc_url($github_network);
    }
    ?>
" />
											<div class="admin-social-image">
												<span class="github"><i class="fa fa-github"></i></span>
											</div>
											<p> <?php 
    _e('Please paste your Profile URl', 'crunchpress');
    ?>
 </p>
										</li>
									</ul>
									<ul class="panel-body recipe_class span4">
										<li class="panel-input full-width ">
										<span class="panel-title">
											<h3> <?php 
    _e('Skype', 'crunchpress');
    ?>
 </h3>
										</span>	
											<input type="text" name="skype_network" id="skype_network" value="<?php 
    if ($skype_network != '') {
        echo esc_url($skype_network);
    }
    ?>
" />
											<div class="admin-social-image">
												<span class="skype"><i class="fa fa-skype"></i></span>
											</div>
											<p> <?php 
    _e('Please paste your Profile URl', 'crunchpress');
    ?>
 </p>
										</li>
									</ul>	
								</div>
							</li>
							<!--Social Sharing Start -->
							<li id="social_sharing" class="social_sharing_class">
								<div class="row-fluid">
									<ul class="panel-body recipe_class span4">
										<li class="panel-input full-width ">
											<span class="panel-title">
												<h3 for="facebook_sharing" > <?php 
    _e('FACEBOOK SHARING', 'crunchpress');
    ?>
 </h3>
											</span>
											<label for="facebook_sharing">
												<div class="checkbox-switch <?php 
    echo $facebook_sharing == 'enable' || $facebook_sharing == '' ? 'checkbox-switch-on' : 'checkbox-switch-off';
    ?>
"></div>
											</label>
											<input type="checkbox" name="facebook_sharing" class="checkbox-switch" value="disable" checked>
											<input type="checkbox" name="facebook_sharing" id="facebook_sharing" class="checkbox-switch" value="enable" <?php 
    echo $facebook_sharing == 'enable' || $facebook_sharing == '' ? 'checked' : '';
    ?>
>
											<div class="admin-social-image">
												<span class="facebook">&nbsp;</span>
											</div>
											<p> <?php 
    _e('Please turn On/Off sharing on post detail page.', 'crunchpress');
    ?>
</p>
										</li>
									</ul>
									<ul class="panel-body recipe_class span4">
										<li class="panel-input full-width ">
											<span class="panel-title">
												<h3 for="twitter_sharing" > <?php 
    _e('TWITTER SHARING', 'crunchpress');
    ?>
 </h3>
											</span>	
											<label for="twitter_sharing">
												<div class="checkbox-switch <?php 
    echo $twitter_sharing == 'enable' || $twitter_sharing == '' ? 'checkbox-switch-on' : 'checkbox-switch-off';
    ?>
"></div>
											</label>
											<input type="checkbox" name="twitter_sharing" class="checkbox-switch" value="disable" checked>
											<input type="checkbox" name="twitter_sharing" id="twitter_sharing" class="checkbox-switch" value="enable" <?php 
    echo $twitter_sharing == 'enable' || $twitter_sharing == '' ? 'checked' : '';
    ?>
>
											<div class="admin-social-image">
												<span class="twitter">&nbsp;</span>
											</div>
											<p> <?php 
    _e('Please turn On/Off sharing on post detail page.', 'crunchpress');
    ?>
 </p>
										</li>
									</ul>												
									<ul class="panel-body recipe_class span4">
										<li class="panel-input full-width ">
											<span class="panel-title">
												<h3 for="stumble_sharing" > <?php 
    _e('STUMBLEUPON SHARING', 'crunchpress');
    ?>
 </h3>
											</span>
											<label for="stumble_sharing">
												<div class="checkbox-switch <?php 
    echo $stumble_sharing == 'enable' || $stumble_sharing == '' ? 'checkbox-switch-on' : 'checkbox-switch-off';
    ?>
"></div>
											</label>
											<input type="checkbox" name="stumble_sharing" class="checkbox-switch" value="disable" checked>
											<input type="checkbox" name="stumble_sharing" id="stumble_sharing" class="checkbox-switch" value="enable" <?php 
    echo $stumble_sharing == 'enable' || $stumble_sharing == '' ? 'checked' : '';
    ?>
>
											<div class="admin-social-image">
												<span class="stumble">&nbsp;</span>
											</div>
											<p> <?php 
    _e('Please turn On/Off sharing on post detail page.', 'crunchpress');
    ?>
 </p>
										</li>
									</ul>
								</div>	
								<div class="row-fluid">							
									<ul class="panel-body recipe_class span4">									
										<li class="panel-input full-width ">
											<span class="panel-title">
												<h3 for="delicious_sharing" > <?php 
    _e('DELICIOUS SHARING', 'crunchpress');
    ?>
 </h3>
											</span>	
											<label for="delicious_sharing">
												<div class="checkbox-switch <?php 
    echo $delicious_sharing == 'enable' || $delicious_sharing == '' ? 'checkbox-switch-on' : 'checkbox-switch-off';
    ?>
"></div>
											</label>
											<input type="checkbox" name="delicious_sharing" class="checkbox-switch" value="disable" checked>
											<input type="checkbox" name="delicious_sharing" id="delicious_sharing" class="checkbox-switch" value="enable" <?php 
    echo $delicious_sharing == 'enable' || $delicious_sharing == '' ? 'checked' : '';
    ?>
>
											<div class="admin-social-image">
												<span class="delicious">&nbsp;</span>
											</div>
											<p> <?php 
    _e('Please turn On/Off sharing on post detail page.', 'crunchpress');
    ?>
</p>
										</li>
									</ul>											
									<ul class="panel-body recipe_class span4">
											
										<li class="panel-input full-width ">
										<span class="panel-title">
											<h3 for="googleplus_sharing" > <?php 
    _e('GOOGLE PLUS SHARING', 'crunchpress');
    ?>
 </h3>
										</span>
											<label for="googleplus_sharing">
												<div class="checkbox-switch <?php 
    echo $googleplus_sharing == 'enable' || $googleplus_sharing == '' ? 'checkbox-switch-on' : 'checkbox-switch-off';
    ?>
"></div>
											</label>
											<input type="checkbox" name="googleplus_sharing" class="checkbox-switch" value="disable" checked>
											<input type="checkbox" name="googleplus_sharing" id="googleplus_sharing" class="checkbox-switch" value="enable" <?php 
    echo $googleplus_sharing == 'enable' || $googleplus_sharing == '' ? 'checked' : '';
    ?>
>
											<div class="admin-social-image">
												<span class="googleplus">&nbsp;</span>
											</div>
											<p> <?php 
    _e('Please turn On/Off sharing on post detail page.', 'crunchpress');
    ?>
 </p>
										</li>
										
									</ul>											
									<ul class="panel-body recipe_class span4">
										<li class="panel-input full-width ">
											<span class="panel-title">
												<h3 for="digg_sharing" > <?php 
    _e('DIGG SHARING', 'crunchpress');
    ?>
 </h3>
											</span>
											<label for="digg_sharing">
												<div class="checkbox-switch <?php 
    echo $digg_sharing == 'enable' || $digg_sharing == '' ? 'checkbox-switch-on' : 'checkbox-switch-off';
    ?>
"></div>
											</label>
											<input type="checkbox" name="digg_sharing" class="checkbox-switch" value="disable" checked>
											<input type="checkbox" name="digg_sharing" id="digg_sharing" class="checkbox-switch" value="enable" <?php 
    echo $digg_sharing == 'enable' || $digg_sharing == '' ? 'checked' : '';
    ?>
>
											<div class="admin-social-image">
												<span class="digg">&nbsp;</span>
											</div>
											<p> <?php 
    _e('Please turn On/Off sharing on post detail page.', 'crunchpress');
    ?>
</p>
										</li>
									</ul>
								</div>	
								<div class="row-fluid">										
									<ul class="panel-body recipe_class span4">									
										<li class="panel-input full-width ">
											<span class="panel-title">
												<h3 for="myspace_sharing" > <?php 
    _e('MYSPACE SHARING', 'crunchpress');
    ?>
 </h3>
											</span>	
											<label for="myspace_sharing">
												<div class="checkbox-switch <?php 
    echo $myspace_sharing == 'enable' || $myspace_sharing == '' ? 'checkbox-switch-on' : 'checkbox-switch-off';
    ?>
"></div>
											</label>
											<input type="checkbox" name="myspace_sharing" class="checkbox-switch" value="disable" checked>
											<input type="checkbox" name="myspace_sharing" id="myspace_sharing" class="checkbox-switch" value="enable" <?php 
    echo $myspace_sharing == 'enable' || $myspace_sharing == '' ? 'checked' : '';
    ?>
>
											<div class="admin-social-image">
												<span class="myspace">&nbsp;</span>
											</div>
											<p> <?php 
    _e('Please turn On/Off sharing on post detail page.', 'crunchpress');
    ?>
 </p>
										</li>
									</ul>
									<ul class="panel-body recipe_class span4">
										<li class="panel-input full-width ">
											<span class="panel-title">
												<h3 for="reddit_sharing" > <?php 
    _e('REDDIT SHARING', 'crunchpress');
    ?>
 </h3>
											</span>	
											<label for="reddit_sharing">
												<div class="checkbox-switch <?php 
    echo $reddit_sharing == 'enable' || $reddit_sharing == '' ? 'checkbox-switch-on' : 'checkbox-switch-off';
    ?>
"></div>
											</label>
											<input type="checkbox" name="reddit_sharing" class="checkbox-switch" value="disable" checked>
											<input type="checkbox" name="reddit_sharing" id="reddit_sharing" class="checkbox-switch" value="enable" <?php 
    echo $reddit_sharing == 'enable' || $reddit_sharing == '' ? 'checked' : '';
    ?>
>
											<div class="admin-social-image">
												<span class="reddit">&nbsp;</span>
											</div>
											<p> <?php 
    _e('Please turn On/Off sharing on post detail page.', 'crunchpress');
    ?>
 </p>
										</li>
									</ul>
								</div>							
							</li>
					
					<div class="panel-element-tail">
						<div class="tail-save-changes">
							<div class="loading-save-changes"></div>
							<input type="submit" value="<?php 
    echo __('Save Changes', 'crunchpress');
    ?>
">
							<input type="hidden" name="action" value="social_settings">
							<!--<input type="hidden" name="security" value="<?php 
    //echo wp_create_nonce(plugin_basename(__FILE__))
    ?>
">--> 
						</div>
					</div>
				</div>
			</form>
		  </div>
		  <!--content End --> 
		</div>
		<!--content area end --> 
	  </div>
		<?php 
}
コード例 #13
0
function print_featured_item($item_xml)
{
    global $post, $counter;
    //Fetch elements data from database
    $header = find_xml_value($item_xml, 'header');
    $category = find_xml_value($item_xml, 'category');
    $number_posts = find_xml_value($item_xml, 'number-of-posts');
    //Condition for Header
    if ($header != '') {
        echo '<h2 class="h-style">' . $header . '</h2>';
    }
    ?>
		<?php 
    //Bx Slider Script Calling
    wp_register_script('cp-bx-slider', CP_PATH_URL . '/frontend/js/bxslider.min.js', false, '1.0', true);
    wp_enqueue_script('cp-bx-slider');
    wp_enqueue_style('cp-bx-slider', CP_PATH_URL . '/frontend/css/bxslider.css');
    ?>
		<script type="text/javascript">
		jQuery(document).ready(function ($) {
			"use strict";
			if ($('#feature-<?php 
    echo $counter;
    ?>
').length) {
				$('#feature-<?php 
    echo $counter;
    ?>
').bxSlider({
					minSlides: 1,
					maxSlides: 1,
					auto:true,
					mode:'fade',
					pagerCustom: '#bx-pager'
				});
			}
		});
		</script>			
				<ul id="feature-<?php 
    echo $counter;
    ?>
" class="news-listing">
					<?php 
    if ($category == '0') {
        //Popular Post
        query_posts(array('post_type' => 'post', 'posts_per_page' => 3, 'orderby' => 'title', 'order' => 'ASC'));
    } else {
        //Popular Post
        query_posts(array('post_type' => 'post', 'posts_per_page' => 3, 'tax_query' => array(array('taxonomy' => 'category', 'terms' => $category, 'field' => 'term_id')), 'orderby' => 'title', 'order' => 'ASC'));
    }
    while (have_posts()) {
        the_post();
        global $post, $post_id;
        //Post Extra Information
        $thumbnail_types = '';
        $post_detail_xml = get_post_meta($post->ID, 'post_detail_xml', true);
        if ($post_detail_xml != '') {
            $cp_post_xml = new DOMDocument();
            $cp_post_xml->loadXML($post_detail_xml);
            $thumbnail_types = find_xml_value($cp_post_xml->documentElement, 'post_thumbnail');
            $video_url_type = find_xml_value($cp_post_xml->documentElement, 'video_url_type');
            $select_slider_type = find_xml_value($cp_post_xml->documentElement, 'select_slider_type');
        }
        $width_class_first = '';
        $thumbnail_id = get_post_thumbnail_id($post->ID);
        $thumbnail = wp_get_attachment_image_src($thumbnail_id, array(1170, 350));
        ?>
						<li class="frame">
							<?php 
        echo get_the_post_thumbnail($post->ID, array(1170, 350));
        ?>
							<div class="detail-row">
								<a href="<?php 
        echo get_permalink();
        ?>
"><i class="fa fa-calendar"></i><?php 
        echo get_the_date();
        ?>
</a> <?php 
        the_tags('<i class="fa fa-pencil"></i>', '', '');
        comments_popup_link(__('<i class="fa fa-comments-o"></i> 0 Comment', 'crunchpress'), __('<i class="fa fa-comments-o"></i> 1 Comment', 'crunchpress'), __('<i class="fa fa-comments-o"></i> % Comments', 'crunchpress'), '', __('<i class="fa fa-comments-o"></i> Comments are off', 'crunchpress'));
        ?>
							</div>
							<div class="caption"> <strong class="title"><?php 
        echo get_the_title();
        ?>
</strong>
							<p><?php 
        echo mb_substr(get_the_content(), 0, 150);
        ?>
</p>
							</div>
						</li>
					<?php 
    }
    ?>
	
				</ul>
		<?php 
}
コード例 #14
0
 function nv_slide_manager($args)
 {
     global $xml_name;
     if (!empty($args)) {
         extract($args);
     }
     echo '<div class="meta-input-slider">';
     echo '<div class="slide-manager" id="slide-manager">';
     echo '<div class="selected-slide" id="selected-slide">';
     echo '<div id="selected-slide-none"></div>';
     echo '<ul>';
     echo '<li id="default-slide" class="default-slide">';
     echo '<div class="selected-slide-wrapper">';
     echo '<img src="' . get_template_directory_uri() . '/lib/adm/images/no-image.png"/>';
     echo '<span title="' . __('Edit', 'options_framework_theme') . '" class="button button-primary edit-slide dashicons dashicons-edit" data-code="f464"></span>';
     echo '<span title="' . __('Are you sure?', 'options_framework_theme') . '" class="button remove-slide dashicons dashicons-trash" data-code="f182"></span>';
     echo '</div>';
     echo '<input type="hidden" class="slide-media-url" id="' . $xml_name['image'] . '" />';
     echo '<div class="slide-options-wrapper" data-title="' . __('Slide Options', 'options_framework_theme') . '">';
     echo '<div class="options-inner-wrapper">';
     echo '<div class="button-wrapper top">';
     echo '<h3 class="slide-options-title">' . __('Slide Options', 'options_framework_theme') . '</h3>';
     echo '<span class="button close-options">X</span>';
     echo '</div>';
     echo '<div id="slide-options" class="slide-options">';
     echo '<table>';
     get_slide_options('new', $xml_name, '');
     echo '</table>';
     echo '</div>';
     echo '<div class="button-wrapper bottom">';
     echo '<span class="button button-primary close-options">' . __('Done', 'options_framework_theme') . '</span>';
     echo '</div>';
     echo '</div>';
     echo '</div>';
     echo '</li>';
     if (!empty($value)) {
         foreach ($value->childNodes as $slider) {
             $thumb_src_preview = wp_get_attachment_image_src(find_xml_value($slider, 'image'), 'thumbnail');
             $thumbnail = $thumb_src_preview[0];
             $image_url_preview = find_xml_value($slider, 'image_url');
             if (empty($thumb_src_preview) && !empty($image_url_preview)) {
                 $thumbnail = $image_url_preview;
             }
             echo '<li class="slide-init">';
             echo '<div class="selected-slide-wrapper">';
             echo '<img src="' . $thumbnail . '"/>';
             echo '<span title="' . __('Edit', 'options_framework_theme') . '" class="button button-primary edit-slide dashicons dashicons-edit" data-code="f464"></span>';
             echo '<span title="' . __('Are you sure?', 'options_framework_theme') . '" class="button remove-slide dashicons dashicons-trash" data-code="f182"></span>';
             echo '</div>';
             echo '<input type="hidden" class="slide-media-url" id="' . $xml_name['image'] . '[]" name="' . $xml_name['image'] . '[]" value="' . find_xml_value($slider, 'image') . '" />';
             echo '<div class="slide-options-wrapper" data-title="' . __('Slide Options', 'options_framework_theme') . '">';
             echo '<div class="options-inner-wrapper">';
             echo '<div class="button-wrapper top">';
             echo '<h3 class="slide-options-title">' . __('Slide Options', 'options_framework_theme') . '</h3>';
             echo '<span class="button close-options">X</span>';
             echo '</div>';
             echo '<div id="slide-options" class="slide-options">';
             echo '<table>';
             get_slide_options('saved', $xml_name, $slider);
             echo '</table>';
             echo '</div>';
             echo '<div class="button-wrapper bottom">';
             echo '<span class="button button-primary close-options">' . __('Done', 'options_framework_theme') . '</span>';
             echo '</div>';
             echo '</div>';
             echo '</div>';
             echo '</li>';
         }
     }
     echo '</ul>';
     echo '<br class="clear" />';
     echo '</div>';
 }
コード例 #15
0
ファイル: cp_portfolio.php プロジェクト: pcco/portal-redesign
        function print_port_item($item_xml)
        {
            wp_reset_query();
            global $paged, $sidebar, $team_div_size_num_class, $post, $counter;
            if (empty($paged)) {
                $paged = get_query_var('page') ? get_query_var('page') : 1;
            }
            $category = find_xml_value($item_xml, 'category');
            // get the blog meta value
            $header = find_xml_value($item_xml, 'header');
            $num_fetch = find_xml_value($item_xml, 'num-fetch');
            $num_excerpt = find_xml_value($item_xml, 'num-excerpt');
            if (empty($num_excerpt)) {
                $num_excerpt = '200';
            }
            if (!empty($header)) {
                echo '<h2 class="heading">' . $header . '</h2>';
            }
            echo '
                <div class="portfolio-list">
                	<ul class="row-fluid">';
            if ($category == '0') {
                query_posts(array('posts_per_page' => $num_fetch, 'paged' => $paged, 'post_type' => 'portfolio', 'post_status' => 'publish', 'order' => 'DESC'));
            } else {
                query_posts(array('posts_per_page' => $num_fetch, 'paged' => $paged, 'post_type' => 'portfolio', 'tax_query' => array(array('taxonomy' => 'portfolio-category', 'field' => 'term_id', 'terms' => $category)), 'post_status' => 'publish', 'order' => 'DESC'));
            }
            $counter_team = 0;
            while (have_posts()) {
                the_post();
                //Fetching All Tracks from Database
                $track_name_xml = get_post_meta($post->ID, 'add_project_xml', true);
                $track_url_xml = get_post_meta($post->ID, 'add_project_field_xml', true);
                //Empty Variables
                //$album_download = '';
                $children = '';
                $children_title = '';
                //Track Name
                if ($track_name_xml != '') {
                    $ingre_xml = new DOMDocument();
                    $ingre_xml->recover = TRUE;
                    $ingre_xml->loadXML($track_name_xml);
                    $children_name = $ingre_xml->documentElement->childNodes;
                }
                //Track URL
                if ($track_url_xml != '') {
                    $ingre_title_xml = new DOMDocument();
                    $ingre_title_xml->recover = TRUE;
                    $ingre_title_xml->loadXML($track_url_xml);
                    $children_title = $ingre_title_xml->documentElement->childNodes;
                }
                $port_class = '';
                if ($counter_team % 4 == 0) {
                    $port_class = 'first';
                } else {
                    $post_class = 'no-class';
                }
                $counter_team++;
                ?>

				<!--LIST ITEM START-->
				<li class="span3 <?php 
                echo $port_class;
                ?>
">
					<div class="portfolio-wrapper">
						<div class="thumb">
							<?php 
                echo get_the_post_thumbnail($post->ID, array(614, 614));
                ?>

							<div class="caption">
								<h5><?php 
                echo get_the_title();
                ?>
</h5>
								<p><?php 
                $variable_category = wp_get_post_terms($post->ID, 'portfolio-category');
                $counterr = 0;
                foreach ($variable_category as $values) {
                    $counterr++;
                    echo '<a class="portfolio-tag" href="' . get_term_link(intval($values->term_id), 'portfolio-category') . '">' . $values->name . '</a>  ';
                }
                ?>

								</p>
								<div class="cp-rating">
									<?php 
                if (function_exists('taqyeem_get_score')) {
                    taqyeem_get_score($post->ID);
                }
                ?>

								</div>
								<p><?php 
                echo substr(get_the_content(), 0, 200);
                ?>
</p>
							</div>
						</div>
						<div class="text">
							<?php 
                //Combine Loop
                if ($track_name_xml != '' || $track_url_xml != '') {
                    $counter = 0;
                    $nofields = $ingre_xml->documentElement->childNodes->length;
                    if ($nofields != 0) {
                        for ($i = 0; $i < 1; $i++) {
                            $counter++;
                            if (isset($track_name_xml)) {
                                echo '<h5>' . $children_name->item($i)->nodeValue . '</h5>';
                            }
                            if (isset($track_url_xml)) {
                                echo '<p>' . $children_title->item($i)->nodeValue . '</p>';
                            }
                        }
                    } else {
                        echo '<h5>Type</h5>';
                        echo '<p>No Type Found</p>';
                    }
                }
                ?>

							<a href="<?php 
                echo get_permalink();
                ?>
" class="view-project"><?php 
                _e('View Project', 'crunchpress');
                ?>
</a>
						</div>
					</div>
				</li>
				<!--LIST ITEM START-->
			<?php 
            }
            echo '      </ul>
                </div>';
        }
コード例 #16
0
ファイル: page-item.php プロジェクト: uglmee/kikiku.com
function print_page_item($item_xml)
{
    wp_reset_query();
    global $paged;
    global $sidebar;
    global $port_div_size_num_class;
    global $class_to_num;
    if (empty($paged)) {
        $paged = get_query_var('page') ? get_query_var('page') : 1;
    }
    // get the item class and size from array
    $port_size = find_xml_value($item_xml, 'item-size');
    // get the item class and size from array
    $item_class = $port_div_size_num_class[$port_size]['class'];
    if ($sidebar == "no-sidebar") {
        $item_size = $port_div_size_num_class[$port_size]['size'];
    } else {
        if ($sidebar == "left-sidebar" || $sidebar == "right-sidebar") {
            $item_size = $port_div_size_num_class[$port_size]['size2'];
        } else {
            $item_size = $port_div_size_num_class[$port_size]['size3'];
        }
    }
    // get the page meta value
    $header = find_xml_value($item_xml, 'header');
    $num_fetch = find_xml_value($item_xml, 'num-fetch');
    $num_excerpt = find_xml_value($item_xml, 'num-excerpt');
    // page header
    if (!empty($header)) {
        echo '<h3 class="portfolio-header-title title-color gdl-title">' . $header . '</h3>';
    }
    global $post;
    $post_temp = query_posts(array('post_type' => 'page', 'paged' => $paged, 'post_parent' => $post->ID, 'posts_per_page' => $num_fetch));
    echo '<div id="portfolio-item-holder" class="portfolio-item-holder">';
    while (have_posts()) {
        the_post();
        // start printing data
        echo '<div class="' . $item_class . ' portfolio-item">';
        $image_type = get_post_meta($post->ID, 'post-option-featured-image-type', true);
        $image_type = empty($image_type) ? "Link to Current Post" : $image_type;
        $thumbnail_id = get_post_thumbnail_id();
        $thumbnail = wp_get_attachment_image_src($thumbnail_id, $item_size);
        $alt_text = get_post_meta($thumbnail_id, '_wp_attachment_image_alt', true);
        $hover_thumb = "hover-link";
        $pretty_photo = "";
        $permalink = get_permalink();
        if (!empty($thumbnail[0])) {
            echo '<div class="portfolio-thumbnail-image">';
            echo '<div class="overflow-hidden">';
            echo '<a href="' . $permalink . '" ' . $pretty_photo . ' title="' . get_the_title() . '">';
            echo '<span class="portfolio-thumbnail-image-hover">';
            echo '<span class="' . $hover_thumb . '"></span>';
            echo '</span>';
            echo '</a>';
            echo '<img src="' . $thumbnail[0] . '" alt="' . $alt_text . '"/>';
            echo '</div>';
            // overflow-hidden
            echo '</div>';
            // portfolio-thumbnail-image
        } else {
            echo '<div class="port-no-image" style="width:' . gdl_get_width($item_size) . 'px; height: ' . gdl_get_height($item_size) . 'px;"></div>';
        }
        $show_port_title = find_xml_value($item_xml, "show-title") == "Yes";
        $show_port_excerpt = find_xml_value($item_xml, "show-excerpt") == "Yes";
        if ($show_port_excerpt || $show_port_title) {
            echo '<div class="portfolio-thumbnail-context">';
            // page title
            if ($show_port_title) {
                echo '<h2 class="portfolio-thumbnail-title port-title-color gdl-title"><a href="' . get_permalink() . '">' . get_the_title() . '</a></h2>';
            }
            // page excerpt
            if ($show_port_excerpt) {
                echo '<div class="portfolio-thumbnail-content">' . mb_substr(get_the_excerpt(), 0, $num_excerpt) . '</div>';
            }
            echo '</div>';
        }
        echo '</div>';
    }
    echo "</div>";
    echo '<div class="clear"></div>';
    if (find_xml_value($item_xml, "pagination") == "Yes") {
        pagination();
    }
}
コード例 #17
0
ファイル: misc.php プロジェクト: uglmee/kikiku.com
function print_anything_slider($slider_xml, $size = '980x360')
{
    if (empty($slider_xml)) {
        return;
    }
    global $gdl_is_responsive;
    echo '<ul id="slider" class="anythingSlider" style="width:' . gdl_get_width($size) . 'px; height:' . gdl_get_height($size) . 'px;">';
    foreach ($slider_xml->childNodes as $slider) {
        $title = find_xml_value($slider, 'title');
        $caption = html_entity_decode(find_xml_value($slider, 'caption'));
        $link = find_xml_value($slider, 'link');
        $link_type = find_xml_value($slider, 'linktype');
        $image_url = wp_get_attachment_image_src(find_xml_value($slider, 'image'), $size);
        echo '<li>';
        if ($link_type == 'Link to Video') {
            echo get_video($link, gdl_get_width($size), gdl_get_height($size));
        } else {
            if ($link_type == 'Lightbox') {
                $image_full_url = wp_get_attachment_image_src(find_xml_value($slider, 'image'), 'full');
                echo '<a href="' . $image_full_url[0] . '" data-rel="prettyPhoto" title=""  >';
            } else {
                if ($link_type != 'No Link') {
                    echo '<a href="' . $link . '" alt="" >';
                }
            }
            echo '<img src="' . $image_url[0] . '" alt="" />';
            if (!empty($title) || !empty($caption)) {
                echo '<div class="caption-bottom gdl-slider-caption">';
                echo '<div class="gdl-slider-title gdl-title">' . $title . '</div>' . $caption;
                echo '</div>';
            }
            if ($link_type != 'No Link') {
                echo '</a>';
            }
        }
        echo '</li>';
    }
    echo "</ul>";
}
コード例 #18
0
function print_wooproduct_item($item_xml)
{
    global $paged, $sidebar, $wooproduct_class, $post, $wp_query, $counter;
    if (empty($paged)) {
        $paged = get_query_var('page') ? get_query_var('page') : 1;
    }
    $sidebar_class = '';
    $layout_set_ajax = '';
    $item_type = 'Full-Image';
    // get the item class and size from array
    $item_class = $wooproduct_class[$item_type]['class'];
    $item_index = $wooproduct_class[$item_type]['index'];
    $full_content = find_xml_value($item_xml, 'show-full-news-post');
    if ($sidebar == "no-sidebar") {
        $item_size = $wooproduct_class[$item_type]['size'];
        $sidebar_class = 'no_sidebar';
    } else {
        if ($sidebar == "left-sidebar" || $sidebar == "right-sidebar") {
            $sidebar_class = 'one_sidebar';
            $item_size = $wooproduct_class[$item_type]['size2'];
        } else {
            $sidebar_class = 'two_sidebar';
            $item_size = $wooproduct_class[$item_type]['size3'];
        }
    }
    // get the product meta value
    $header = find_xml_value($item_xml, 'header');
    $category = find_xml_value($item_xml, 'category');
    $num_fetch = find_xml_value($item_xml, 'num-fetch');
    $num_excerpt = find_xml_value($item_xml, 'num-excerpt');
    $select_layout_cp = '';
    $cp_general_settings = get_option('general_settings');
    if ($cp_general_settings != '') {
        $cp_logo = new DOMDocument();
        $cp_logo->loadXML($cp_general_settings);
        $select_layout_cp = find_xml_value($cp_logo->documentElement, 'select_layout_cp');
    }
    $show_filterable = find_xml_value($item_xml, 'filterable');
    $layout_select = find_xml_value($item_xml, 'layout_select');
    $pagination = find_xml_value($item_xml, 'pagination');
    //Theme Default Pagination
    if (find_xml_value($item_xml, "pagination") == 'Wp-Default') {
        $num_fetch = get_option('posts_per_page');
    } else {
        if (find_xml_value($item_xml, "pagination") == 'Theme-Custom') {
            $num_fetch = find_xml_value($item_xml, 'num-fetch');
        } else {
        }
    }
    $function_library = new function_library();
    if (class_exists("Woocommerce")) {
        $quan = array();
        $quantity = '';
        $total = '';
        $currency = '';
        if ($show_filterable == 'Yes' and $layout_select == 'Grid') {
            if ($category == '0') {
                query_posts(array('post_type' => 'product', 'posts_per_page' => -1, 'orderby' => 'title', 'order' => 'ASC'));
            } else {
                query_posts(array('post_type' => 'product', 'posts_per_page' => -1, 'paged' => $paged, 'tax_query' => array(array('taxonomy' => 'product_cat', 'terms' => $category, 'field' => 'term_id')), 'orderby' => 'title', 'order' => 'ASC'));
            }
            $counter_portfolio = 0;
            //Filterable Recipe Script start
            ?>
	<script type="text/javascript">
		jQuery(window).load(function() {
			var filter_container = jQuery('#portfolio-item-holder-<?php 
            echo $counter;
            ?>
');

			filter_container.children().css('position','absolute');	
			filter_container.masonry({
				singleMode: true,
				itemSelector: '.portfolio-item:not(.hide)',
				animate: true,
				animationOptions:{ duration: 800, queue: false }
			});	
			jQuery(window).resize(function(){
				var temp_width =  filter_container.children().filter(':first').width() + 30;
				filter_container.masonry({
					columnWidth: temp_width,
					singleMode: true,
					itemSelector: '.portfolio-item:not(.hide)',
					animate: true,
					animationOptions:{ duration: 800, queue: false }
				});		
			});	
			jQuery('ul#portfolio-item-filter-<?php 
            echo $counter;
            ?>
 a').click(function(e){	

				jQuery(this).addClass("active");
				jQuery(this).parents("li").siblings().children("a").removeClass("active");
				e.preventDefault();
				
				var select_filter = jQuery(this).attr('data-value');
				
				if( select_filter == "All" || jQuery(this).parent().index() == 0 ){		
					filter_container.children().each(function(){
						if( jQuery(this).hasClass('hide') ){
							jQuery(this).removeClass('hide');
							jQuery(this).fadeIn();
						}
					});
				}else{
					filter_container.children().not('.' + select_filter).each(function(){
						if( !jQuery(this).hasClass('hide') ){
							jQuery(this).addClass('hide');
							jQuery(this).fadeOut();
						}
					});
					filter_container.children('.' + select_filter).each(function(){
						if( jQuery(this).hasClass('hide') ){
							jQuery(this).removeClass('hide');
							jQuery(this).fadeIn();
						}
					});
				}
				
				filter_container.masonry();	
				
			});
		});
		</script>
		<figure class="page_title">
			<?php 
            if ($header != '') {
                ?>
				<div class="first">
					<h2><?php 
                echo $header;
                ?>
</h2>
				</div>
			<?php 
            }
            ?>
			
			<div class="title_right">
				<div id="cart_dropdown" class="dropdown">
					<ul id="portfolio-item-filter-<?php 
            echo $counter;
            ?>
" class="category_list_filterable">
						<li><a data-value="all" class="cp-button active" href="#"><?php 
            _e('All', 'crunchpress');
            ?>
</a></li>
						<?php 
            $categories = get_categories(array('child_of' => $category, 'taxonomy' => 'product_cat', 'hide_empty' => 0));
            //$categories = get_the_terms( $post->ID, 'recipe-category' );
            if ($categories != "") {
                foreach ($categories as $values) {
                    ?>
								<li><a data-value="<?php 
                    echo $values->term_id;
                    ?>
" class="cp-button" href="#"><?php 
                    echo $values->name;
                    ?>
</a></li>                                
							<?php 
                }
            }
            ?>
                            						
					</ul>
				</div>
			</div>	
		</figure>
		<hr />
		<section class="product_view span12 first filterable-grid-style" id="product_grid">  
			<div id="portfolio-item-holder-<?php 
            echo $counter;
            ?>
" class="product_image_holder row grid-style">
				<?php 
            $permalink_structure = get_option('permalink_structure');
            if ($permalink_structure != '') {
                $permalink_structure = '?';
            } else {
                $permalink_structure = '&';
            }
            $counter_product = 0;
            while (have_posts()) {
                the_post();
                global $post, $post_id, $product, $product_url;
                $regular_price = get_post_meta($post->ID, '_regular_price', true);
                if ($regular_price == '') {
                    $regular_price = get_post_meta($post->ID, '_max_variation_regular_price', true);
                }
                $sale_price = get_post_meta($post->ID, '_sale_price', true);
                if ($sale_price == '') {
                    $sale_price = get_post_meta($post->ID, '_min_variation_sale_price', true);
                }
                $sku_num = get_post_meta($post->ID, '_sku', true);
                $currency = get_woocommerce_currency_symbol();
                ?>
						
						
						<!--PRODUCT LIST ITEM START-->
						<div id="product-<?php 
                echo $post->ID;
                ?>
" class="product-box all portfolio-item item alpha <?php 
                $categories = get_the_terms($post->ID, 'product_cat');
                if ($categories != '') {
                    foreach ($categories as $category) {
                        echo $category->term_id . " ";
                    }
                }
                ?>
">
							<div class="frame"> <a href="<?php 
                echo get_permalink();
                ?>
"><?php 
                echo get_the_post_thumbnail($post_id, array(350, 350));
                ?>
</a>
								<div class="caption">
									<form enctype="multipart/form-data" method="post" class="cart" action="<?php 
                echo get_permalink();
                echo $permalink_structure;
                ?>
add-to-cart=<?php 
                echo $post->ID;
                ?>
">
										<!--<div class="quantity buttons_added"><input type="button" class="minus" value="-">
										<input type="number" class="input-text qty text" title="Qty" value="1" name="quantity" step="1">
										<input type="button" class="plus" value="+"></div>-->
										<button class="add_to_cart_button button product_type_simple added" data-quantity="1" data-product_sku="<?php 
                echo $sku_num;
                ?>
" data-product_id="<?php 
                echo $post->ID;
                ?>
" type="submit"><?php 
                _e('Add to cart', 'crunchpress');
                ?>
</button>
									</form>
									<div class="bottom-row woocommerce">
										<?php 
                if (get_option('woocommerce_enable_review_rating') === 'no') {
                    return;
                }
                $count = $product->get_rating_count();
                $average = $product->get_average_rating();
                if ($count > 0) {
                    ?>

												<div class="woocommerce-product-rating" >
													<div class="star-rating" title="<?php 
                    printf(__('Rated %s out of 5', 'woocommerce'), $average);
                    ?>
">
														<span class="rating-star-cp" style="width:<?php 
                    echo $average / 5 * 100;
                    ?>
%">
															<!--<strong itemprop="ratingValue" class="rating"><?php 
                    echo esc_html($average);
                    ?>
</strong> <?php 
                    _e('out of 5', 'woocommerce');
                    ?>
-->
														</span>
													</div>
													<!--<a href="#reviews" class="woocommerce-review-link" rel="nofollow">(<?php 
                    printf(_n('%s customer review', '%s customer reviews', $count, 'woocommerce'), '<span itemprop="ratingCount" class="count">' . $count . '</span>');
                    ?>
)</a>-->
												</div>

											<?php 
                }
                ?>
										<a href="<?php 
                echo get_permalink();
                ?>
" class="like"><i class="fa fa-file-text-o"></i></a>
									</div>
								</div>
							</div>
						  <div class="bottom"> <strong class="title"><?php 
                echo get_the_title();
                ?>
</strong> <strong class="price"><?php 
                echo $currency;
                if ($sale_price != '') {
                    echo $sale_price;
                } else {
                    echo $regular_price;
                }
                ?>
</strong> </div>
						</div>
						<!--PRODUCT LIST ITEM END-->
						<?php 
                $counter_product++;
            }
            //End While
            ?>
			</div>	
		</section>
		<?php 
        } else {
            if ($layout_select == 'Grid') {
                wp_reset_query();
                wp_reset_postdata();
                //Default Query For Grid
                if ($category == '0') {
                    query_posts(array('post_type' => 'product', 'posts_per_page' => $num_fetch, 'paged' => $paged, 'orderby' => 'title', 'order' => 'ASC'));
                } else {
                    query_posts(array('post_type' => 'product', 'posts_per_page' => $num_fetch, 'paged' => $paged, 'tax_query' => array(array('taxonomy' => 'product_cat', 'terms' => $category, 'field' => 'term_id')), 'orderby' => 'title', 'post_status' => 'publish', 'order' => 'ASC'));
                }
                ?>
		<!--Cart Listing -->
		<?php 
                if ($header != '') {
                    ?>
		<figure class="page_title">
			<div class="span8 first">
				<h2><?php 
                    echo $header;
                    ?>
</h2>
			</div>
			<?php 
                    if (!empty($woocommerce)) {
                        echo $woocommerce->messages[0];
                    }
                    ?>
			<div class="span4 title_right">
			</div>
		</figure>
		<?php 
                }
                ?>
		<!--Cart Listing Ends-->
		
		<!--Grid View Start-->
		<section class="product_view" id="product_grid">  
			<div class="row-fluid grid-list-view product_image_holder grid-style">
				<?php 
                $counter_product = 0;
                while (have_posts()) {
                    the_post();
                    global $post, $post_id, $product, $product_url, $woocommerce;
                    $permalink_structure = get_option('permalink_structure');
                    if ($permalink_structure != '') {
                        $permalink_structure = '?';
                    } else {
                        $permalink_structure = '&';
                    }
                    $regular_price = get_post_meta($post->ID, '_regular_price', true);
                    if ($regular_price == '') {
                        $regular_price = get_post_meta($post->ID, '_max_variation_regular_price', true);
                    }
                    $sale_price = get_post_meta($post->ID, '_sale_price', true);
                    $sku_num = get_post_meta($post->ID, '_sku', true);
                    if ($sale_price == '') {
                        $sale_price = get_post_meta($post->ID, '_min_variation_sale_price', true);
                    }
                    $currency = get_woocommerce_currency_symbol();
                    //print_r($woocommerce);
                    if ($counter_product % 3 == 0) {
                        ?>
					<div class="clear clearfix"></div>
						<!--PRODUCT LIST ITEM START-->
						<div id="product-<?php 
                        echo $post->ID;
                        ?>
" class="span4 first item">
							<div class="product-box">
								<div class="frame"> <a href="<?php 
                        echo get_permalink();
                        ?>
"><?php 
                        echo get_the_post_thumbnail($post_id, array(350, 350));
                        ?>
</a>
									<div class="caption">
										<form enctype="multipart/form-data" method="post" class="cart" action="<?php 
                        echo get_permalink();
                        echo $permalink_structure;
                        ?>
add-to-cart=<?php 
                        echo $post->ID;
                        ?>
">
											<button class="add_to_cart_button button product_type_simple added" data-quantity="1" data-product_sku="<?php 
                        echo $sku_num;
                        ?>
" data-product_id="<?php 
                        echo $post->ID;
                        ?>
" type="submit"><?php 
                        _e('Add to cart', 'crunchpress');
                        ?>
</button>
										</form>
										<div class="bottom-row woocommerce">
										<?php 
                        if (get_option('woocommerce_enable_review_rating') === 'no') {
                            return;
                        }
                        $count = $product->get_rating_count();
                        $average = $product->get_average_rating();
                        if ($count > 0) {
                            ?>

												<div class="woocommerce-product-rating" >
													<div class="star-rating" title="<?php 
                            printf(__('Rated %s out of 5', 'woocommerce'), $average);
                            ?>
">
														<span class="rating-star-cp" style="width:<?php 
                            echo $average / 5 * 100;
                            ?>
%">
															<!--<strong itemprop="ratingValue" class="rating"><?php 
                            echo esc_html($average);
                            ?>
</strong> <?php 
                            _e('out of 5', 'woocommerce');
                            ?>
-->
														</span>
													</div>
													<!--<a href="#reviews" class="woocommerce-review-link" rel="nofollow">(<?php 
                            printf(_n('%s customer review', '%s customer reviews', $count, 'woocommerce'), '<span itemprop="ratingCount" class="count">' . $count . '</span>');
                            ?>
)</a>-->
												</div>

											<?php 
                        }
                        ?>
											<a href="<?php 
                        echo get_permalink();
                        ?>
" class="like"><i class="fa fa-file-text-o"></i></a>
										</div>
									</div>
								</div>
							  <div class="bottom"> <strong class="title"><a href="<?php 
                        echo get_permalink();
                        ?>
"><?php 
                        echo get_the_title();
                        ?>
</a></strong> <strong class="price"><?php 
                        echo $currency;
                        if ($sale_price != '') {
                            echo $sale_price;
                        } else {
                            echo $regular_price;
                        }
                        ?>
</strong> </div>
							</div>
						</div>
						<!--PRODUCT LIST ITEM END-->
					<?php 
                    } else {
                        ?>
						<!--PRODUCT LIST ITEM START-->
						<div id="product-<?php 
                        echo $post->ID;
                        ?>
" class="span4 item">
							<div class="product-box">
								<div class="frame"> <a href="<?php 
                        echo get_permalink();
                        ?>
"><?php 
                        echo get_the_post_thumbnail($post_id, array(350, 350));
                        ?>
</a>
									<div class="caption">
										<form enctype="multipart/form-data" method="post" class="cart" action="<?php 
                        echo get_permalink();
                        echo $permalink_structure;
                        ?>
add-to-cart=<?php 
                        echo $post->ID;
                        ?>
">
											<!--<div class="quantity buttons_added"><input type="button" class="minus" value="-">
											<input type="number" class="input-text qty text" title="Qty" value="1" name="quantity" step="1">
											<input type="button" class="plus" value="+"></div>-->
											<button class="add_to_cart_button button product_type_simple added" data-quantity="1" data-product_sku="<?php 
                        echo $sku_num;
                        ?>
" data-product_id="<?php 
                        echo $post->ID;
                        ?>
" type="submit"><?php 
                        _e('Add to cart', 'crunchpress');
                        ?>
</button>
										</form>
										<div class="bottom-row woocommerce">
										<?php 
                        if (get_option('woocommerce_enable_review_rating') === 'no') {
                            return;
                        }
                        $count = $product->get_rating_count();
                        $average = $product->get_average_rating();
                        if ($count > 0) {
                            ?>

												<div class="woocommerce-product-rating" >
													<div class="star-rating" title="<?php 
                            printf(__('Rated %s out of 5', 'woocommerce'), $average);
                            ?>
">
														<span class="rating-star-cp" style="width:<?php 
                            echo $average / 5 * 100;
                            ?>
%">
															<!--<strong itemprop="ratingValue" class="rating"><?php 
                            echo esc_html($average);
                            ?>
</strong> <?php 
                            _e('out of 5', 'woocommerce');
                            ?>
-->
														</span>
													</div>
													<!--<a href="#reviews" class="woocommerce-review-link" rel="nofollow">(<?php 
                            printf(_n('%s customer review', '%s customer reviews', $count, 'woocommerce'), '<span itemprop="ratingCount" class="count">' . $count . '</span>');
                            ?>
)</a>-->
												</div>

											<?php 
                        }
                        ?>
											<a href="<?php 
                        echo get_permalink();
                        ?>
" class="like"><i class="fa fa-file-text-o"></i></a>
										</div>
									</div>
								</div>
							  <div class="bottom"> <strong class="title"><a href="<?php 
                        echo get_permalink();
                        ?>
"><?php 
                        echo get_the_title();
                        ?>
</a></strong> <strong class="price"><?php 
                        echo $currency;
                        if ($sale_price != '') {
                            echo $sale_price;
                        } else {
                            echo $regular_price;
                        }
                        ?>
</strong> </div>
							</div>
						</div>
						<!--PRODUCT LIST ITEM END-->
					<?php 
                    }
                    $counter_product++;
                }
                //End While
                ?>
			</div>	
		</section>
		<?php 
            } else {
                if ($layout_select == 'Combine') {
                    wp_reset_query();
                    wp_reset_postdata();
                    //Default Query to Fetch All Posts
                    if ($category == '0') {
                        query_posts(array('post_type' => 'product', 'posts_per_page' => $num_fetch, 'paged' => $paged, 'orderby' => 'title', 'order' => 'ASC'));
                    } else {
                        query_posts(array('post_type' => 'product', 'posts_per_page' => $num_fetch, 'paged' => $paged, 'tax_query' => array(array('taxonomy' => 'product_cat', 'terms' => $category, 'field' => 'term_id')), 'orderby' => 'title', 'post_status' => 'publish', 'order' => 'ASC'));
                    }
                    ?>
			<?php 
                    if ($header != '') {
                        ?>
			<!--Cart Listing -->
			<figure class="page_title">
				<div class="span8 first">
					<h2><?php 
                        echo $header;
                        ?>
</h2>
				</div>
				<?php 
                        if (!empty($woocommerce)) {
                            echo $woocommerce->messages[0];
                        }
                        ?>
				<div class="span4 title_right">
				</div>
			</figure>
			<!--Cart Listing Ends-->
			<?php 
                    }
                    ?>
			<div class="tabs">
				<figure class="span12 first">
					<!--<span class="short-pages">Items per page: <a href="#">5</a>   /  <a href="#"> 10 </a>  /  <a href="#"> 20 </a>  / <a href="#">  50 </a></span>-->
					<section class="grid-list-nav">
							<ul class="g-l-nav nav nav-tabs">
								<!--<li class="item-num"><?php 
                    echo $num_fetch;
                    ?>
 <?php 
                    _e('item(s)', 'crunchpress');
                    ?>
</li>-->
								<li><a class="grid_switch"  href="#product_grid"><i class="fa fa-th-large"></i><?php 
                    _e('Grid', 'crunchpress');
                    ?>
 </a></li>
								<li><a class="grid_switch"  href="#product_ful"><i class="fa fa-list"></i> <?php 
                    _e('List', 'crunchpress');
                    ?>
</a></li>
							</ul>
						<!--<figure class="span6">
							<?php 
                    if ($header != '') {
                        ?>
<h2 class="headings"><?php 
                        echo $header;
                        ?>
</h2><?php 
                    }
                    ?>
						</figure>-->
					</section>
				</figure>

				<!--Grid View Start-->
				<section class="product_view" id="product_grid">  
					<div class="grid-list-view product_image_holder row-fluid grid-style">
						<?php 
                    //tab Script
                    wp_enqueue_script('jquery-ui-tabs');
                    wp_register_script('cp-tabs-script', CP_PATH_URL . '/frontend/js/tabs_script.js', false, '1.0', true);
                    wp_enqueue_script('cp-tabs-script');
                    $counter_product = 0;
                    while (have_posts()) {
                        the_post();
                        global $post, $post_id, $product, $product_url, $woocommerce;
                        $permalink_structure = get_option('permalink_structure');
                        if ($permalink_structure != '') {
                            $permalink_structure = '?';
                        } else {
                            $permalink_structure = '&';
                        }
                        $regular_price = get_post_meta($post->ID, '_regular_price', true);
                        if ($regular_price == '') {
                            $regular_price = get_post_meta($post->ID, '_max_variation_regular_price', true);
                        }
                        $sale_price = get_post_meta($post->ID, '_sale_price', true);
                        $sku_num = get_post_meta($post->ID, '_sku', true);
                        if ($sale_price == '') {
                            $sale_price = get_post_meta($post->ID, '_min_variation_sale_price', true);
                        }
                        $currency = get_woocommerce_currency_symbol();
                        if ($counter_product % 3 == 0) {
                            ?>
								
								<div class="clear clearfix"></div>
							<div id="product-<?php 
                            echo $post->ID;
                            ?>
" class="span4 first item">
								<div class="product-box">
									<div class="frame"> <a href="<?php 
                            echo get_permalink();
                            ?>
"><?php 
                            echo get_the_post_thumbnail($post_id, array(350, 350));
                            ?>
</a>
										<div class="caption">
											<form enctype="multipart/form-data" method="post" class="cart" action="<?php 
                            echo get_permalink();
                            echo $permalink_structure;
                            ?>
add-to-cart=<?php 
                            echo $post->ID;
                            ?>
">
												<!--<div class="quantity buttons_added"><input type="button" class="minus" value="-">
												<input type="number" class="input-text qty text" title="Qty" value="1" name="quantity" step="1">
												<input type="button" class="plus" value="+"></div>-->
												<button class="add_to_cart_button button product_type_simple added" data-quantity="1" data-product_sku="<?php 
                            echo $sku_num;
                            ?>
" data-product_id="<?php 
                            echo $post->ID;
                            ?>
" type="submit"><?php 
                            _e('Add to cart', 'crunchpress');
                            ?>
</button>
											</form>
											<div class="bottom-row woocommerce">
											<?php 
                            if (get_option('woocommerce_enable_review_rating') === 'no') {
                                return;
                            }
                            $count = $product->get_rating_count();
                            $average = $product->get_average_rating();
                            if ($count > 0) {
                                ?>

													<div class="woocommerce-product-rating" >
														<div class="star-rating" title="<?php 
                                printf(__('Rated %s out of 5', 'woocommerce'), $average);
                                ?>
">
															<span class="rating-star-cp" style="width:<?php 
                                echo $average / 5 * 100;
                                ?>
%">
																<!--<strong itemprop="ratingValue" class="rating"><?php 
                                echo esc_html($average);
                                ?>
</strong> <?php 
                                _e('out of 5', 'woocommerce');
                                ?>
-->
															</span>
														</div>
														<!--<a href="#reviews" class="woocommerce-review-link" rel="nofollow">(<?php 
                                printf(_n('%s customer review', '%s customer reviews', $count, 'woocommerce'), '<span itemprop="ratingCount" class="count">' . $count . '</span>');
                                ?>
)</a>-->
													</div>

												<?php 
                            }
                            ?>
												<a href="<?php 
                            echo get_permalink();
                            ?>
" class="like"><i class="fa fa-file-text-o"></i></a>
											</div>
										</div>
									</div>
								  <div class="bottom"> <strong class="title"><a href="<?php 
                            echo get_permalink();
                            ?>
"><?php 
                            echo get_the_title();
                            ?>
</a></strong> <strong class="price"><?php 
                            echo $currency;
                            if ($sale_price != '') {
                                echo $sale_price;
                            } else {
                                echo $regular_price;
                            }
                            ?>
</strong> </div>
								</div>
							</div>
							<?php 
                        } else {
                            ?>
							<div id="product-<?php 
                            echo $post->ID;
                            ?>
" class="span4 item">
								<div class="product-box">
									<div class="frame"> <a href="<?php 
                            echo get_permalink();
                            ?>
"><?php 
                            echo get_the_post_thumbnail($post_id, array(350, 350));
                            ?>
</a>
										<div class="caption">
											<form enctype="multipart/form-data" method="post" class="cart" action="<?php 
                            echo get_permalink();
                            echo $permalink_structure;
                            ?>
add-to-cart=<?php 
                            echo $post->ID;
                            ?>
">
												<!--<div class="quantity buttons_added"><input type="button" class="minus" value="-">
												<input type="number" class="input-text qty text" title="Qty" value="1" name="quantity" step="1">
												<input type="button" class="plus" value="+"></div>-->
												<button class="add_to_cart_button button product_type_simple added" data-quantity="1" data-product_sku="<?php 
                            echo $sku_num;
                            ?>
" data-product_id="<?php 
                            echo $post->ID;
                            ?>
" type="submit"><?php 
                            _e('Add to cart', 'crunchpress');
                            ?>
</button>
											</form>
											<div class="bottom-row woocommerce">
											<?php 
                            if (get_option('woocommerce_enable_review_rating') === 'no') {
                                return;
                            }
                            $count = $product->get_rating_count();
                            $average = $product->get_average_rating();
                            if ($count > 0) {
                                ?>

													<div class="woocommerce-product-rating" >
														<div class="star-rating" title="<?php 
                                printf(__('Rated %s out of 5', 'woocommerce'), $average);
                                ?>
">
															<span class="rating-star-cp" style="width:<?php 
                                echo $average / 5 * 100;
                                ?>
%">
																<!--<strong itemprop="ratingValue" class="rating"><?php 
                                echo esc_html($average);
                                ?>
</strong> <?php 
                                _e('out of 5', 'woocommerce');
                                ?>
-->
															</span>
														</div>
														<!--<a href="#reviews" class="woocommerce-review-link" rel="nofollow">(<?php 
                                printf(_n('%s customer review', '%s customer reviews', $count, 'woocommerce'), '<span itemprop="ratingCount" class="count">' . $count . '</span>');
                                ?>
)</a>-->
													</div>

												<?php 
                            }
                            ?>
												<a href="<?php 
                            echo get_permalink();
                            ?>
" class="like"><i class="fa fa-file-text-o"></i></a>
											</div>
										</div>
									</div>
								  <div class="bottom"> <strong class="title"><a href="<?php 
                            echo get_permalink();
                            ?>
"><?php 
                            echo get_the_title();
                            ?>
</a></strong> <strong class="price"><?php 
                            echo $currency;
                            if ($sale_price != '') {
                                echo $sale_price;
                            } else {
                                echo $regular_price;
                            }
                            ?>
</strong> </div>
								</div>
							</div>
							<?php 
                        }
                        $counter_product++;
                    }
                    //End While
                    ?>
					</div>	
				</section>
				<!--Product Listing Full -->
				<div class="product_view list-style" id="product_ful">
					<?php 
                    $counter_product = 0;
                    while (have_posts()) {
                        the_post();
                        global $post, $post_id, $product, $product_url, $woocommerce;
                        $regular_price = get_post_meta($post->ID, '_regular_price', true);
                        if ($regular_price == '') {
                            $regular_price = get_post_meta($post->ID, '_max_variation_regular_price', true);
                        }
                        $sale_price = get_post_meta($post->ID, '_sale_price', true);
                        if ($sale_price == '') {
                            $sale_price = get_post_meta($post->ID, '_min_variation_sale_price', true);
                        }
                        $currency = get_woocommerce_currency_symbol();
                        ?>
							<!--PRODUCT LIST ITEM START-->
							<div class="product_item_list">
								<figure>
									<a href="<?php 
                        echo get_permalink();
                        ?>
"><?php 
                        echo get_the_post_thumbnail($post_id, $item_size);
                        ?>
</a>
									<form enctype="multipart/form-data" method="post" class="cart" action="<?php 
                        echo get_permalink();
                        echo $permalink_structure;
                        ?>
add-to-cart=<?php 
                        echo $post->ID;
                        ?>
">
										<!--<div class="quantity buttons_added"><input type="button" class="minus" value="-">
										<input type="number" class="input-text qty text" title="Qty" value="1" name="quantity" step="1">
										<input type="button" class="plus" value="+"></div>-->
										<button class="add_to_cart_button button product_type_simple added" data-quantity="1" data-product_sku="<?php 
                        echo $sku_num;
                        ?>
" data-product_id="<?php 
                        echo $post->ID;
                        ?>
" type="submit"><?php 
                        _e('Add to cart', 'crunchpress');
                        ?>
</button>
									</form>
								</figure>
								<div class="text">
									<h3><a href="<?php 
                        echo get_permalink();
                        ?>
"><?php 
                        echo get_the_title();
                        ?>
</a></h3>
									<p><?php 
                        echo substr(strip_tags(get_the_content()), 0, $num_excerpt);
                        ?>
</p>
									<h4><?php 
                        echo __('Price:', 'crunchpress');
                        ?>
 <?php 
                        echo $currency;
                        if ($sale_price != '') {
                            echo $sale_price;
                        } else {
                            echo $regular_price;
                        }
                        ?>
</h4>
									<a href="<?php 
                        echo get_permalink();
                        ?>
" class="wishlist"><?php 
                        _e('Read More', 'crunchpress');
                        ?>
</a>
								</div>
							</div>
							<!--PRODUCT LIST ITEM END-->
							<div class="clear"></div>
					<?php 
                    }
                    ?>
				</div>
				<!--Product Listing Full Ends-->
			</div>
			<?php 
                } else {
                    wp_reset_query();
                    wp_reset_postdata();
                    if ($category == '0') {
                        query_posts(array('post_type' => 'product', 'posts_per_page' => $num_fetch, 'paged' => $paged, 'orderby' => 'title', 'order' => 'ASC'));
                    } else {
                        query_posts(array('post_type' => 'product', 'posts_per_page' => $num_fetch, 'paged' => $paged, 'tax_query' => array(array('taxonomy' => 'product_cat', 'terms' => $category, 'field' => 'term_id')), 'orderby' => 'title', 'post_status' => 'publish', 'order' => 'ASC'));
                    }
                    ?>
		<?php 
                    if ($header != '') {
                        ?>
		<figure class="page_title row-fluid">
			<div class="span12 first">
				<h2><?php 
                        echo $header;
                        ?>
</h2>
			</div>
		</figure>
		<?php 
                    }
                    ?>
		<div class="product_view list-style" id="product_ful">
				<?php 
                    $counter_product = 0;
                    while (have_posts()) {
                        the_post();
                        global $post, $post_id, $product, $product_url, $woocommerce;
                        $permalink_structure = get_option('permalink_structure');
                        if ($permalink_structure != '') {
                            $permalink_structure = '?';
                        } else {
                            $permalink_structure = '&';
                        }
                        $regular_price = get_post_meta($post->ID, '_regular_price', true);
                        if ($regular_price == '') {
                            $regular_price = get_post_meta($post->ID, '_max_variation_regular_price', true);
                        }
                        $sale_price = get_post_meta($post->ID, '_sale_price', true);
                        $sku_num = get_post_meta($post->ID, '_sku', true);
                        if ($sale_price == '') {
                            $sale_price = get_post_meta($post->ID, '_min_variation_sale_price', true);
                        }
                        $currency = get_woocommerce_currency_symbol();
                        ?>
					<!--PRODUCT LIST ITEM START-->
					<div class="woo-item">
						<figure>
							<a href="<?php 
                        echo get_permalink();
                        ?>
"><?php 
                        echo get_the_post_thumbnail($post_id, array(1170, 350));
                        ?>
</a>
							<form enctype="multipart/form-data" method="post" class="cart" action="<?php 
                        echo get_permalink();
                        echo $permalink_structure;
                        ?>
add-to-cart=<?php 
                        echo $post->ID;
                        ?>
">
								<!--<div class="quantity buttons_added"><input type="button" class="minus" value="-">
								<input type="number" class="input-text qty text" title="Qty" value="1" name="quantity" step="1">
								<input type="button" class="plus" value="+"></div>-->
								<button class="add_to_cart_button button product_type_simple added" data-quantity="1" data-product_sku="<?php 
                        echo $sku_num;
                        ?>
" data-product_id="<?php 
                        echo $post->ID;
                        ?>
" type="submit"><?php 
                        _e('Add to cart', 'crunchpress');
                        ?>
</button>
							</form>
							
						</figure>
						<div class="text">
							<h3><a href="<?php 
                        echo get_permalink();
                        ?>
"><?php 
                        echo get_the_title();
                        ?>
</a></h3>
							<p><?php 
                        echo substr(strip_tags(get_the_content()), 0, $num_excerpt);
                        ?>
</p>
							<h4><?php 
                        echo __('Price:', 'crunchpress');
                        ?>
 <?php 
                        echo $currency;
                        if ($sale_price != '') {
                            echo $sale_price;
                        } else {
                            echo $regular_price;
                        }
                        ?>
</h4>
							<a href="<?php 
                        echo get_permalink();
                        ?>
" class="wishlist"><?php 
                        _e('Read More', 'crunchpress');
                        ?>
</a>
						</div>
					</div>
					<!--PRODUCT LIST ITEM END-->
					<div class="clear"></div>
				<?php 
                    }
                    //End While
                    ?>
			
		</div>
		<?php 
                }
            }
        }
        ?>
		<div class="clear"></div>
		<?php 
        if (find_xml_value($item_xml, "pagination") == "Theme-Custom") {
            pagination();
        }
    }
}
コード例 #19
0
ファイル: cp_events.php プロジェクト: pcco/portal-redesign
 public function print_event_thumbnail($post_id, $item_size)
 {
     global $counter;
     //Get Post Meta Options
     $img_html = '';
     $event_thumbnail = '';
     $video_url_type = '';
     $select_slider_type = '';
     $event_detail_xml = get_post_meta($post_id, 'event_detail_xml', true);
     if ($event_detail_xml != '') {
         $cp_event_xml = new DOMDocument();
         $cp_event_xml->loadXML($event_detail_xml);
         $event_thumbnail = find_xml_value($cp_event_xml->documentElement, 'event_thumbnail');
         $video_url_type = find_xml_value($cp_event_xml->documentElement, 'video_url_type');
         $select_slider_type = find_xml_value($cp_event_xml->documentElement, 'select_slider_type');
         //Print Image
         if ($event_thumbnail == "Image" || empty($event_thumbnail)) {
             if (get_the_post_thumbnail($post_id, $item_size) != '') {
                 $img_html = '<div class="post_featured_image thumbnail_image">';
                 $img_html = $img_html . get_the_post_thumbnail($post_id, $item_size);
                 $img_html = $img_html . '</div>';
             }
             //echo '<div class="mask"><a href="'.get_permalink().'"#comments" class="anchor"><span> </span> <i class="fa fa-comment"></i></a><a href="'. get_permalink().'" class="anchor"> <i class="fa fa-link"></i></a></div>';
         } else {
             if ($event_thumbnail == "Video") {
                 //Print Video
                 if ($video_url_type != '') {
                     $img_html = '<div class="post_featured_image thumbnail_image">';
                     $img_html = $img_html . '<div class="blog-thumbnail-video">';
                     //echo cp_get_width($item_size);
                     if (cp_get_width($item_size) == '175') {
                         $img_html = $img_html . get_video($video_url_type, cp_get_width($item_size), cp_get_height($item_size));
                     } else {
                         $img_html = $img_html . get_video($video_url_type, '100%', cp_get_height($item_size));
                     }
                     $img_html = $img_html . '</div></div>';
                 }
             } else {
                 if ($event_thumbnail == "Slider") {
                     //Print Slider
                     $slider_xml = get_post_meta(intval($select_slider_type), 'cp-slider-xml', true);
                     if ($slider_xml != '') {
                         $slider_xml_dom = new DOMDocument();
                         $slider_xml_dom->loadXML($slider_xml);
                         $slider_name = 'bxslider' . $counter . $post_id;
                         //Included Anything Slider Script/Style
                         wp_register_script('cp-bx-slider', CP_PATH_URL . '/frontend/js/bxslider.min.js', false, '1.0', true);
                         wp_enqueue_script('cp-bx-slider');
                         wp_enqueue_style('cp-bx-slider', CP_PATH_URL . '/frontend/css/bxslider.css');
                         if (cp_get_width($item_size) == '175') {
                             $img_html = "<style>#'" . $slider_name . "'{width:'" . cp_get_width($item_size) . "'px;height:'" . cp_get_height($item_size) . "'px;float:left;}</style>";
                         } else {
                             $img_html = "<style>#'" . $slider_name . "'{width:100%;height:350px;float:left;}</style>";
                         }
                         $img_html = '<div class="post_featured_image thumbnail_image">';
                         $img_html = $img_html . print_bx_slider($slider_xml_dom->documentElement, $item_size, $slider_name);
                         $img_html = $img_html . '</div>';
                     }
                 }
             }
         }
     }
     return $img_html;
 }
コード例 #20
0
ファイル: cp_slider.php プロジェクト: pcco/portal-redesign
        public function print_slider_picker($args)
        {
            extract($args);
            global $post;
            ?>
			
					<div class="meta-body image-picker-wrapper">
					<div class="meta-input-slider">
						<div class="image-picker" id="image-picker">
							<input type='hidden' class="slider-num" id="slider-num" name='<?php 
            echo isset($name['slider-num']) ? $name['slider-num'] . '[]' : '';
            ?>
' value=<?php 
            echo empty($value) ? 0 : $value->childNodes->length;
            ?>
 />
							<div class="selected-image" id="selected-image">
								<div id="selected-image-none"><?php 
            _e('No Image Inserted', 'crunchpress');
            ?>
</div>
								<ul>
									<li id="default" class="default">
										<div class="selected-image-wrapper">
											<img src="#"/>
											<div class="selected-image-element">
												<div id="edit-image" class="edit-image"></div>
												<div id="unpick-image" class="unpick-image"></div>
												<br class="clear">
											</div>
										</div>
										<input type="hidden" class='slider-image-url' id='<?php 
            echo $name['image'];
            ?>
' />
										
										<div id="slider-detail-wrapper" class="slider-detail-wrapper">									
										<div id="slider-detail" class="slider-detail"> 	
										<div class="meta-title meta-detail-title"><?php 
            _e('SLIDER TITLE', 'crunchpress');
            ?>
</div> 
											<div class="meta-detail-input meta-input"><input type="text" id='<?php 
            echo $name['title'];
            ?>
' /></div><br class="clear">
											<hr class="separator">
											<div class="meta-title meta-detail-title"><?php 
            _e('SLIDER CAPTION', 'crunchpress');
            ?>
</div>
											<div class="meta-detail-input meta-input"><textarea id='<?php 
            echo $name['caption'];
            ?>
' ></textarea></div><br class="clear">
											<hr class="separator">
											<div class="meta-title meta-detail-title"><?php 
            _e('LINK TYPE', 'crunchpress');
            ?>
</div> 
											<div class="meta-input meta-detail-input">
												<div class="combobox">
													<select id='<?php 
            echo $name['linktype'];
            ?>
'>
														<option><?php 
            _e('No Link', 'crunchpress');
            ?>
</option>
														<option><?php 
            _e('Link to URL', 'crunchpress');
            ?>
</option>	
													</select>
												</div>
											</div><br class="clear">
											<div class="url">
												<div class="meta-title meta-detail-title" rel="url"><?php 
            _e('URL PATH', 'crunchpress');
            ?>
</div> 
												<div class="meta-detail-input meta-input"><input class="mt10" type="text"  id='<?php 
            echo $name['link'];
            ?>
' /></div>
											</div>
											<hr class="separator">
											<!--<div class="meta-title meta-detail-title"><?php 
            //_e('SLIDER BUTTON TEXT', 'crunchpress');
            ?>
</div> 
											<div class="meta-detail-input meta-input"><input type="text" id='<?php 
            //echo $name['btn_txt'];
            ?>
' /></div><br class="clear">-->
											<hr class="separator">
											<br class="clear">
											<div class="meta-detail-done-wrapper">
												<input type="button" id="cp-detail-edit-done" class="cp-button" value="Done" /><br class="clear">
											</div>
												<input type="hidden" id="cp-detail-edit-done" class="cp-button" name="submit_button" value="submit_button" /><br class="clear">
										</div>
										</div>
									</li>
									
									<?php 
            if (!empty($value)) {
                foreach ($value->childNodes as $slider) {
                    ?>
 
											
												<li class="slider-image-init">
													<div class="selected-image-wrapper">
														<img src="<?php 
                    $thumb_src_preview = wp_get_attachment_image_src(function_library::find_xml_value($slider, 'image'), '160x110');
                    echo $thumb_src_preview[0];
                    ?>
"/>
														<div class="selected-image-element">
															<div id="edit-image" class="edit-image"></div>
															<div id="unpick-image" class="unpick-image"></div>
															<br class="clear">
														</div>
													</div>
													<input type="hidden" class='slider-image-url' name='<?php 
                    echo $name['image'];
                    ?>
[]' id='<?php 
                    echo $name['image'];
                    ?>
[]' value="<?php 
                    echo find_xml_value($slider, 'image');
                    ?>
" /> 
													<div id="slider-detail-wrapper" class="slider-detail-wrapper">
													<div id="slider-detail" class="slider-detail">
														<div class="meta-title meta-detail-title"><?php 
                    _e('SLIDER TITLE', 'crunchpress');
                    ?>
</div> 
														<div class="meta-detail-input meta-input"><input type="text" name='<?php 
                    echo $name['title'];
                    ?>
[]' id='<?php 
                    echo $name['title'];
                    ?>
[]' value="<?php 
                    echo find_xml_value($slider, 'title');
                    ?>
" /></div><br class="clear">
														<hr class="separator">
														<div class="meta-title meta-detail-title"><?php 
                    _e('SLIDER CAPTION', 'crunchpress');
                    ?>
</div>
														<div class="meta-detail-input meta-input"><textarea name='<?php 
                    echo $name['caption'];
                    ?>
[]' id='<?php 
                    echo $name['caption'];
                    ?>
[]' ><?php 
                    echo find_xml_value($slider, 'caption');
                    ?>
</textarea></div><br class="clear">
														<hr class="separator">												
														<div class="meta-title meta-detail-title"><?php 
                    _e('LINK TYPE', 'crunchpress');
                    ?>
</div>
														<div class="meta-input meta-detail-input">
															<div class="combobox">
																<?php 
                    $linktype_val = function_library::find_xml_value($slider, 'linktype');
                    ?>
																<select name='<?php 
                    echo $name['linktype'];
                    ?>
[]' id='<?php 
                    echo $name['linktype'];
                    ?>
' >
																	<option <?php 
                    echo $linktype_val == 'No Link' ? "selected" : '';
                    ?>
 ><?php 
                    _e('No Link', 'crunchpress');
                    ?>
</option>
																	<option <?php 
                    echo $linktype_val == 'Link to URL' ? "selected" : '';
                    ?>
><?php 
                    _e('Link to URL', 'crunchpress');
                    ?>
</option>
																</select>
															</div>
														</div><br class="clear">
														<div class="url">
															<div class="meta-title meta-detail-title" rel="url"><?php 
                    _e('URL PATH', 'crunchpress');
                    ?>
</div> 
															<div class="meta-detail-input meta-input"><input class="mt10" type="text" name='<?php 
                    echo $name['link'];
                    ?>
[]' id='<?php 
                    echo $name['link'];
                    ?>
[]' value="<?php 
                    echo esc_url(find_xml_value($slider, 'link'));
                    ?>
" /></div>
														</div>
														<div class="clear"></div>
														<!--<div class="meta-title meta-detail-title"><?php 
                    _e('BUTTON TEXT', 'crunchpress');
                    ?>
</div> 
														<div class="meta-detail-input meta-input"><input class="" type="text" name='<?php 
                    //echo $name['btn_txt'];
                    ?>
[]' id='<?php 
                    //echo $name['btn_txt'];
                    ?>
[]' value="<?php 
                    //echo find_xml_value($slider, 'btn_txt');
                    ?>
" /></div>-->
														<input type="hidden" value="slider_images" name="slider_images">
														<br class="clear">
														<div class="meta-detail-done-wrapper">
															<input type="button" id="cp-detail-edit-done" class="cp-button" value="Done" /><br class="clear">
														</div>
													</div>
													</div>
													</li> 
													
												<?php 
                }
            }
            ?>
	
									
								</ul>
								<br class=clear>
								<div id="show-media" class="show-media">							
									<span id="show-media-text"></span>
									
									<div id="show-media-image"></div>
								</div>
							</div>
							<div class="media-image-gallery-wrapper">
							<input class="upload_image_button white_color" type="button" value="Upload" />
								<div class="media-image-gallery" id="media-image-gallery">
									<?php 
            function_library::get_media_image();
            ?>
								</div>
							</div>
						</div>
					</div>
					<br class=clear>
				</div>
				
			<?php 
        }
コード例 #21
0
ファイル: misc.php プロジェクト: shimion/preview1
function print_anything_slider($slider_xml, $size = '940x360')
{
    if (empty($slider_xml)) {
        return;
    }
    global $gdl_element_id;
    echo '<ul id="slider" class="anythingSlider gdl-slider" style="width:' . gdl_get_width($size) . 'px; height:' . gdl_get_height($size) . 'px;">';
    foreach ($slider_xml->childNodes as $slider) {
        $title = find_xml_value($slider, 'title');
        $caption = html_entity_decode(find_xml_value($slider, 'caption'));
        $link = find_xml_value($slider, 'link');
        $link_type = find_xml_value($slider, 'linktype');
        $image_url = wp_get_attachment_image_src(find_xml_value($slider, 'image'), $size);
        $alt_text = get_post_meta(find_xml_value($slider, 'image'), '_wp_attachment_image_alt', true);
        echo '<li>';
        if ($link_type == 'Link to Video') {
            echo get_video($link, gdl_get_width($size), gdl_get_height($size));
        } else {
            if ($link_type == 'Lightbox') {
                $image_full_url = wp_get_attachment_image_src(find_xml_value($slider, 'image'), 'full');
                echo '<a data-rel="fancybox" data-fancybox-group="gal' . $gdl_element_id . '" href="' . $image_full_url[0] . '"  title="' . $alt_text . '">';
            } else {
                if ($link_type != 'No Link') {
                    echo '<a href="' . $link . '" alt="" >';
                }
            }
            echo '<img src="' . $image_url[0] . '" alt="' . $alt_text . '" />';
            if (!empty($title) || !empty($caption)) {
                echo '<div class="anything-caption">';
                if (!empty($title)) {
                    echo '<h2 class="gdl-slider-title">' . $title . '</h2>';
                    echo "<div class='clear'></div>";
                }
                if (!empty($caption)) {
                    echo '<div class="gdl-slider-caption"><div class="gdl-slider-inner-caption">' . $caption . '</div></div>';
                    echo "<div class='clear'></div>";
                }
                echo '</div>';
            }
            if ($link_type != 'No Link') {
                echo '</a>';
            }
        }
        echo '</li>';
    }
    echo "</ul>";
    $gdl_element_id++;
}
コード例 #22
0
function print_post_slider_item($item_xml)
{
    $num_fetch = find_xml_value($item_xml, 'num-fetch');
    $num_excerpt = find_xml_value($item_xml, 'num-excerpt');
    $show_caption = find_xml_value($item_xml, 'show-caption');
    $category = find_xml_value($item_xml, 'category', false);
    $category = $category == 'All' ? '' : $category;
    if (!empty($category)) {
        $category_term = get_term_by('name', $category, 'category');
        $category = $category_term->slug;
    }
    $postslider_xml = "<single-item><Post-Slider>";
    $postslider_xml = $postslider_xml . create_xml_tag('size', find_xml_value($item_xml, 'size'));
    $postslider_xml = $postslider_xml . create_xml_tag('width', find_xml_value($item_xml, 'width'));
    $postslider_xml = $postslider_xml . create_xml_tag('height', find_xml_value($item_xml, 'height'));
    $postslider_xml = $postslider_xml . create_xml_tag('slider-type', find_xml_value($item_xml, 'slider-type'));
    $postslider_xml = $postslider_xml . "<slider-item>";
    query_posts(array('post_type' => 'post', 'category_name' => $category, 'posts_per_page' => $num_fetch));
    while (have_posts()) {
        the_post();
        $postslider_xml = $postslider_xml . "<slider>";
        $postslider_xml = $postslider_xml . create_xml_tag('image', get_post_thumbnail_id(get_the_ID()));
        $postslider_xml = $postslider_xml . create_xml_tag('linktype', 'Link to URL');
        $postslider_xml = $postslider_xml . create_xml_tag('link', htmlspecialchars(get_permalink()));
        if ($show_caption == "Yes") {
            $postslider_xml = $postslider_xml . create_xml_tag('title', htmlspecialchars(get_the_title()));
            $postslider_xml = $postslider_xml . create_xml_tag('caption', htmlspecialchars(substr(get_the_excerpt(), 0, $num_excerpt)));
        }
        $postslider_xml = $postslider_xml . "</slider>";
    }
    $postslider_xml = $postslider_xml . "</slider-item>";
    $postslider_xml = $postslider_xml . "</Post-Slider></single-item>";
    $slider_xml_val = new DOMDocument();
    $slider_xml_val->loadXML($postslider_xml);
    foreach ($slider_xml_val->documentElement->childNodes as $slider_item_xml) {
        print_slider_item($slider_item_xml);
    }
    wp_reset_query();
}
コード例 #23
0
ファイル: supersized.php プロジェクト: uglmee/kikiku.com
        $bg_slider_xml = get_post_meta($slider_page->ID, 'page-option-top-slider-xml', true);
    } else {
        $bg_fetch_page = get_post_meta($post->ID, 'page-option-top-slider-types', true);
        if ($bg_fetch_page == 'Current Page') {
            $bg_slider_xml = get_post_meta($post->ID, 'page-option-top-slider-xml', true);
        } else {
            $slider_page = get_page_by_title($bg_fetch_page, null, 'page');
            $bg_slider_xml = get_post_meta($slider_page->ID, 'page-option-top-slider-xml', true);
        }
    }
}
$slider_index = false;
if (!empty($bg_slider_xml)) {
    $slider_xml_dom = new DOMDocument();
    $slider_xml_dom->loadXML($bg_slider_xml);
    foreach ($slider_xml_dom->documentElement->childNodes as $slider_item) {
        $thumbnail_id = find_xml_value($slider_item, 'image');
        $thumbnail = wp_get_attachment_image_src($thumbnail_id, 'full');
        if ($slider_index) {
            echo ",";
        } else {
            $slider_index = true;
        }
        echo '{ image: \'' . $thumbnail[0] . '\', title: \'' . find_xml_value($slider_item, 'title') . '\' , caption: \'' . find_xml_value($slider_item, 'caption') . '\' }';
    }
}
?>
									]	

	});
});
コード例 #24
0
function homepage_settings()
{
    foreach ($_REQUEST as $keys => $values) {
        ${$keys} = trim($values);
    }
    $return_data = array('success' => '-1', 'alert' => 'Save option failed, please try contacting your host provider to increase the post_max_size and suhosin.post.max_vars varialble on the server.');
    ?>
			<?php 
    if (isset($action) and $action == 'homepage_settings') {
        $homepage_xml = '<homepage_settings>';
        $homepage_xml = $homepage_xml . create_xml_tag('homepage_newsline_on', $homepage_newsline_on);
        $homepage_xml = $homepage_xml . create_xml_tag('header_headline', htmlspecialchars(stripslashes($header_headline)));
        $homepage_xml = $homepage_xml . create_xml_tag('section_headline_category', $section_headline_category);
        $homepage_xml = $homepage_xml . create_xml_tag('homepage_twitter_on', $homepage_twitter_on);
        $homepage_xml = $homepage_xml . create_xml_tag('header_twitter', htmlspecialchars(stripslashes($header_twitter)));
        $homepage_xml = $homepage_xml . create_xml_tag('consumer_key', $consumer_key);
        $homepage_xml = $homepage_xml . create_xml_tag('consumer_secret', $consumer_secret);
        $homepage_xml = $homepage_xml . create_xml_tag('user_token', $user_token);
        $homepage_xml = $homepage_xml . create_xml_tag('user_secret', $user_secret);
        $homepage_xml = $homepage_xml . create_xml_tag('twitter_id', htmlspecialchars(stripslashes($twitter_id)));
        $homepage_xml = $homepage_xml . create_xml_tag('homepage_layout_on', $homepage_layout_on);
        // $homepage_xml = $homepage_xml . create_xml_tag('section_select_background',$section_select_background);
        // $homepage_xml = $homepage_xml . create_xml_tag('section_scheme',$section_scheme);
        // $homepage_xml = $homepage_xml . create_xml_tag('section_patren',$section_patren);
        // $homepage_xml = $homepage_xml . create_xml_tag('section_body_patren',$section_body_patren);
        $homepage_xml = $homepage_xml . create_xml_tag('footer_sec_title', htmlspecialchars(stripslashes($footer_sec_title)));
        $homepage_xml = $homepage_xml . create_xml_tag('home_page_layout', $home_page_layout);
        $homepage_xml = $homepage_xml . '</homepage_settings>';
        if (!save_option('homepage_settings', get_option('homepage_settings'), $homepage_xml)) {
            die(json_encode($return_data));
        }
        die(json_encode(array('success' => '0')));
    }
    $homepage_newsline_on = '';
    $header_headline = '';
    $section_headline_category = '';
    $homepage_twitter_on = '';
    $header_twitter = '';
    $consumer_key = '';
    $consumer_secret = '';
    $user_token = '';
    $user_secret = '';
    $twitter_id = '';
    $homepage_on = '';
    $homepage_layout_on = '';
    // $section_select_background = '';
    // $section_scheme = '';
    // $section_patren = '';
    // $section_body_patren = '';
    $footer_sec_title = '';
    $home_page_layout = '';
    $cp_typography_settings = get_option('homepage_settings');
    if ($cp_typography_settings != '') {
        $cp_typo = new DOMDocument();
        $cp_typo->loadXML($cp_typography_settings);
        $homepage_newsline_on = find_xml_value($cp_typo->documentElement, 'homepage_newsline_on');
        $header_headline = find_xml_value($cp_typo->documentElement, 'header_headline');
        $section_headline_category = find_xml_value($cp_typo->documentElement, 'section_headline_category');
        $homepage_twitter_on = find_xml_value($cp_typo->documentElement, 'homepage_twitter_on');
        $header_twitter = find_xml_value($cp_typo->documentElement, 'header_twitter');
        $consumer_key = find_xml_value($cp_typo->documentElement, 'consumer_key');
        $consumer_secret = find_xml_value($cp_typo->documentElement, 'consumer_secret');
        $user_token = find_xml_value($cp_typo->documentElement, 'user_token');
        $user_secret = find_xml_value($cp_typo->documentElement, 'user_secret');
        $twitter_id = find_xml_value($cp_typo->documentElement, 'twitter_id');
        $homepage_layout_on = find_xml_value($cp_typo->documentElement, 'homepage_layout_on');
        // $section_select_background = find_xml_value($cp_typo->documentElement,'section_select_background');
        // $section_scheme = find_xml_value($cp_typo->documentElement,'section_scheme');
        // $section_patren = find_xml_value($cp_typo->documentElement,'section_patren');
        // $section_body_patren = find_xml_value($cp_typo->documentElement,'section_body_patren');
        $footer_sec_title = find_xml_value($cp_typo->documentElement, 'footer_sec_title');
        $home_page_layout = find_xml_value($cp_typo->documentElement, 'home_page_layout');
    }
    ?>
	
<div id="wrapper_backend cp-margin-left">
	<div id="header_theme_options">	<span id="backend_logo"> <h1> <a href="#"><h3> <?php 
    _e('CrunchPress Framework', 'crunchpress');
    ?>
 </h3>
  </a> </h1> </span>
	</div>
	<div class="wrapper_1">
		<?php 
    echo top_navigation_html();
    ?>
		
	</div>
	<div class="below_wrapper tabs">
		<div class="wrapper_left">
			<ul id="wp_t_o_right_menu">
				<li class="home_layout" id="active_tab"><?php 
    _e('Home Page Layout', 'crunchpress');
    ?>
</li>
   				<li class="footer_area"><?php 
    _e('Footer Layout', 'crunchpress');
    ?>
</li>
			</ul>
		</div>
		<div class="wrapper_right">
			<form id="options-panel-form" name="cp-panel-form">
				<div class="panel-elements" id="panel-elements">
					<div class="panel-element" id="panel-element-save-complete">
						<div class="panel-element-save-text"><?php 
    _e('Save Options Complete', 'crunchpress');
    ?>
.</div>
						<div class="panel-element-save-arrow"></div>
					</div>
					<ul>
						<li id="home_layout" class="active_tab">
							<h3><h3> <?php 
    _e('Home Page Layout Settings', 'crunchpress');
    ?>
 </h3></h3>

							<ul class="panel-body recipe_class">
								<li class="panel-title">
									<label for="" > <?php 
    _e('News Headline', 'crunchpress');
    ?>
 </label>
								</li>	
								<li class="panel-input">
									<label for="homepage_newsline_on"><div class="checkbox-switch <?php 
    echo $homepage_newsline_on == 'enable' || $homepage_newsline_on == '' && empty($default) ? 'checkbox-switch-on' : 'checkbox-switch-off';
    ?>
"></div></label>
								<input type="checkbox" name="homepage_newsline_on" class="checkbox-switch" value="disable" checked>
								<input type="checkbox" name="homepage_newsline_on" id="homepage_newsline_on" class="checkbox-switch" value="enable" <?php 
    echo $homepage_newsline_on == 'enable' || $homepage_newsline_on == '' && empty($default) ? 'checked' : '';
    ?>
>
								</li>
								<li class="description"><h3> <?php 
    _e('You can turn On/Off Home Page Widgets from Top of the page.', 'crunchpress');
    ?>
 </h3>
</li>
							</ul>
                            <div class="clear"></div>
                            <ul class="panel-body recipe_class">
                                <li class="panel-title">
                                    <label for="header_headline" > <?php 
    _e('News Headline Title', 'crunchpress');
    ?>
 </label>
                                </li>	
                                <li class="panel-input">
                                    <input type="text" name="header_headline" id="header_headline" value="<?php 
    echo $header_headline == '' ? esc_html($header_headline) : esc_html($header_headline);
    ?>
" />
                                </li>
                                <li class="description"><h3> <?php 
    _e('Please enter your news headline title here.', 'crunchpress');
    ?>
 </h3>
</li>
                            </ul>
							<div class="clear"></div>
							<ul class="panel-body recipe_class">
								<li class="panel-title">
									<label for="section_headline_category"><?php 
    _e('News Headline Category', 'crunchpress');
    ?>
</label>
								</li>
								<li class="panel-input">	
									<div class="combobox">
										<select name="section_headline_category" class="section_headline_category" id="section_headline_category">
											<option value="nocategory" class=""><h3> <?php 
    _e('---No Category---', 'crunchpress');
    ?>
 </h3>
</option>
										<?php 
    foreach (get_category_list_array('category') as $category) {
        ?>
											 <option <?php 
        if (esc_attr($section_headline_category) == $category->slug) {
            echo 'selected';
        }
        ?>
 value="<?php 
        echo $category->slug;
        ?>
" >
												<?php 
        echo substr($category->name, 0, 20);
        if (strlen($category->name) > 20) {
            echo "...";
        }
        ?>
											</option>		
										<?php 
    }
    ?>
										</select>
									</div>
								</li>
								<li class="description"><h3> <?php 
    _e('Please select headline category.', 'crunchpress');
    ?>
 </h3>
</li>
							</ul>
   							<div class="clear"></div>
							<ul class="panel-body recipe_class">
								<li class="panel-title">
									<label for="" > <?php 
    _e('Twitter Feeds', 'crunchpress');
    ?>
 </label>
								</li>	
								<li class="panel-input">
									<label for="homepage_twitter_on"><div class="checkbox-switch <?php 
    echo $homepage_twitter_on == 'enable' || $homepage_twitter_on == '' && empty($default) ? 'checkbox-switch-on' : 'checkbox-switch-off';
    ?>
"></div></label>
								<input type="checkbox" name="homepage_twitter_on" class="checkbox-switch" value="disable" checked>
								<input type="checkbox" name="homepage_twitter_on" id="homepage_twitter_on" class="checkbox-switch" value="enable" <?php 
    echo $homepage_twitter_on == 'enable' || $homepage_twitter_on == '' && empty($default) ? 'checked' : '';
    ?>
>
								</li>
								<li class="description"><h3> <?php 
    _e('You can turn On/Off Home Page Widgets from Top of the page.', 'crunchpress');
    ?>
 </h3>
</li>
							</ul>
                            <div class="clear"></div>
                            <ul class="panel-body recipe_class">
                                <li class="panel-title">
                                    <label for="header_twitter" > <?php 
    _e('Twitter Title', 'crunchpress');
    ?>
 </label>
                                </li>	
                                <li class="panel-input">
                                    <input type="text" name="header_twitter" id="header_twitter" value="<?php 
    echo $header_twitter == '' ? esc_html($header_twitter) : esc_html($header_twitter);
    ?>
" />
                                </li>
                                <li class="description"><h3> <?php 
    _e('Please enter your news headline title here.', 'crunchpress');
    ?>
 </h3>
</li>
                            </ul>
							<div class="clear"></div>
							<ul class="panel-body recipe_class">
                                <li class="panel-title">
                                    <label for="consumer_key" > <?php 
    _e('Consumer Key', 'crunchpress');
    ?>
 </label>
                                </li>	
                                <li class="panel-input">
                                    <input type="text" name="consumer_key" id="consumer_key" value="<?php 
    echo $consumer_key == '' ? esc_html($consumer_key) : esc_html($consumer_key);
    ?>
" />
                                </li>
                                <li class="description"><h3> <?php 
    _e('Please enter your Consumer Key Here.', 'crunchpress');
    ?>
 </h3>
</li>
                            </ul>
							<ul class="panel-body recipe_class">
                                <li class="panel-title">
                                    <label for="consumer_secret" > <?php 
    _e('Consumer Secret Key', 'crunchpress');
    ?>
 </label>
                                </li>	
                                <li class="panel-input">
                                    <input type="text" name="consumer_secret" id="consumer_secret" value="<?php 
    echo $consumer_secret == '' ? esc_html($consumer_secret) : esc_html($consumer_secret);
    ?>
" />
                                </li>
                                <li class="description"><h3> <?php 
    _e('Please enter your Consumer Secret Key here here.', 'crunchpress');
    ?>
 </h3>
</li>
                            </ul>
							<ul class="panel-body recipe_class">
                                <li class="panel-title">
                                    <label for="user_token" > <?php 
    _e('User Token', 'crunchpress');
    ?>
 </label>
                                </li>	
                                <li class="panel-input">
                                    <input type="text" name="user_token" id="user_token" value="<?php 
    echo $user_token == '' ? esc_html($user_token) : esc_html($user_token);
    ?>
" />
                                </li>
                                <li class="description"><h3> <?php 
    _e('Please enter your User Token here.', 'crunchpress');
    ?>
 </h3>
</li>
                            </ul>
							<ul class="panel-body recipe_class">
                                <li class="panel-title">
                                    <label for="user_secret" > <?php 
    _e('User Secret Token', 'crunchpress');
    ?>
 </label>
                                </li>	
                                <li class="panel-input">
                                    <input type="text" name="user_secret" id="user_secret" value="<?php 
    echo $user_secret == '' ? esc_html($user_secret) : esc_html($user_secret);
    ?>
" />
                                </li>
                                <li class="description"><h3> <?php 
    _e('Please enter your User Secret Token title here.', 'crunchpress');
    ?>
 </h3>
</li>
                            </ul>
                            <ul class="panel-body recipe_class">
                                <li class="panel-title">
                                    <label for="twitter_id" > <?php 
    _e('Twitter ID', 'crunchpress');
    ?>
 </label>
                                </li>	
                                <li class="panel-input">
                                    <input type="text" name="twitter_id" id="twitter_id" value="<?php 
    echo $twitter_id == '' ? esc_html($twitter_id) : esc_html($twitter_id);
    ?>
" />
                                </li>
                                <li class="description"><h3> <?php 
    _e('Please enter your news headline title here.', 'crunchpress');
    ?>
 </h3>
</li>
                            </ul>
							<div class="clear"></div>
                            </li>	
                            <li id="footer_area">
							<ul class="panel-body recipe_class">
								<li class="panel-title">
									<label for="" > <?php 
    _e('Footer Widgets', 'crunchpress');
    ?>
 </label>
								</li>	
								<li class="panel-input">
									<label for="homepage_layout_on"><div class="checkbox-switch <?php 
    echo $homepage_layout_on == 'enable' || $homepage_layout_on == '' && empty($default) ? 'checkbox-switch-on' : 'checkbox-switch-off';
    ?>
"></div></label>
								<input type="checkbox" name="homepage_layout_on" class="checkbox-switch" value="disable" checked>
								<input type="checkbox" name="homepage_layout_on" id="homepage_layout_on" class="checkbox-switch" value="enable" <?php 
    echo $homepage_layout_on == 'enable' || $homepage_layout_on == '' && empty($default) ? 'checked' : '';
    ?>
>
								</li>
								<li class="description"><h3> <?php 
    _e('You can turn On/Off Home Page Widgets from Top of the page.', 'crunchpress');
    ?>
 </h3>
</li>
							</ul>
							<div class="clear"></div>
                            <ul class="panel-body recipe_class">
                                <li class="panel-title">
                                    <label for="footer_sec_title" > <?php 
    _e('Footer Section Title', 'crunchpress');
    ?>
 </label>
                                </li>	
                                <li class="panel-input">
                                    <input type="text" name="footer_sec_title" id="footer_sec_title" value="<?php 
    echo $footer_sec_title == '' ? esc_html($footer_sec_title) : esc_html($footer_sec_title);
    ?>
" />
                                </li>
                                <li class="description"><h3> <?php 
    _e('Please enter your footer section title here.', 'crunchpress');
    ?>
 </h3>
</li>
                            </ul>
							<div class="clear"></div>
							<ul class="recipe_class">
								<li class="panel-title">
									<label for=""><?php 
    _e('Footer Widget Layout', 'crunchpress');
    ?>
</label>
								</li>
								<li class="panel-radioimage">
									<?php 
    $value = '';
    $options = array('1' => array('value' => 'home_4_col', 'image' => '/framework/images/footer-style1.png'), '2' => array('value' => 'home_3_col', 'image' => '/framework/images/footer-style6.png'));
    foreach ($options as $option) {
        ?>
										<div class='radio-image-wrapper'>
											<label for="<?php 
        echo $option['value'];
        ?>
">
												<img src=<?php 
        echo CP_PATH_URL . $option['image'];
        ?>
 class="home_page_layout" alt="home_page_layout" />
												<div id="check-list"></div>                                
											</label>
											<input type="radio" name="home_page_layout" value="<?php 
        echo $option['value'];
        ?>
" id="<?php 
        echo $option['value'];
        ?>
" class="dd"
											<?php 
        if ($home_page_layout == $option['value']) {
            echo 'checked';
        }
        ?>
											>                            
										</div>
									<?php 
    }
    ?>
									<br class="clear">	
								</li>
								<li class="description"><h3> <?php 
    _e('Please select home page layout style.', 'crunchpress');
    ?>
 </h3>
</li>
							</ul>								
						</li>
						<div class="panel-element-tail">
							<div class="tail-save-changes">
								<div class="loading-save-changes"></div>
								<input type="submit" value="<?php 
    echo __('Save Changes', 'crunchpress');
    ?>
">
								<input type="hidden" name="action" value="homepage_settings">				
								<!--<input type="hidden" name="security" value="<?php 
    //echo wp_create_nonce(plugin_basename(__FILE__))
    ?>
">-->
							</div>
						</div>
					</ul>
				</div>
			</form>
		</div>	
	</div>
</div>	
	<?php 
}
コード例 #25
0
ファイル: page-normalshift.php プロジェクト: shimion/preview1
 if ($item_xml->nodeName != 'Color-Open' && $item_xml->nodeName != 'Color-Close') {
     $additional_style = '';
     $additional_class = strtolower($item_xml->nodeName) . '-item-class ';
     $additional_class = $additional_class . strtolower($item_xml->nodeName) . '-item-class-' . $item_count;
     if ($item_xml->nodeName == 'Blog' || $item_xml->nodeName == 'Portfolio') {
         $item_margin = find_xml_value($item_xml, 'item-margin', false, 40);
     } else {
         $item_margin = find_xml_value($item_xml, 'item-margin', false, 45);
     }
     $item_margin = intval($item_margin);
     if ($item_margin <= 50) {
         $additional_class = $additional_class . ' mb' . $item_margin;
     } else {
         $additional_style = 'margin-bottom: ' . $item_margin . 'px;';
     }
     $gdl_item_row_size = print_item_size(find_xml_value($item_xml, 'size'), $gdl_item_row_size, $additional_class, 'div', 'div', $additional_style);
     switch ($item_xml->nodeName) {
         case 'Accordion':
             print_accordion_item($item_xml);
             break;
         case 'Blog':
             print_blog_item($item_xml);
             break;
         case 'Contact-Form':
             print_contact_form($item_xml);
             break;
         case 'Column':
             print_column_item($item_xml);
             break;
         case 'Column-Service':
             print_column_service($item_xml);
コード例 #26
0
ファイル: page-option.php プロジェクト: uglmee/kikiku.com
function print_box_tab($name, $values)
{
    ?>
		
		<div class="meta-body">
			<div class="meta-title meta-tab">ADD MORE TABS</div>
			<div id="page-tab-add-more" class="page-tab-add-more" /></div>
			<br class="clear">
			<div class="meta-input">
				<input type='hidden' class="tab-num" id="tab-num" name='<?php 
    echo $name['tab-num'];
    ?>
[]' value=<?php 
    echo empty($values) ? 0 : $values->childNodes->length;
    ?>
 />
				<div class="added-tab" id="added-tab">
					<ul>
						<li id="page-item-tab" class="default">	
							<div class="meta-title meta-tab-title">TABS TITLE</div><input type="text"  id='<?php 
    echo $name['title'];
    ?>
' /> <br>
							<div class="meta-title meta-tab-title">TABS TEXT</div><textarea id='<?php 
    echo $name['caption'];
    ?>
' ></textarea> <br>
							<?php 
    if (!empty($name['active'])) {
        ?>
								<div class="meta-title meta-tab-title">Tabs Active</div>
								<div class="combobox">
									<select id='<?php 
        echo $name['active'];
        ?>
' >
										<option>Yes</option>
										<option selected>No</option>	
									</select>
								</div>
							<?php 
    }
    ?>
							<div id="unpick-tab" class="unpick-tab"></div>
						</li>
						
						<?php 
    if (!empty($values)) {
        foreach ($values->childNodes as $tab) {
            ?>
								<li id="page-item-tab" class="page-item-tab">	
									<div class="meta-title meta-tab-title">TABS TITLE</div><input type="text" name='<?php 
            echo $name['title'];
            ?>
[]' id='<?php 
            echo $name['title'];
            ?>
' value="<?php 
            echo find_xml_value($tab, 'title');
            ?>
" /> <br>
									<div class="meta-title meta-tab-title">TABS TEXT</div><textarea name='<?php 
            echo $name['caption'];
            ?>
[]' id='<?php 
            echo $name['caption'];
            ?>
' ><?php 
            echo find_xml_value($tab, 'caption');
            ?>
</textarea> <br>
									<div id="unpick-tab" class="unpick-tab"></div>
									<?php 
            if (!empty($name['active'])) {
                ?>
										<?php 
                $is_active = find_xml_value($tab, 'active');
                ?>
										<div class="meta-title meta-tab-title">Tabs Active</div>
										<div class="combobox">
											<select id='<?php 
                echo $name['active'];
                ?>
' name='<?php 
                echo $name['active'];
                ?>
[]' >
												<option <?php 
                if ($is_active == 'Yes') {
                    echo 'selected';
                }
                ?>
>Yes</option>
												<option <?php 
                if ($is_active != 'Yes') {
                    echo 'selected';
                }
                ?>
>No</option>	
											</select>
										</div>
									<?php 
            }
            ?>
								</li>			
							<?php 
        }
    }
    ?>
					</ul>
					<br class=clear>
				</div>
			</div>
			<br class=clear>
		</div>
		<?php 
}
コード例 #27
0
function gdl_gallery_shortcode($atts, $content = null)
{
    extract(shortcode_atts(array('title' => '', 'width' => '200', 'height' => '200', 'type' => ''), $atts));
    global $gdl_element_id;
    $gdl_gallery = "";
    $gallery_post = get_posts(array('post_type' => 'gdl-gallery', 'name' => $title, 'numberposts' => 1));
    $slider_xml_string = get_post_meta($gallery_post[0]->ID, 'post-option-gallery-xml', true);
    $slider_xml_dom = new DOMDocument();
    if (!empty($slider_xml_string)) {
        $slider_xml_dom->loadXML($slider_xml_string);
        // Normal gallery type
        if (empty($type)) {
            foreach ($slider_xml_dom->documentElement->childNodes as $slider) {
                $link_type = find_xml_value($slider, 'linktype');
                $image_url = wp_get_attachment_image_src(find_xml_value($slider, 'image'), $width . 'x' . $height);
                $alt_text = get_post_meta(find_xml_value($slider, 'image'), '_wp_attachment_image_alt', true);
                $gdl_gallery = $gdl_gallery . '<div class="gdl-gallery-image shortcode">';
                if ($link_type == 'Link to URL') {
                    $link = find_xml_value($slider, 'link');
                    $gdl_gallery = $gdl_gallery . '<a href="' . $link . '" title="' . $link . '" target="_blank" >';
                    $gdl_gallery = $gdl_gallery . '<img class="gdl-gallery-image" src="' . $image_url[0] . '" alt="' . $alt_text . '" />';
                    $gdl_gallery = $gdl_gallery . '</a>';
                } else {
                    if ($link_type == 'Lightbox') {
                        $image_full = wp_get_attachment_image_src(find_xml_value($slider, 'image'), 'full');
                        $gdl_gallery = $gdl_gallery . '<a data-rel="fancybox" data-fancybox-group="gal' . $gdl_element_id . '" href="' . $image_full[0] . '"  title="' . $alt_text . '">';
                        $gdl_gallery = $gdl_gallery . '<img class="gdl-gallery-image" src="' . $image_url[0] . '" alt="' . $alt_text . '" />';
                        $gdl_gallery = $gdl_gallery . '</a>';
                    } else {
                        $gdl_gallery = $gdl_gallery . '<img class="gdl-gallery-image" src="' . $image_url[0] . '" alt="' . $alt_text . '" />';
                    }
                }
                $gdl_gallery = $gdl_gallery . '</div>';
                // gallery-thumbnail-image
            }
            $gdl_gallery = $gdl_gallery . '<div class="clear"></div>';
            // Thumbnail gallery type
        } else {
            $thumbnail_id = get_post_thumbnail_id($gallery_post[0]->ID);
            $thumbnail_full = wp_get_attachment_image_src($thumbnail_id, 'full');
            $thumbnail_url = wp_get_attachment_image_src($thumbnail_id, $width . 'x' . $height);
            $alt_text = get_post_meta($thumbnail_id, '_wp_attachment_image_alt', true);
            $gdl_gallery = $gdl_gallery . '<div class="gdl-gallery-image shortcode">';
            $gdl_gallery = $gdl_gallery . '<a data-rel="fancybox" data-fancybox-group="gal' . $gdl_element_id . '" href="' . $thumbnail_full[0] . '" title="' . $alt_text . '" >';
            $gdl_gallery = $gdl_gallery . '<img src="' . $thumbnail_url[0] . '" alt="' . $alt_text . '" />';
            $gdl_gallery = $gdl_gallery . '</a>';
            foreach ($slider_xml_dom->documentElement->childNodes as $slider) {
                $thumbnail_id = find_xml_value($slider, 'image');
                $image_full = wp_get_attachment_image_src($thumbnail_id, 'full');
                $alt_text = get_post_meta($thumbnail_id, '_wp_attachment_image_alt', true);
                $gdl_gallery = $gdl_gallery . '<a data-rel="fancybox" data-fancybox-group="gal' . $gdl_element_id . '" href="' . $image_full[0] . '"  title="' . $alt_text . '"></a>';
            }
            $gdl_gallery = $gdl_gallery . '</div>';
        }
        $gdl_element_id++;
    }
    return $gdl_gallery;
}
コード例 #28
0
ファイル: slideset-class.php プロジェクト: ConceptHaus/backup
 }
 $slide_set_array[$slidecount]['media_url'] = find_xml_value($slide, 'media_url');
 $slide_set_array[$slidecount]['embed_type'] = find_xml_value($slide, 'embed_type');
 $slide_set_array[$slidecount]['autoplay'] = find_xml_value($slide, 'autoplay');
 $slide_set_array[$slidecount]['title'] = find_xml_value($slide, 'title') != '' ? find_xml_value($slide, 'title') : $attachment_meta['title'];
 $slide_set_array[$slidecount]['description'] = find_xml_value($slide, 'description') != '' ? find_xml_value($slide, 'description') : $attachment_meta['description'];
 $slide_set_array[$slidecount]['caption'] = $attachment_meta['caption'];
 $slide_set_array[$slidecount]['alt'] = $attachment_meta['alt'];
 $slide_set_array[$slidecount]['link_url'] = find_xml_value($slide, 'link_url');
 $slide_set_array[$slidecount]['css_classes'] = find_xml_value($slide, 'css_classes');
 $slide_set_array[$slidecount]['readmore_link'] = find_xml_value($slide, 'readmore_link');
 $slide_set_array[$slidecount]['timeout'] = find_xml_value($slide, 'timeout');
 $slide_set_array[$slidecount]['stage_content'] = find_xml_value($slide, 'stage_content');
 $slide_set_array[$slidecount]['title_overlay'] = find_xml_value($slide, 'title_overlay');
 $slide_set_array[$slidecount]['filter_tags'] = find_xml_value($slide, 'filter_tags');
 $filter_tags = str_replace(", ", ",", find_xml_value($slide, 'filter_tags'));
 $filter_tags = explode(",", $filter_tags);
 foreach ($filter_tags as $filter_tag) {
     $category_array[] = $filter_tag;
     // Enter Categories into an Array
 }
 // Timeout
 $NV_slidetimeout = get_post_meta($slide, 'gallery-slide-timeout', true);
 if (!empty($slide_set_array[$slidecount]['timeout'])) {
     $NV_slidearray .= $slide_set_array[$slidecount]['timeout'] . ",";
 } elseif (!empty($NV_stagetimeout)) {
     $NV_slidearray .= $NV_stagetimeout . ",";
 } else {
     $NV_slidearray .= "10,";
 }
 $slidecount++;
コード例 #29
0
ファイル: blog-item.php プロジェクト: shimion/preview1
function print_blog_item($item_xml)
{
    $additional = '';
    $additional_html = '';
    $blog_type = find_xml_value($item_xml, 'blog-type');
    if ($blog_type == 'Carousel') {
        $additional = 'navigation-on';
    }
    $offset = find_xml_value($item_xml, 'offset');
    $pagination = find_xml_value($item_xml, "pagination");
    $view_all_blog = find_xml_value($item_xml, 'read-the-blog');
    if (!empty($view_all_blog) && $view_all_blog != 'None') {
        global $gdl_admin_translator;
        if ($gdl_admin_translator == 'enable') {
            $translator_view = get_option(THEME_SHORT_NAME . '_translator_read_the_blog', 'Read The Blog');
        } else {
            $translator_view = __('Read The Blog', 'gdl_front_end');
        }
        $additional_html = '<a href="' . get_permalink(get_page_by_path($view_all_blog));
        $additional_html = $additional_html . '" class="view-all-projects">';
        $additional_html = $additional_html . $translator_view . '</a>';
    }
    print_item_header(find_xml_value($item_xml, 'header'), $additional, $additional_html, find_xml_value($item_xml, 'icon-class'));
    global $paged, $sidebar_type, $blog_div_size_num_class;
    $paged = get_query_var('paged') ? get_query_var('paged') : get_query_var('page');
    $paged = $paged ? $paged : 1;
    if ($pagination == "No") {
        $paged = 1;
    }
    if ($paged != '1') {
        $offset = "";
    }
    // get the item class and size from array
    $item_type = find_xml_value($item_xml, 'item-size');
    $item_class = $blog_div_size_num_class[$item_type]['class'];
    $item_size = $blog_div_size_num_class[$item_type][$sidebar_type];
    // get the blog meta value
    $num_fetch = find_xml_value($item_xml, 'num-fetch');
    $num_excerpt = find_xml_value($item_xml, 'num-excerpt');
    $full_content = find_xml_value($item_xml, 'show-full-blog-post');
    $blog_thumbnail = find_xml_value($item_xml, 'show-thumbnail');
    if ($blog_thumbnail == 'No') {
        $item_size = '';
    }
    $category = find_xml_value($item_xml, 'category', false);
    $category = $category == 'All' ? '' : $category;
    $order = find_xml_value($item_xml, 'order');
    $orderby = find_xml_value($item_xml, 'orderby');
    // start fetching database
    query_posts(array('post_type' => 'post', 'paged' => $paged, 'order' => $order, 'orderby' => $orderby, 'category_name' => $category, 'posts_per_page' => $num_fetch, 'offset' => $offset));
    // printing each blog function
    echo '<div class="blog-item-holder">';
    if ($item_type == '1/4 Blog Widget' || $item_type == '1/3 Blog Widget' || $item_type == '1/2 Blog Widget' || $item_type == '1/1 Blog Widget') {
        if ($blog_type == 'Carousel') {
            print_blog_widget_carousel($item_class, $item_size, $num_excerpt, $full_content, $item_type);
        } else {
            print_blog_widget($item_class, $item_size, $num_excerpt, $full_content, $item_type);
        }
    } else {
        if ($item_type == '1/1 Blog List') {
            print_blog_list($item_class, $item_size);
        } else {
            if ($item_type == '1/1 Medium Thumbnail') {
                print_blog_medium($item_class, $item_size, $num_excerpt, $full_content);
            } else {
                if ($item_type == '1/1 Full Thumbnail') {
                    print_blog_full($item_class, $item_size, $num_excerpt, $full_content);
                }
            }
        }
    }
    echo '</div>';
    echo '<div class="clear"></div>';
    if ($pagination == "Yes") {
        pagination();
    }
    wp_reset_query();
}
コード例 #30
0
        public function print_pastor_item_item($item_xml)
        {
            global $counter;
            if (class_exists('cp_album_class')) {
                $select_layout_cp = '';
                $cp_general_settings = get_option('general_settings');
                if ($cp_general_settings != '') {
                    $cp_logo = new DOMDocument();
                    $cp_logo->loadXML($cp_general_settings);
                    $select_layout_cp = find_xml_value($cp_logo->documentElement, 'select_layout_cp');
                }
                //Initializing Class
                $cp_album_class = new cp_album_class();
                //Fetch values from Page Builder
                $header = find_xml_value($item_xml, 'header');
                $category = find_xml_value($item_xml, 'category');
                //bx Slider for Artists
                wp_register_script('cp-bx-slider', CP_PATH_URL . '/frontend/js/bxslider.min.js', false, '1.0', true);
                wp_enqueue_script('cp-bx-slider');
                wp_enqueue_style('cp-bx-slider', CP_PATH_URL . '/frontend/css/bxslider.css');
                wp_register_script('cp-jplayer', CP_PATH_URL . '/frontend/js/jquery.jplayer.min.js', false, '1.0', true);
                wp_enqueue_script('cp-jplayer');
                ?>
			<script type="text/JavaScript">
			jQuery(document).ready(function ($) {
				if ($('#slide_element').length) {
					$('#slide_element').bxSlider({
						slideWidth: <?php 
                if ($select_layout_cp == 'full_layout') {
                    echo '280';
                } else {
                    echo '280';
                }
                ?>
,
						minSlides: 1,
						maxSlides: 4,
						slideMargin: <?php 
                if ($select_layout_cp == 'full_layout') {
                    echo '17.5';
                } else {
                    echo '17.5';
                }
                ?>
,
						pager:false,
						auto: true,
						tickerHover:true,
						onSliderLoad: function(){
						}
					});
				}
			});
			</script>
			<div class="featuder-row">
				<h2><?php 
                echo $header;
                ?>
</h2>
				<section id="slide_element" class="row-fluid slide_element">
					<?php 
                if ($category == 0) {
                    //Post Query
                    query_posts(array('post_type' => 'sermons', 'posts_per_page' => 10, 'orderby' => 'title', 'order' => 'ASC'));
                } else {
                    //Post Query
                    query_posts(array('post_type' => 'sermons', 'posts_per_page' => 10, 'tax_query' => array(array('taxonomy' => 'sermons-category', 'terms' => $category, 'field' => 'term_id')), 'orderby' => 'title', 'order' => 'ASC'));
                }
                while (have_posts()) {
                    the_post();
                    global $post, $post_id;
                    $sermons_id = $post->ID;
                    //Fetch All Tracks
                    $track_name_xml = get_post_meta($sermons_id, 'track_name_xml', true);
                    $track_url_xml = get_post_meta($sermons_id, 'track_url_xml', true);
                    $track_des_xml = get_post_meta($sermons_id, 'track_des_xml', true);
                    $track_down_xml = get_post_meta($sermons_id, 'track_down_xml', true);
                    //Get elements by documentElement
                    $track_name_array = $this->get_sermons_all_tracks($track_name_xml);
                    $track_url_array = $this->get_sermons_all_tracks($track_url_xml);
                    $track_lyrics_array = $this->get_sermons_all_tracks($track_des_xml);
                    $track_download_array = $this->get_sermons_all_tracks($track_down_xml);
                    ?>
					<div class="">
						<div class="item_caro">
							<script type="text/JavaScript">
								//<![CDATA[
								jQuery(document).ready(function($){
									var stream = {
										<?php 
                    //Loop for Tracks
                    if ($track_name_xml != '' || $track_url_xml != '') {
                        $counter_track = 0;
                        $nofields = 1;
                        for ($i = 0; $i < $nofields; $i++) {
                            $img_url_aa = 'http://www.jplayer.org/video/poster/Big_Buck_Bunny_Trailer_480x270.png';
                            echo 'title:"' . $track_name_array->item($i)->nodeValue . '",';
                            echo 'pastor:"' . $track_name_array->item($i)->nodeValue . '",';
                            echo 'mp3:"' . $track_url_array->item($i)->nodeValue . '",';
                            echo 'poster:"' . $img_url_aa . '"';
                        }
                    }
                    ?>
									},
									ready = false;
									$("#jquery_jplayer_<?php 
                    echo $sermons_id . $counter;
                    ?>
").jPlayer({
										ready: function (event) {
											ready = true;
											$(this).jPlayer("setMedia", stream);
										},
										pause: function() {
											$(this).jPlayer("clearMedia");
										},
										error: function(event) {
											if(ready && event.jPlayer.error.type === $.jPlayer.error.URL_NOT_SET) {
												// Setup the media stream again and play it.
												$(this).jPlayer("setMedia", stream).jPlayer("play");
											}
										},
										cssSelectorAncestor: "#jp_container_<?php 
                    echo $sermons_id . $counter;
                    ?>
",
										swfPath: "<?php 
                    echo CP_PATH_URL;
                    ?>
/frontend/js/Jplayer.swf",
										supplied: "mp3",
										preload: "none",
										wmode: "window",
										keyEnabled: true
									});									
								});
								//]]>
							</script>
							<div class="artist-box fadeInLeftBig cp_load">
								<div class="frame">
									<?php 
                    echo get_the_post_thumbnail($album_id, array(275, 290));
                    ?>
								</div>
								<strong class="title"><a href="<?php 
                    echo get_permalink();
                    ?>
"><?php 
                    echo get_the_title();
                    ?>
</a></strong>
								<ul class="text-detail">
									<li class="headphone-icon"><span class="font-aw"><i class="icon-headphones"></i></span>
									<a><?php 
                    echo $track_name_array->length;
                    ?>
 <?php 
                    _e('Sermons', 'crunchpress');
                    ?>
</a></li>
									<li class="play-icon">
										<div id="jquery_jplayer_<?php 
                    echo $sermons_id . $counter;
                    ?>
" class="cp_jp-jplayer"></div>
										<div id="jp_container_<?php 
                    echo $sermons_id . $counter;
                    ?>
" class="cp_jp-audio-stream">
											<div class="jp-type-single">
												<div class="jp-gui cp_jp-interface">
													<ul class="cp_jp-controls">
														<li><a href="javascript:;" class="jp-play" tabindex="1"><?php 
                    _e('Listen', 'crunchpress');
                    ?>
</a></li>
														<li><a href="javascript:;" class="jp-pause" tabindex="1"><?php 
                    _e('Pause', 'crunchpress');
                    ?>
</a></li>
														<!--<li><a href="javascript:;" class="jp-mute" tabindex="1" title="mute">mute</a></li>
														<li><a href="javascript:;" class="jp-unmute" tabindex="1" title="unmute">unmute</a></li>
														<li><a href="javascript:;" class="jp-volume-max" tabindex="1" title="max volume">max volume</a></li>-->
													</ul>
													<!--<div class="jp-volume-bar">
														<div class="jp-volume-bar-value"></div>
													</div>-->
												</div>
												<!--<div class="jp-title">
													<ul>
														<li>ABC Jazz</li>
													</ul>
												</div>-->
												<div class="jp-no-solution">
													<span><?php 
                    echo __('Update Required', 'crunchpress');
                    ?>
</span>
													<?php 
                    echo __('To play the media you will need to either update your browser to a recent version or update your', 'crunchpress');
                    ?>
 <a href="http://get.adobe.com/flashplayer/" target="_blank"><?php 
                    echo __('Flash plugin', 'crunchpress');
                    ?>
</a>.
												</div>
											</div>
										</div>
									</li>
									<li class="like-icon">
										<?php 
                    $cp_album_class = new cp_album_class();
                    ?>
									</li>
								</ul>
							</div>
						</div>
					</div>
					<?php 
                }
                ?>
				</section>
				<div class="border-line">&nbsp;<a id="no-album-active" class="hide-album"><?php 
                echo __('Click Here', 'crunchpress');
                ?>
</a></div>
			</div>	
			<?php 
            }
        }