public function parse_items($its, $margs, $wpqargs) { //echo 'ceva'; $fout = ''; $taxonomy = 'categoryportfolio'; $thecustomcats = array(); //print_r($margs); //=======custom categories if ($margs['cats'] != '') { $thecustomcats = explode(',', $margs['cats']); } //print_r($thecustomcats); for ($i = 0; $i < count($its); $i++) { //print_r($its[$i]); $iout = ''; $che = $its[$i]; // --- stabilizing meta $the_id = $che->ID; $the_link = get_permalink($the_id); //== the link to the actual item $the_type = 'thumb'; $striptags = true; $meta_disable_title_subtitle = get_post_meta($the_id, 'dzsp_disable_title_subtitle', true); $meta_disable_content = get_post_meta($the_id, 'dzsp_disable_content', true); $meta_biggallery = get_post_meta($the_id, 'dzsp_biggallery', true); $meta_image_gallery = get_post_meta($the_id, 'dzsp_image_gallery', true); $meta_image_gallery_images = explode(',', $meta_image_gallery); if (get_post_meta($the_id, 'dzsp_item_type', true) != '') { $the_type = get_post_meta($the_id, 'dzsp_item_type', true); } if ($the_type == 'thumb') { if ($meta_image_gallery != '') { $meta_biggallery = 'gallery-for-item-' . $the_id; } } if ($the_type == 'link') { $the_link = get_post_meta($the_id, 'dzsp_featured_media', true); } if (($margs['skin'] == 'skin-accordion' || $margs['skin'] == 'skin-clean') && ($the_type == 'video' || $the_type == 'youtube' || $the_type == 'vimeo' || $the_type == 'gallery' || $the_type == 'audio' || $the_type == 'testimonial')) { $meta_disable_content = 'on'; $meta_disable_title_subtitle = 'on'; } //===== setting up links START / setup links $link_type_featuredmedia = get_post_meta($the_id, 'dzsp_link_featurearea', true); $link_featuredmedia = get_post_meta($the_id, 'dzsp_big_image', true); //dzsp_link_featurearea if (get_post_meta($the_id, 'dzsp_link_featurearea', true) == 'item') { $link_featuredmedia = $the_link; } if (get_post_meta($the_id, 'dzsp_link_featurearea', true) == 'customlink') { $link_featuredmedia = get_post_meta($the_id, 'dzsp_customlink', true); } if (get_post_meta($the_id, 'dzsp_link_featurearea', true) == 'content_opener') { $link_featuredmedia = 'content_opener'; } if (get_post_meta($the_id, 'dzsp_link_featurearea', true) == 'none') { $link_featuredmedia = ''; } $link_type_metaarea = get_post_meta($the_id, 'dzsp_link_metaarea', true); $link_metaarea = $the_link; //dzsp_link_featurearea if (get_post_meta($the_id, 'dzsp_link_metaarea', true) == 'bigimage') { $link_metaarea = get_post_meta($the_id, 'dzsp_big_image', true); } if (get_post_meta($the_id, 'dzsp_link_metaarea', true) == 'customlink') { $link_metaarea = get_post_meta($the_id, 'dzsp_customlink', true); } if (get_post_meta($the_id, 'dzsp_link_metaarea', true) == 'content_opener') { $link_metaarea = 'content_opener'; } if (get_post_meta($the_id, 'dzsp_link_metaarea', true) == 'none') { $link_metaarea = ''; } $link_title = ''; //dzsp_link_featurearea if (get_post_meta($the_id, 'dzsp_link_title', true) == 'item') { $link_title = $the_link; } if (get_post_meta($the_id, 'dzsp_link_title', true) == 'customlink') { $link_title = get_post_meta($the_id, 'dzsp_customlink', true); } if (get_post_meta($the_id, 'dzsp_link_title', true) == 'none') { $link_title = ''; } if ($link_metaarea != '') { $link_title = ''; } // echo ' cevava '.$the_id.' '.get_post_meta($the_id,'dzsp_link_metaarea',true).' | '.$link_metaarea; $str_item_w = ''; $aux = get_post_meta($the_id, 'dzsp_force_width', true); if ($aux != '') { $str_item_w .= ' width:'; if (strpos($aux, "%") === false && strpos($aux, "auto") === false && strpos($aux, "px") === false) { $str_item_w .= $aux . 'px'; } else { $str_item_w .= $aux; } $str_item_w .= ';'; } $str_item_h = ''; $aux = get_post_meta($the_id, 'dzsp_force_height', true); if ($aux != '') { $str_item_h .= ' height:'; if (strpos($aux, "%") === false && strpos($aux, "auto") === false && strpos($aux, "px") === false) { $str_item_h .= $aux . 'px'; } else { $str_item_h .= $aux; } $str_item_h .= ';'; } $str_thumb_w = ''; $aux = get_post_meta($the_id, 'dzsp_force_thumb_width', true); if ($aux != '') { $str_thumb_w .= ' width:'; if (strpos($aux, "%") === false && strpos($aux, "auto") === false && strpos($aux, "px") === false) { $str_thumb_w .= $aux . 'px'; } else { $str_thumb_w .= $aux; } $str_thumb_w .= ';'; } $str_thumb_h = ''; $aux = get_post_meta($the_id, 'dzsp_force_thumb_height', true); if ($aux != '') { $str_thumb_h .= ' height:'; if (strpos($aux, "%") === false && strpos($aux, "auto") === false && strpos($aux, "px") === false) { $str_thumb_h .= $aux . 'px'; } else { $str_thumb_h .= $aux; } $str_thumb_h .= ';'; } $the_subtitle = get_post_meta($the_id, 'dzsp_subtitle', true); if ($the_subtitle == '' && ($margs['skin'] == 'skin-default' || $margs['skin'] == 'skin-zero') && $che->post_excerpt) { $the_subtitle = $che->post_excerpt; } $post_terms = array(); $post_terms = wp_get_post_terms($the_id, $taxonomy, array("fields" => "names")); if ($wpqargs['post_type'] == 'product') { $taxonomy = 'product_cat'; $post_terms = wp_get_post_terms($the_id, $taxonomy, array("fields" => "names")); } if ($wpqargs['post_type'] == 'courses') { //echo 'ceva'; $taxonomy = 'course_categories'; $post_terms = wp_get_post_terms($the_id, 'category', array("fields" => "names")); } if ($wpqargs['post_type'] == 'post') { //echo 'ceva'; $taxonomy = 'category'; $post_terms = wp_get_post_terms($the_id, 'category', array("fields" => "names")); } //print_r($post_terms); //=== needs improving, zoomit - now i think it does not $design_item_width = $margs['design_item_width']; $design_item_height = $margs['design_item_height']; // -- design_item_height was set in the if ($design_item_height == '' || $design_item_height == 'auto') { $design_item_height = 200; } //==temp solution // echo $design_item_width; echo $design_item_height; echo 'design'; $the_src = ''; if ($this->db_mainoptions['thumbs_full_quality'] == 'full') { $the_src = wp_get_attachment_image_src(get_post_thumbnail_id($che->ID), 'full'); } else { if ($this->db_mainoptions['thumbs_full_quality'] == 'medium') { $the_src = wp_get_attachment_image_src(get_post_thumbnail_id($che->ID), array($design_item_width * 2, $design_item_height * 2)); } else { $the_src = wp_get_attachment_image_src(get_post_thumbnail_id($che->ID), array($design_item_width, $design_item_height)); } } //print_r($the_src); $thumbnail_src = $the_src[0]; if ($this->db_mainoptions['misc_force_featured_media_over_featured_image'] == 'on' && get_post_meta($the_id, 'dzsp_featured_media', true) != '' || $thumbnail_src == '' && get_post_meta($the_id, 'dzsp_featured_media', true) != '') { $thumbnail_src = get_post_meta($the_id, 'dzsp_featured_media', true); } // print_r($margs); $maxlen = 233; if (isset($margs['settings_excerpt_len'])) { $maxlen = $margs['settings_excerpt_len']; } if (get_post_meta($the_id, 'dzsp_excerpt_len', true) != '') { $maxlen = get_post_meta($the_id, 'dzsp_excerpt_len', true); } if ($maxlen === 'all') { $maxlen = 1234567; } $po_excerpt_content = ''; // ----- -------- -------- -- --------- // --- -------- start output the item // ---------- ------------- - ----------- $iout .= '<div class="portitem-tobe'; if (get_post_meta($the_id, 'dzsp_extra_classes', true) != '') { $iout .= ' ' . get_post_meta($the_id, 'dzsp_extra_classes', true); } $iout .= '" '; // --- we force the youtube and vimeo to Featured Media Meta Field ( it's a id, you can't set it in Featured Image ) $dataType = $the_type; // --datatype is the type to put int javascript if ($the_type == 'twitter') { $dataType = 'testimonial'; } if ($the_type == 'youtube' || $the_type == 'vimeo' || $the_type == 'video') { // ---- videos // ------ if there is a featured image if ($the_src[0] != '') { $iout .= ' data-thumbnail="' . $the_src[0] . '"'; } $iout .= ' data-source_video="' . get_post_meta($the_id, 'dzsp_featured_media', true) . '"'; if (get_post_meta($the_id, 'dzsp_sourceogg', true) != '') { $iout .= ' data-source_video_ogg="' . get_post_meta($the_id, 'dzsp_sourceogg', true) . '"'; } } else { $iout .= ' data-thumbnail="' . $thumbnail_src . '"'; } if ($the_type == 'audio') { wp_enqueue_script('dzs.audioplayer', $this->thepath . 'audioplayer/audioplayer.js'); wp_enqueue_style('dzs.audioplayer', $this->thepath . 'audioplayer/audioplayer.css'); // print_r($the_src); // ------ if there is a featured image if ($the_src[0] != '') { $iout .= ' data-thumbnail="' . $the_src[0] . '"'; } $iout .= ' data-source_audio="' . get_post_meta($the_id, 'dzsp_featured_media', true) . '"'; if (get_post_meta($the_id, 'dzsp_sourceogg', true) != '') { $iout .= ' data-source_audio_ogg="' . get_post_meta($the_id, 'dzsp_sourceogg', true) . '"'; } } if ($the_type == 'thumb' && isset($margs['settings_biggalleryall']) && $margs['settings_biggalleryall'] == 'on') { $iout .= ' data-biggallery="' . 'port1' . '"'; } else { if ($the_type == 'thumb' && $meta_biggallery != '') { $iout .= ' data-biggallery="' . $meta_biggallery . '"'; } } if (get_post_meta($the_id, 'dzsp_open_big_image_in_lightbox', true) == 'off') { $iout .= ' data-donotopenbigimageinzoombox="on"'; } if (get_post_meta($the_id, 'dzsp_highlight_color', true) != '') { $iout .= ' data-color_highlight="' . get_post_meta($the_id, 'dzsp_highlight_color', true) . '"'; } if (get_post_meta($the_id, 'dzsp_slideshowtime', true) != '') { $iout .= ' data-slideshowtime="' . get_post_meta($the_id, 'dzsp_slideshowtime', true) . '"'; } $iout .= ' data-link="' . $link_metaarea . '"'; $iout .= ' data-typefeaturedarea="' . $dataType . '"'; if (get_post_meta($the_id, 'dzsp_big_image', true) != '') { if ($margs['skin'] == 'skin-clean') { $iout .= ' data-bigimage="' . get_post_meta($the_id, 'dzsp_big_image', true) . '"'; } else { $iout .= ' data-bigimage="' . $link_featuredmedia . '"'; } } if (get_post_meta($the_id, 'dzsp_force_width', true) != '') { $iout .= ' data-forcewidth="' . get_post_meta($the_id, 'dzsp_force_width', true) . '"'; } if (get_post_meta($the_id, 'dzsp_force_height', true) != '') { $iout .= ' data-forceheight="' . get_post_meta($the_id, 'dzsp_force_height', true) . '"'; } if (get_post_meta($the_id, 'dzsp_force_thumb_width', true) != '') { $iout .= ' data-forcethumbwidth="' . get_post_meta($the_id, 'dzsp_force_thumb_width', true) . '"'; } if (get_post_meta($the_id, 'dzsp_force_thumb_height', true) != '') { $iout .= ' data-forcethumbheight="' . get_post_meta($the_id, 'dzsp_force_thumb_height', true) . '"'; } if (is_array($post_terms)) { $ik = 0; $iout .= ' data-category="'; foreach ($post_terms as $post_term) { //print_r($post_term); echo 'ceva'; print_r($thecustomcats); //$cat $auxsw = false; foreach ($thecustomcats as $customcat) { $aux = get_term($customcat, $taxonomy); //print_r($aux); if ($aux->name == $post_term) { $auxsw = true; } } if ($margs['cats'] == '') { $auxsw = true; } if ($auxsw == false) { continue; } //print_r($thecustomcats); if ($ik > 0) { $iout .= ';'; } $post_term = str_replace('"', '', $post_term); $iout .= $post_term; $ik++; } $iout .= '"'; } if ($the_type == 'youtube') { $iout .= ' data-heroimage="' . $this->thepath . 'dzsportfolio/img/hero-type-video-youtube.png"'; } if ($the_type == 'vimeo') { $iout .= ' data-heroimage="' . $this->thepath . 'dzsportfolio/img/hero-type-video-vimeo.png"'; } if ($the_type == 'twitter') { $iout .= ' data-heroimage="' . $this->thepath . 'dzsportfolio/img/hero-type-twitter.png"'; } if ($the_type == 'link') { $iout .= ' data-heroimage="' . $this->thepath . 'dzsportfolio/img/hero-type-link.png"'; } $iout .= '>'; if ($the_type == 'gallery') { wp_enqueue_script('dzs.advancedscroller', $this->thepath . 'advancedscroller/plugin.js'); wp_enqueue_style('dzs.advancedscroller', $this->thepath . 'advancedscroller/plugin.css'); $iout .= '<div class="the-feature-data">'; $image_gallery_meta = get_post_meta($the_id, 'dzsp_image_gallery', true); $image_gallery_arr = explode(',', $image_gallery_meta); if (is_array($image_gallery_arr) && count($image_gallery_arr) > 0) { foreach ($image_gallery_arr as $img) { //echo ; $imgsrc = wp_get_attachment_image_src($img, 'full'); //echo $imgsrc; $iout .= '<img class="fullwidth" src="' . $imgsrc[0] . '"/>'; } } $iout .= '</div>'; } if ($the_type == 'testimonial') { //echo 'ceva'; $iout .= '<div class="the-feature-data">'; $iout .= get_post_meta($the_id, 'dzsp_featured_media', true); $iout .= '</div>'; } if ($the_type == 'twitter') { //echo 'ceva'; $iout .= '<div class="the-feature-data">'; include_once dirname(__FILE__) . '/twitterapiwrapper/twitterapi.php'; //==complete these with your twitter api key details $token = $this->db_mainoptions['twitter_token']; $token_secret = $this->db_mainoptions['twitter_token_secret']; $consumer_key = $this->db_mainoptions['twitter_consumer_key']; $consumer_secret = $this->db_mainoptions['twitter_consumer_secret']; $api1 = new TwitterAPI($token, $token_secret, $consumer_key, $consumer_secret); $query = array('screen_name' => get_post_meta($the_id, 'dzsp_featured_media', true), 'count' => '1'); $data = $api1->do_query($query); //print_r($data); if (isset($data->errors)) { print_r($data); //echo 'ceva'; } else { $iout .= $data[0]->text; } $iout .= '</div>'; } if ($the_type == 'audio') { wp_enqueue_script('dzs.audioplayer', $this->thepath . 'audioplayer/audioplayer.js'); wp_enqueue_style('dzs.audioplayer', $this->thepath . 'audioplayer/audioplayer.css'); } if ($the_type == 'video' || $the_type == 'youtube' || $the_type == 'vimeo') { wp_enqueue_script('dzs.vplayer', $this->thepath . "videogallery/vplayer.js"); wp_enqueue_style('dzs.vplayer', $this->thepath . 'videogallery/vplayer.css'); } $the_post_content = ''; $attachments = get_children(array('post_parent' => $the_id, 'post_type' => 'attachment', 'post_mime_type' => 'image', 'orderby' => 'menu_order', 'order' => 'ASC')); //echo 'the post is ' . $the_id . "\n"; $str_items = ''; $image_gallery_meta = get_post_meta($the_id, 'dzsp_image_gallery', true); $image_gallery_arr = explode(',', $image_gallery_meta); if ($image_gallery_meta != '') { foreach ($image_gallery_arr as $img) { //echo ; $imgsrcarr = wp_get_attachment_image_src($img, 'full'); //echo $imgsrc; $str_items .= '<li class="item-tobe needs-loading"> <div class="imagediv" style="background-image: url(' . $imgsrcarr[0] . '); height:250px;"></div> </li>'; } } $aux_stripshortcodes = true; if ($maxlen === 1234567) { $striptags = false; $aux_stripshortcodes = false; } $the_post_content_inner = ''; $the_post_content_inner .= stripslashes(DZSHelpers::wp_get_excerpt($the_id, array('forceexcerpt' => false, 'readmore' => 'auto', 'stripshortcodes' => $aux_stripshortcodes, 'striptags' => $striptags, 'maxlen' => $maxlen, 'content' => $po_excerpt_content, 'aftercutcontent_html' => ' [...]'))); $the_post_content_inner = str_replace('{link_metaarea}', $link_metaarea, $the_post_content_inner); // echo 'ceva'.$the_post_content_inner.'END'; //we run the html through a parser to close unclosed tags if ($striptags == false && $the_post_content_inner != '' && class_exists('DOMDocument') && $maxlen !== 1234567) { $doc = new DOMDocument(); $doc->loadHTML($the_post_content_inner); $aux_body_html = ''; $children = $doc->childNodes; $scriptTags = $doc->getElementsByTagName('script'); foreach ($scriptTags as $script) { if ($script->childNodes->length && $script->firstChild->nodeType == 4) { $cdata = $script->removeChild($script->firstChild); $text = $doc->createTextNode($cdata->nodeValue); $script->appendChild($text); } } foreach ($children as $child) { // print_r($child); // echo $child->ownerDocument->saveXML( $child ); $aux_body_html .= $child->ownerDocument->saveXML($child); } $aux_body_html = str_replace('<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd"><html><body>', '', $aux_body_html); $aux_body_html = str_replace('</body></html>', '', $aux_body_html); $aux_body_html = str_replace(array('<![CDATA['), '', $aux_body_html); $aux_body_html = str_replace(array(' '), '', $aux_body_html); // $aux_body_html = preg_replace('>', 'dadahmm', $aux_body_html); // echo 'auxhtml'; echo $aux_body_html; $the_post_content_inner = $aux_body_html; } $excerpt_gallery_slider_str = ''; $the_project_meta_html = ''; if ($str_items != '') { $excerpt_gallery_slider_str .= '<div class="advancedscroller-con"> <div class="advancedscroller skin-agata-inset" style="width:100%;"><ul class="items">'; $excerpt_gallery_slider_str .= $str_items; $excerpt_gallery_slider_str .= '</ul></div></div>'; $excerpt_gallery_slider_str .= '<div class="toexecute"> (function() { var aux = window.dzsp_execute_target.find(".advancedscroller"); jQuery(document).ready(function($){ window.dzsas_init(aux,{ settings_mode: "onlyoneitem" ,design_arrowsize: "0" ,settings_swipe: "on" ,settings_swipeOnDesktopsToo: "on" ,settings_slideshow: "on" ,settings_slideshowTime: "15" }); }); })(); </div>'; } if ($che->post_excerpt != '') { $the_project_meta_html = $che->post_excerpt; } else { if ($excerpt_gallery_slider_str != '') { $the_project_meta_html .= '<div class="dzs-col-6">'; $the_project_meta_html .= $excerpt_gallery_slider_str; $the_project_meta_html .= '</div>'; $the_project_meta_html .= '<div class="dzs-col-6'; } else { $the_project_meta_html .= '<div class="dzs-col-12'; } if ($margs['skin'] == 'skin-accordion' || $margs['skin'] == 'skin-clean') { $the_project_meta_html .= ' project-meta-con'; } $the_project_meta_html .= '">'; $the_project_meta_html .= stripslashes(DZSHelpers::wp_get_excerpt($the_id, array('maxlen' => 4000, 'forceexcerpt' => false, 'readmore' => 'auto', 'stripshortcodes' => false, 'striptags' => false, 'maxlen' => $maxlen, 'aftercutcontent_html' => ' [...]'))); $the_project_meta_html .= '</div>'; } $the_project_meta_html = str_replace('{{dzsp_gallery_slider}}', $excerpt_gallery_slider_str, $the_project_meta_html); $the_project_meta_html = str_replace('{{dzsp_post_link}}', get_permalink($the_id), $the_project_meta_html); $str_big_content = ''; $str_big_content .= '<div class="the-content excerpt-content" style=""><div class="dzs-colcontainer">'; $str_big_content .= $the_project_meta_html; $str_big_content .= '</div></div>'; // echo 'ceva3'.$str_big_content; // echo $margs['skin'] . 'ceva'; if ($margs['skin'] == 'skin-corporate') { $iout .= '<div class="item-meta" style="margin-top: 15px;">'; } //echo 'ceva23'; echo $str_items; echo $str_items!=''; if ($margs['skin'] == 'skin-clean' || $margs['skin'] == 'skin-accordion') { if ($link_type_featuredmedia == 'content_opener') { $iout .= $str_big_content; } } //echo 'hmmceva'.$the_post_content_inner.'hmmalceva';; $the_post_content .= $the_post_content_inner; //===skins which have a slider if ($margs['skin'] == 'skin-accordion' || $margs['skin'] == 'skin-clean') { $the_post_content .= '</div>'; //===END skins which have a slider } // $the_post_content.='</div>'; //close row // echo $the_post_content; //==skin default and skin-nebula and skin-timeline have only title and desc //=== skin corporate has content but uses these too.. if (($margs['skin'] == 'skin-timeline' || $margs['skin'] == 'skin-nebula' || $margs['skin'] == 'skin-clean' || $margs['skin'] == 'skin-corporate' || $margs['skin'] == 'skin-default' || $margs['skin'] == 'skin-zero' || $margs['skin'] == 'skin-accordion' || $margs['skin'] == 'skin-boxed' || $margs['skin'] == 'skin-aura' || $margs['skin'] == 'skin-vintage' || $margs['skin'] == 'skin-commerce') && $meta_disable_title_subtitle != 'on') { if ($che->post_title) { $iout .= '<div class="the-title">'; if ($link_title != '') { $iout .= '<a href="' . $link_title . '">'; } $iout .= $che->post_title; if ($link_title != '') { $iout .= '</a>'; } $iout .= '</div>'; } if ($wpqargs['post_type'] == 'product' && ($margs['skin'] == 'skin-default' || $margs['skin'] == 'skin-commerce') && $the_subtitle == '') { $the_subtitle = ''; $old_price = ''; $sale_price = ''; $old_price = get_post_meta($the_id, '_regular_price', true); if (get_post_meta($the_id, '_sale_price', true)) { $sale_price = get_post_meta($the_id, '_sale_price', true); } //--- if woo commerce enabled if ($old_price && function_exists('get_woocommerce_currency_symbol')) { if ($sale_price) { $the_subtitle .= '<div class="price"><span class="real-price">' . get_woocommerce_currency_symbol(get_woocommerce_currency()) . $sale_price . '</span> <span class="old-price">' . get_woocommerce_currency_symbol(get_woocommerce_currency()) . $old_price . '</span></div>'; } else { $the_subtitle .= '<div class="price"><span class="real-price">' . get_woocommerce_currency_symbol(get_woocommerce_currency()) . $old_price . '</span></div>'; } $the_subtitle .= ' <div class="addtocart-con">'; if ($margs['skin'] == 'skin-default') { $the_subtitle .= '<div class="button-addtocart">'; } if ($margs['skin'] == 'skin-commerce') { $the_subtitle .= '<div class="addtocart-btn">'; } switch (get_post_meta($the_id, 'dzswc_link_purchase', true)) { case "customlink": $the_subtitle .= '<a href="' . get_post_meta($the_id, 'dzswc_customlink', true) . '">ADD TO CART</a>'; break; case 'none': $the_subtitle .= '<span>ADD TO CART</span>'; break; default: $the_subtitle .= '<a href="' . $the_link . '?add-to-cart=' . $che->ID . '">ADD TO CART</a>'; break; } $the_subtitle .= '</div></div>'; } } if ($the_subtitle != '' && $margs['skin'] != 'skin-boxed') { $iout .= '<div class="the-desc">'; $iout .= $the_subtitle; $iout .= '</div>'; } if ($margs['skin'] == 'skin-corporate') { $iout .= $the_post_content . ''; } } // echo 'cevahmm'.($margs['skin'] == 'skin-clean' || $margs['skin'] == 'skin-corporate' || $margs['skin'] == 'skin-accordion').' ; '.($meta_disable_content != 'on').' ; '.($the_post_content_inner!=''). $the_post_content_inner; if (($margs['skin'] == 'skin-boxed' || $margs['skin'] == 'skin-vintage') && $meta_disable_content != 'on' && $the_post_content_inner != '') { // echo 'hmmdadadada'; $iout .= '<div class="the-desc">'; if ($margs['skin'] == 'skin-boxed') { $iout .= '<hr class="separator-short">'; } $iout .= $the_post_content . ''; //echo $str_items; if ($str_items != '') { wp_enqueue_script('dzs.advancedscroller', $this->thepath . 'advancedscroller/plugin.js'); wp_enqueue_style('dzs.advancedscroller', $this->thepath . 'advancedscroller/plugin.css'); } $iout .= '</div>'; } if ($margs['skin'] === 'skin-corporate') { $iout .= '</div>'; ///===end item-meta } if (get_post_meta($the_id, 'dzsp_highlight_color', true) != '') { if ($margs['skin'] == 'skin-default') { $iout .= '<style>'; $iout .= ' #port' . $this->sliders_index . ' .portitem:nth-child(' . ($i + 1) . '):hover .the-title{ color: ' . get_post_meta($the_id, 'dzsp_highlight_color', true) . ';}'; $iout .= ' #port' . $this->sliders_index . ' .portitem:nth-child(' . ($i + 1) . '):hover:after{ border-bottom-color: ' . get_post_meta($the_id, 'dzsp_highlight_color', true) . '; }'; $iout .= ' #port' . $this->sliders_index . ' .portitem:nth-child(' . ($i + 1) . '):hover{ border-bottom: 1px solid ' . get_post_meta($the_id, 'dzsp_highlight_color', true) . ';}'; $iout .= '</style>'; } } //------------ //===skinblog custom markup if ($margs['skin'] == 'skin-blog') { ///===== skin blog $str_bg = ''; if (get_post_meta($the_id, 'dzsp_highlight_color', true) != '') { $str_bg = 'background-color:' . get_post_meta($the_id, 'dzsp_highlight_color', true) . ';'; } $str_datainittop = ''; if (get_post_meta($the_id, 'dzsp_infometa_top', true) != '') { $str_datainittop = ' data-inittop="' . get_post_meta($the_id, 'dzsp_infometa_top', true) . '"'; } //echo $str_datainittop; if ($meta_disable_content != 'on') { $iout .= '<div class="item-meta" ' . $str_datainittop . ' style="' . $str_bg . '">'; $iout .= '<div class="the-title">'; if ($the_link != '') { $iout .= '<a href="' . $the_link . '">'; } $iout .= $che->post_title; if ($the_link != '') { $iout .= '</a>'; } $iout .= '</div>'; $iout .= '<div class="the-post-meta">'; //==calendar $iout .= '<span class="meta-property">'; $iout .= '<span class="icon-meta-calendar"></span>'; $iout .= '<span class="meta-property-content">'; $iout .= get_the_time('Y-m-d', $the_id); $iout .= '</span>'; $iout .= '</span>'; $post_terms_ids = wp_get_post_terms($the_id, 'categoryportfolio', array("fields" => "ids")); $ik = 0; if (is_array($post_terms_ids)) { $iout .= '<span class="meta-property"><span class="icon-meta-category"></span><span class="meta-property-content">'; foreach ($post_terms_ids as $post_term) { if ($ik > 0) { $iout .= ', '; } $aux_term = get_term($post_term, 'categoryportfolio'); //print_r($aux_term); echo ' '; $term_link = get_term_link($aux_term->slug, 'categoryportfolio'); $iout .= '<a href="' . $term_link . '">' . $aux_term->name . '</a>'; $ik++; } $iout .= '</span></span>'; } if (comments_open($the_id)) { $num_comments = get_comments_number($the_id); if ($num_comments == 0) { } else { //==comments $iout .= '<span class="meta-property">'; $iout .= '<span class="icon-meta-comment"></span>'; $iout .= '<span class="meta-property-content""><a href="' . get_permalink($the_id) . '#comments">'; $iout .= $num_comments; $iout .= ' ' . __('comments', 'dzsp') . '</a></span>'; $iout .= '</span>'; } } $iout .= '</div>'; // dzs_get_excerpt($the_id,array('forceexcerpt' => false,'readmore' => 'on','maxlen' => $maxlen)) $iout .= '<div class="the-post-content">' . $the_post_content . '</div>'; $iout .= '</div>'; // END item-meta } } //$the_meta = $this->get_post_meta_all($the_id); //print_r($the_meta); // //echo $the_link; $iout .= '</div>'; // continue; // -------------------- ------ // --- layered construct - --- // ----- ------------- ------- if ($margs['skin'] == 'skin-default') { $iout = ''; $iout .= '<div class="portitem-tobe'; if (get_post_meta($the_id, 'dzsp_extra_classes', true) != '') { $iout .= ' ' . get_post_meta($the_id, 'dzsp_extra_classes', true); } $iout .= '" style="'; $iout .= $str_item_w; $iout .= $str_item_h; // if (get_post_meta($the_id,'dzsp_force_height',true) != '') { // $iout.=' data-forceheight="'.get_post_meta($the_id,'dzsp_force_height',true).'"'; // } // if (get_post_meta($the_id,'dzsp_force_thumb_width',true) != '') { // $iout.=' data-forcethumbwidth="'.get_post_meta($the_id,'dzsp_force_thumb_width',true).'"'; // } // if (get_post_meta($the_id,'dzsp_force_thumb_height',true) != '') { // $iout.=' data-forcethumbheight="'.get_post_meta($the_id,'dzsp_force_thumb_height',true).'"'; // } $iout .= '"'; if ($the_type == 'audio') { wp_enqueue_script('dzs.audioplayer', $this->thepath . 'audioplayer/audioplayer.js'); wp_enqueue_style('dzs.audioplayer', $this->thepath . 'audioplayer/audioplayer.css'); // print_r($the_src); // ------ if there is a featured image if ($the_src[0] != '') { $iout .= ' data-thumbnail="' . $the_src[0] . '"'; } $iout .= ' data-source_audio="' . get_post_meta($the_id, 'dzsp_featured_media', true) . '"'; if (get_post_meta($the_id, 'dzsp_sourceogg', true) != '') { $iout .= ' data-source_audio_ogg="' . get_post_meta($the_id, 'dzsp_sourceogg', true) . '"'; } } if ($the_type == 'youtube' || $the_type == 'vimeo' || $the_type == 'video') { // ---- videos wp_enqueue_script('dzs.vplayer', $this->thepath . "videogallery/vplayer.js"); wp_enqueue_style('dzs.vplayer', $this->thepath . 'videogallery/vplayer.css'); // ------ if there is a featured image if ($the_src[0] != '') { $iout .= ' data-thumbnail="' . $the_src[0] . '"'; } $iout .= ' data-source_video="' . get_post_meta($the_id, 'dzsp_featured_media', true) . '"'; } if (get_post_meta($the_id, 'dzsp_sourceogg', true) != '') { $iout .= ' data-source_video_ogg="' . get_post_meta($the_id, 'dzsp_sourceogg', true) . '"'; } if (is_array($post_terms)) { $ik = 0; $iout .= ' data-category="'; foreach ($post_terms as $post_term) { //print_r($post_term); echo 'ceva'; print_r($thecustomcats); //$cat $auxsw = false; foreach ($thecustomcats as $customcat) { $aux = get_term($customcat, $taxonomy); //print_r($aux); if ($aux->name == $post_term) { $auxsw = true; } } if ($margs['cats'] == '') { $auxsw = true; } if ($auxsw == false) { continue; } //print_r($thecustomcats); if ($ik > 0) { $iout .= ';'; } $post_term = str_replace('"', '', $post_term); $iout .= $post_term; $ik++; } $iout .= '"'; } $iout .= ' data-typefeaturedarea="' . $dataType . '"'; $iout .= '>'; if ($the_type == 'gallery') { wp_enqueue_script('dzs.advancedscroller', $this->thepath . 'advancedscroller/plugin.js'); wp_enqueue_style('dzs.advancedscroller', $this->thepath . 'advancedscroller/plugin.css'); $iout .= '<div class="the-feature-data">'; if (is_array($meta_image_gallery_images) && count($meta_image_gallery_images) > 0) { foreach ($meta_image_gallery_images as $img) { if ($img == '') { continue; } $aux_po = get_post($img); $the_src = ''; $the_thumb = ''; if ($aux_po && $aux_po->post_mime_type == 'video/mp4') { $the_src = $aux_po->guid; } else { $imgsrc = wp_get_attachment_image_src($img, 'full'); $the_src = $imgsrc[0]; $the_thumb = $the_src; } if (get_post_meta($img, '_attachment_video_thumb', true) != '') { $the_thumb = get_post_meta($img, '_attachment_video_thumb', true); } $iout .= '<img class="fullwidth" src="' . $the_src . '" style="'; $iout .= $str_thumb_h; $iout .= '"/>'; } } $iout .= '</div>'; } $iout .= '<div class="the-feature-con " style="'; $iout .= $str_thumb_w; $iout .= $str_thumb_h; $iout .= '"'; $iout .= '>'; if ($the_type == 'thumb' || $the_type == 'link') { $iout .= '<div class="the-feature" style="background-image: url(' . $thumbnail_src . ');"></div>'; } // if($dataType=='gallery'){ // $iout.='<div class="the-feature advancedscroller skin-inset type-'+$dataType+'" style=""><ul class="items">'; // // $iout.='</ul></div>'; // } if ($the_type == 'link') { $link_featuredmedia = $the_link; } $iout .= '<div class="the-overlay">'; // <a data-biggallerythumbnail="img/t2.jpg" data-biggallery="gal1" href="img/b1.jpg" class="the-overlay-anchor content-opener" data-src="img/b1.jpg"> // <div class="plus-image"></div> // </a> if ($link_featuredmedia != '') { if ($the_type == 'thumb' || $the_type == 'link') { $iout .= '<a '; // echo 'cevava' . $the_id . ' ' . $link_type_featuredmedia; if ($link_type_featuredmedia === 'bigimage' && get_post_meta($the_id, 'dzsp_open_big_image_in_lightbox', true) != 'off') { if ($margs['settings_lightboxlibrary'] == 'prettyphoto') { $iout .= ' rel="prettyPhoto[' . $meta_biggallery . ']" title="You can add caption to pictures."'; } else { $iout .= 'data-biggallerythumbnail="' . $thumbnail_src . '"'; if (isset($margs['settings_biggalleryall']) && $margs['settings_biggalleryall'] == 'on') { $iout .= ' data-biggallery="' . 'port1' . '"'; } else { if ($the_type == 'thumb' && $meta_biggallery != '') { $iout .= ' data-biggallery="' . $meta_biggallery . '"'; } } } } $iout .= ' href="' . $link_featuredmedia . '" class="the-overlay-anchor'; if ($link_type_featuredmedia === 'content_opener') { $iout .= ' content-opener'; } if ($link_type_featuredmedia === 'bigimage') { if ($margs['settings_lightboxlibrary'] == 'prettyphoto') { } else { $iout .= ' zoombox'; } } $iout .= '" data-src="' . $link_featuredmedia . '"> <div class="plus-image"></div> </a>'; } } $iout .= '</div>'; //--end the-overlay $iout .= '</div>'; // -- end the-feature-con if ($link_metaarea == '' || $link_metaarea == 'content_opener') { $iout .= '<div class="item-meta'; if ($link_metaarea == 'content_opener') { $iout .= ' content-opener'; } $iout .= '" style="">'; } else { $iout .= '<a href="' . $link_metaarea . '" class="item-meta" style="">'; } if ($meta_disable_title_subtitle != 'on') { if ($che->post_title) { $iout .= '<div class="the-title">'; if ($link_title != '') { $iout .= '<a href="' . $link_title . '">'; } $iout .= $che->post_title; if ($link_title != '') { $iout .= '</a>'; } $iout .= '</div>'; } if ($wpqargs['post_type'] == 'product' && ($margs['skin'] == 'skin-default' || $margs['skin'] == 'skin-commerce') && $the_subtitle == '') { $the_subtitle = ''; $old_price = ''; $sale_price = ''; $old_price = get_post_meta($the_id, '_regular_price', true); if (get_post_meta($the_id, '_sale_price', true)) { $sale_price = get_post_meta($the_id, '_sale_price', true); } //--- if woo commerce enabled if ($old_price && function_exists('get_woocommerce_currency_symbol')) { if ($sale_price) { $the_subtitle .= '<div class="price"><span class="real-price">' . get_woocommerce_currency_symbol(get_woocommerce_currency()) . $sale_price . '</span> <span class="old-price">' . get_woocommerce_currency_symbol(get_woocommerce_currency()) . $old_price . '</span></div>'; } else { $the_subtitle .= '<div class="price"><span class="real-price">' . get_woocommerce_currency_symbol(get_woocommerce_currency()) . $old_price . '</span></div>'; } $the_subtitle .= ' <div class="addtocart-con">'; if ($margs['skin'] == 'skin-default') { $the_subtitle .= '<div class="button-addtocart">'; } if ($margs['skin'] == 'skin-commerce') { $the_subtitle .= '<div class="addtocart-btn">'; } switch (get_post_meta($the_id, 'dzswc_link_purchase', true)) { case "customlink": $the_subtitle .= '<a href="' . get_post_meta($the_id, 'dzswc_customlink', true) . '">ADD TO CART</a>'; break; case 'none': $the_subtitle .= '<span>ADD TO CART</span>'; break; default: $the_subtitle .= '<a href="' . $the_link . '?add-to-cart=' . $che->ID . '">ADD TO CART</a>'; break; } $the_subtitle .= '</div></div>'; } } if ($the_subtitle != '' && $margs['skin'] != 'skin-boxed') { $iout .= '<div class="the-desc">'; $iout .= $the_subtitle; $iout .= '</div>'; } } // <div class="the-title">Paris Photoshoot</div> // <div class="the-desc">June 2013</div> if ($link_metaarea == '' || $link_metaarea == 'content_opener') { $iout .= '</div>'; } else { $iout .= '</a>'; } if ($link_metaarea == 'content_opener' || $link_featuredmedia == 'content_opener' || $link_title == 'content_opener') { $iout .= $str_big_content; } $iout .= '</div>'; //-- end portitem-tobe } // --- entering hidden thumbs for the lightbox library for project if ($the_type == 'thumb') { if (is_array($meta_image_gallery_images) && count($meta_image_gallery_images) > 0) { foreach ($meta_image_gallery_images as $img) { if ($img == '') { continue; } $aux_po = get_post($img); $the_src = ''; $the_thumb = ''; if ($aux_po && $aux_po->post_mime_type == 'video/mp4') { $the_src = $aux_po->guid; } else { $imgsrc = wp_get_attachment_image_src($img, 'full'); $the_src = $imgsrc[0]; $the_thumb = $the_src; } if (get_post_meta($img, '_attachment_video_thumb', true) != '') { $the_thumb = get_post_meta($img, '_attachment_video_thumb', true); } //echo $imgsrc; //echo 'ceva'; print_r($aux); if ($margs['settings_lightboxlibrary'] == 'prettyphoto') { $iout .= '<a href="' . $the_src . '" class="hidden" rel="prettyPhoto[' . $meta_biggallery . ']" title="You can add caption to pictures."><img src="' . $the_thumb . '" width="60" height="60" alt="Red round shape" /></a>'; } else { $iout .= '<a href="' . $the_src . '" class="hidden zoombox" data-biggallery="' . $meta_biggallery . '" data-biggallerythumbnail="' . $the_thumb . '"></a>'; } } } } $fout .= $iout; } return $fout; }
function admin_page_mainoptions() { //print_r($this->mainoptions); //echo $this->mainoptions['twitter_token']; ?> <div class="wrap"> <h2><?php echo __('Page Builder Main Settings', 'dzspb'); ?> </h2> <br/> <form class="mainsettings"> <h3><?php echo __('Admin Options', 'dzspb'); ?> </h3> <div class="setting"> <div class="label"><?php echo __('Main Container', 'dzspb'); ?> </div> <?php echo DZSHelpers::generate_input_text('layout_name_dzspb_con', array('val' => '', 'seekval' => $this->mainoptions['layout_name_dzspb_con'])); ?> <div class="sidenote"><?php echo __('', 'dzspb'); ?> </div> </div> <div class="setting"> <div class="label"><?php echo __('Layout Layout Container', 'dzspb'); ?> </div> <?php echo DZSHelpers::generate_input_text('layout_name_dzspb_layout_con', array('val' => '', 'seekval' => $this->mainoptions['layout_name_dzspb_layout_con'])); ?> <div class="sidenote"><?php echo __('', 'dzspb'); ?> </div> </div> <div class="setting"> <div class="label"><?php echo __('Layout Raw Class', 'dzspb'); ?> </div> <?php echo DZSHelpers::generate_input_text('layout_name_dzspb_raw', array('val' => '', 'seekval' => $this->mainoptions['layout_name_dzspb_raw'])); ?> <div class="sidenote"><?php echo __('', 'dzspb'); ?> </div> </div> <div class="setting"> <div class="label"><?php echo __('Layout One Full', 'dzspb'); ?> </div> <?php echo DZSHelpers::generate_input_text('layout_name_dzspb_one_full', array('val' => '', 'seekval' => $this->mainoptions['layout_name_dzspb_one_full'])); ?> <div class="sidenote"><?php echo __('', 'dzspb'); ?> </div> </div> <div class="setting"> <div class="label"><?php echo __('Layout One Half', 'dzspb'); ?> </div> <?php echo DZSHelpers::generate_input_text('layout_name_dzspb_one_half', array('val' => '', 'seekval' => $this->mainoptions['layout_name_dzspb_one_half'])); ?> <div class="sidenote"><?php echo __('', 'dzspb'); ?> </div> </div> <div class="setting"> <div class="label"><?php echo __('Layout One Third', 'dzspb'); ?> </div> <?php echo DZSHelpers::generate_input_text('layout_name_dzspb_one_third', array('val' => '', 'seekval' => $this->mainoptions['layout_name_dzspb_one_third'])); ?> <div class="sidenote"><?php echo __('', 'dzspb'); ?> </div> </div> <div class="setting"> <div class="label"><?php echo __('Layout Two Third', 'dzspb'); ?> </div> <?php echo DZSHelpers::generate_input_text('layout_name_dzspb_two_third', array('val' => '', 'seekval' => $this->mainoptions['layout_name_dzspb_two_third'])); ?> <div class="sidenote"><?php echo __('', 'dzspb'); ?> </div> </div> <div class="setting"> <div class="label"><?php echo __('Layout One Fourth', 'dzspb'); ?> </div> <?php echo DZSHelpers::generate_input_text('layout_name_dzspb_one_fourth', array('val' => '', 'seekval' => $this->mainoptions['layout_name_dzspb_one_fourth'])); ?> <div class="sidenote"><?php echo __('', 'dzspb'); ?> </div> </div> <div class="setting"> <div class="label"><?php echo __('Layout Three Fourth', 'dzspb'); ?> </div> <?php echo DZSHelpers::generate_input_text('layout_name_dzspb_three_fourth', array('val' => '', 'seekval' => $this->mainoptions['layout_name_dzspb_three_fourth'])); ?> <div class="sidenote"><?php echo __('', 'dzspb'); ?> </div> </div> <div class="dzs-setting"> <h4><?php echo __('Mode ', 'dzspb'); ?> </h4> <?php $lab = 'mode'; echo DZSHelpers::generate_select($lab, array('class' => 'styleme', 'def_value' => '', 'seekval' => $this->mainoptions[$lab], 'options' => array(array('val' => 'editor', 'lab' => __('editor', 'dzspb')), array('val' => 'meta', 'lab' => __('meta', 'dzspb'))))); ?> <div class="clear"></div> <div class='sidenote'><?php echo __('allows to display Pages too in the Portfolio .. and set option for them', 'dzspb'); ?> </div> <div class="clear"></div> </div> <div class="dzs-setting"> <h4><?php echo __('Enable Page Builder for ... ', 'dzspb'); ?> </h4> <?php $lab = 'pb_post_types'; // print_r($this->mainoptions[$lab]); // print_r(get_option('active_plugins')); $args = array('public' => true, '_builtin' => false); $output = 'names'; // names or objects, note names is the default $operator = 'and'; // 'and' or 'or' $post_types = get_post_types($args, $output, $operator); echo DZSHelpers::generate_input_checkbox($lab . '[]', array('class' => 'styleme', 'def_value' => '', 'seekval' => $this->mainoptions[$lab], 'val' => 'post')); echo __(' post', 'dzspb'); echo '<br/>'; echo DZSHelpers::generate_input_checkbox($lab . '[]', array('class' => 'styleme', 'def_value' => '', 'seekval' => $this->mainoptions[$lab], 'val' => 'page')); echo __(' page', 'dzspb'); echo '<br/>'; foreach ($post_types as $post_type) { echo DZSHelpers::generate_input_checkbox($lab . '[]', array('class' => 'styleme', 'def_value' => '', 'seekval' => $this->mainoptions[$lab], 'val' => $post_type)); echo __(' ' . $post_type, 'dzspb'); echo '<br/>'; } ?> <div class="clear"></div> <div class='sidenote'><?php echo __('allows to display Pages too in the Portfolio .. and set option for them', 'dzspb'); ?> </div> <div class="clear"></div> </div> <br/> <a href='#' class="button-primary save-btn save-mainoptions"><?php echo __('Save Options', 'dzspb'); ?> </a> </form> <div class="saveconfirmer" style=""><img alt="" style="" id="save-ajax-loading2" src="<?php echo site_url(); ?> /wp-admin/images/wpspin_light.gif"/></div> <script> jQuery(document).ready(function($) { dzspb_mainoptions_ready(); }) </script> </div> <?php }