当前位置: 首页>>代码示例>>PHP>>正文


PHP RevSliderFunctions::cleanStdClassToArray方法代码示例

本文整理汇总了PHP中RevSliderFunctions::cleanStdClassToArray方法的典型用法代码示例。如果您正苦于以下问题:PHP RevSliderFunctions::cleanStdClassToArray方法的具体用法?PHP RevSliderFunctions::cleanStdClassToArray怎么用?PHP RevSliderFunctions::cleanStdClassToArray使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在RevSliderFunctions的用法示例。


在下文中一共展示了RevSliderFunctions::cleanStdClassToArray方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: get_slider_speed


//.........这里部分代码省略.........
                                                                //add only the largest video of the three here as each browser loads only one file and we can add here the biggest
                                                            } else {
                                                                $infos['id'] = 'external';
                                                            }
                                                        } else {
                                                            $infos['id'] = 'external';
                                                        }
                                                        $used_videos[$url] = $infos;
                                                    }
                                                    $video_size += $max_video_size;
                                                }
                                                break;
                                            case 'youtube':
                                                $infos['id'] = 'external';
                                                if (!isset($layer['video_data']->id) || empty($layer['video_data']->id)) {
                                                    continue;
                                                }
                                                $used_videos[$do_ssl . '//www.youtube.com/watch?v=' . $layer['video_data']->id] = $infos;
                                                break;
                                            case 'vimeo':
                                                if (!isset($layer['video_data']->id) || empty($layer['video_data']->id)) {
                                                    continue;
                                                }
                                                $infos['id'] = 'external';
                                                $used_videos[$do_ssl . '//vimeo.com/' . $layer['video_data']->id] = $infos;
                                                break;
                                        }
                                    }
                                }
                                break;
                        }
                        //check captions for actions
                        if (isset($layer['layer_action']) && !empty($layer['layer_action'])) {
                            $a_action = RevSliderFunctions::cleanStdClassToArray(RevSliderFunctions::getVal($layer['layer_action'], 'action', array()));
                            $a_link_type = RevSliderFunctions::cleanStdClassToArray(RevSliderFunctions::getVal($layer['layer_action'], 'link_type', array()));
                            if (!empty($a_action)) {
                                foreach ($a_action as $num => $action) {
                                    if ($using_actions == true) {
                                        break;
                                    }
                                    if ($action !== 'link') {
                                        $using_actions = true;
                                    } else {
                                        //check if jQuery or a tag
                                        if ($a_link_type[$num] == 'jquery') {
                                            $using_actions = true;
                                        }
                                    }
                                }
                            }
                        }
                        if (isset($layer['style']) && $layer['style'] != '') {
                            $used_captions[$layer['style']] = true;
                        }
                    }
                }
            }
        }
        $total_size += $img_size;
        $img_counter = 0;
        $issues = "";
        //$total_size += $video_size;
        ?>

		<span class="tp-clearfix" style="height:15px"></span>
		<hr>
开发者ID:hathbanger,项目名称:squab,代码行数:67,代码来源:operations.class.php

示例2: setLayersByPostData

 /**
  * 
  * replace layer placeholders by post data
  */
 private function setLayersByPostData($postData, $sliderID)
 {
     $postID = $postData["ID"];
     $attr = array();
     $attr['title'] = RevSliderFunctions::getVal($postData, "post_title");
     $excerpt_limit = $this->getSliderParam($sliderID, "excerpt_limit", 55, RevSlider::VALIDATE_NUMERIC);
     $excerpt_limit = (int) $excerpt_limit;
     $attr['excerpt'] = RevSliderFunctionsWP::getExcerptById($postID, $excerpt_limit);
     $attr['alias'] = RevSliderFunctions::getVal($postData, "post_name");
     $attr['content'] = RevSliderFunctions::getVal($postData, "post_content");
     $attr['link'] = get_permalink($postID);
     $postDate = RevSliderFunctions::getVal($postData, "post_date_gmt");
     $attr['postDate'] = RevSliderFunctionsWP::convertPostDate($postDate);
     $dateModified = RevSliderFunctions::getVal($postData, "post_modified");
     $attr['dateModified'] = RevSliderFunctionsWP::convertPostDate($dateModified);
     $authorID = RevSliderFunctions::getVal($postData, "post_author");
     $attr['authorName'] = RevSliderFunctionsWP::getUserDisplayName($authorID);
     $postCatsIDs = $postData["post_category"];
     $attr['catlist'] = RevSliderFunctionsWP::getCategoriesHtmlList($postCatsIDs);
     $attr['taglist'] = RevSliderFunctionsWP::getTagsHtmlList($postID);
     $ptid = get_post_thumbnail_id($postID);
     $img_sizes = RevSliderBase::get_all_image_sizes();
     $attr['img_urls'] = array();
     foreach ($img_sizes as $img_handle => $img_name) {
         $featured_image_url = wp_get_attachment_image_src($ptid, $img_handle);
         if ($featured_image_url !== false) {
             $attr['img_urls'][$img_handle] = array('url' => $featured_image_url[0], 'tag' => '<img src="' . $featured_image_url[0] . '" width="' . $featured_image_url[1] . '" height="' . $featured_image_url[2] . '" data-no-retina />');
         }
     }
     $numComments = RevSliderFunctions::getVal($postData, "comment_count");
     foreach ($this->arrLayers as $key => $layer) {
         $text = RevSliderFunctions::getVal($layer, "text");
         $text = apply_filters('revslider_mod_meta', $text, $postID, $postData);
         //option to add your own filter here to modify meta to your likings
         $text = $this->set_post_data($text, $attr, $postID);
         $layer["text"] = $text;
         $all_actions = RevSliderFunctions::getVal($layer, 'layer_action', array());
         if (!empty($all_actions)) {
             $a_image_link = RevSliderFunctions::cleanStdClassToArray(RevSliderFunctions::getVal($all_actions, 'image_link', array()));
             if (!empty($a_image_link)) {
                 foreach ($a_image_link as $ik => $ilink) {
                     $ilink = $this->set_post_data($ilink, $attr, $postID);
                     $a_image_link[$ik] = $ilink;
                 }
                 $layer['layer_action']->image_link = $a_image_link;
             }
         }
         $this->arrLayers[$key] = $layer;
     }
     for ($mi = 1; $mi <= 10; $mi++) {
         //set params to the post data
         $pa = $this->getParam('params_' . $mi, '');
         $pa = $this->set_post_data($pa, $attr, $postID);
         $this->setParam('params_' . $mi, $pa);
     }
 }
开发者ID:hathbanger,项目名称:squab,代码行数:60,代码来源:slide.class.php

示例3: putCreativeLayer


//.........这里部分代码省略.........
                 } else {
                     $videoThumbnail = str_replace("https://", "http://", $videoThumbnail);
                 }
                 if (trim($videoThumbnail) !== '') {
                     $htmlVideoThumbnail = '			data-videoposter="' . $videoThumbnail . '"' . " \n";
                 }
                 if (!empty($videoThumbnail)) {
                     if ($only_poster_on_mobile === true) {
                         //$htmlVideoThumbnail .= '			data-posterOnMobile="on"'." \n";
                         $htmlVideoThumbnail .= '			data-noposteronmobile="on"' . " \n";
                     } else {
                         //$htmlVideoThumbnail .= '			data-posterOnMobile="off"'." \n";
                         $htmlVideoThumbnail .= '			data-noposteronmobile="off"' . " \n";
                     }
                 }
                 $disable_on_mobile = RevSliderFunctions::getVal($videoData, "disable_on_mobile");
                 $disable_on_mobile = RevSliderFunctions::strToBool($disable_on_mobile);
                 $htmlDisableOnMobile = $disable_on_mobile ? '			data-disablevideoonmobile="1"' . " \n" : '';
                 $stopallvideo = RevSliderFunctions::getVal($videoData, "stopallvideo");
                 $stopallvideo = RevSliderFunctions::strToBool($stopallvideo);
                 $allowfullscreenvideo = RevSliderFunctions::getVal($videoData, "allowfullscreen");
                 $allowfullscreenvideo = RevSliderFunctions::strToBool($allowfullscreenvideo);
                 $htmlDisableOnMobile .= $stopallvideo ? '			data-stopallvideos="true"' . " \n" : '';
                 $htmlDisableOnMobile .= $allowfullscreenvideo ? '			data-allowfullscreenvideo="true"' . " \n" : '';
                 break;
         }
         $has_trigger = false;
         foreach ($layers as $cl) {
             if ($has_trigger) {
                 break;
             }
             $all_actions = RevSliderFunctions::getVal($cl, 'layer_action', array());
             if (!empty($all_actions)) {
                 $a_action = RevSliderFunctions::cleanStdClassToArray(RevSliderFunctions::getVal($all_actions, 'action', array()));
                 $a_layer_target = RevSliderFunctions::cleanStdClassToArray(RevSliderFunctions::getVal($all_actions, 'layer_target', array()));
                 foreach ($a_action as $ak => $aa) {
                     switch ($aa) {
                         case 'start_in':
                         case 'start_out':
                         case 'toggle_layer':
                             /*case 'stop_video':
                             		case 'start_video':
                             		case 'toggle_video':*/
                             if ($unique_id == $a_layer_target[$ak]) {
                                 $has_trigger = true;
                                 break;
                             }
                             break;
                     }
                 }
             }
         }
         $last_trigger_state = '';
         $animation_overwrite = 'default';
         $trigger_memory = 'keep';
         if ($has_trigger) {
             $animation_overwrite = RevSliderFunctions::getVal($layer, 'animation_overwrite', 'wait');
             $trigger_memory = RevSliderFunctions::getVal($layer, 'trigger_memory', 'keep');
             $last_trigger_state = '			data-lasttriggerstate="' . esc_attr($trigger_memory) . '"';
         }
         if ($animation_overwrite == 'waitin' || $animation_overwrite == 'wait') {
             $time = 'bytrigger';
         }
         if ($animation_overwrite == 'waitout' || $animation_overwrite == 'wait') {
             $htmlEnd = ' data-end="bytrigger"' . "\n";
         } else {
开发者ID:surreal8,项目名称:wptheme,代码行数:67,代码来源:output.class.php


注:本文中的RevSliderFunctions::cleanStdClassToArray方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。