本文整理汇总了PHP中find_xml_value函数的典型用法代码示例。如果您正苦于以下问题:PHP find_xml_value函数的具体用法?PHP find_xml_value怎么用?PHP find_xml_value使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了find_xml_value函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: print_blog_item
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: get_uploaded_font
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: tva_ajaxdata
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 = '';
//.........这里部分代码省略.........
示例4: gdl_gallery_shortcode
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: print_panel_upload_font
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: print_image_picker
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];
?>
//.........这里部分代码省略.........
示例7: print_stunning_text
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: register_non_admin_scripts
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()) {
//.........这里部分代码省略.........
示例9: general_options
//.........这里部分代码省略.........
$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');
示例10: print_contact_form
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: DOMDocument
$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: social_settings
//.........这里部分代码省略.........
//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">
示例13: print_featured_item
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: nv_slide_manager
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: print_port_item
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">
//.........这里部分代码省略.........