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


PHP RevSliderFunctions::throwError方法代码示例

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


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

示例1: validateInited

 /**
  * validate that the slide is inited and the id exists.
  */
 private function validateInited()
 {
     if (empty($this->id)) {
         RevSliderFunctions::throwError("The slide is not initialized!!!");
     }
 }
开发者ID:hathbanger,项目名称:squab,代码行数:9,代码来源:slide.class.php

示例2: validateWpmlExists

 /**
  * 
  * valdiate that wpml exists
  */
 private static function validateWpmlExists()
 {
     if (!self::isWpmlExists()) {
         RevSliderFunctions::throwError("The wpml plugin is not activated");
     }
 }
开发者ID:ksan5835,项目名称:maadithottam,代码行数:10,代码来源:wpml.class.php

示例3: throwError

 /**
  * 
  * throw error
  */
 private function throwError($message, $code = -1)
 {
     RevSliderFunctions::throwError($message, $code);
 }
开发者ID:dawnthemes,项目名称:tkb,代码行数:8,代码来源:db.class.php

示例4: onAjaxAction

 /**
  *
  * onAjax action handler
  */
 public static function onAjaxAction()
 {
     $slider = new RevSlider();
     $slide = new RevSlide();
     $operations = new RevSliderOperations();
     $action = self::getPostGetVar("client_action");
     $data = self::getPostGetVar("data");
     $nonce = self::getPostGetVar("nonce");
     if (empty($nonce)) {
         $nonce = self::getPostGetVar("rs-nonce");
     }
     try {
         //verify the nonce
         $isVerified = wp_verify_nonce($nonce, "revslider_actions");
         if ($isVerified == false) {
             RevSliderFunctions::throwError("Wrong request");
         }
         switch ($action) {
             case 'add_new_preset':
                 if (!isset($data['settings']) || !isset($data['values'])) {
                     self::ajaxResponseError(__('Missing values to add preset', 'revslider'), false);
                 }
                 $result = $operations->add_preset_setting($data);
                 if ($result === true) {
                     $presets = $operations->get_preset_settings();
                     self::ajaxResponseSuccess(__('Preset created', 'revslider'), array('data' => $presets));
                 } else {
                     self::ajaxResponseError($result, false);
                 }
                 exit;
                 break;
             case 'update_preset':
                 if (!isset($data['name']) || !isset($data['values'])) {
                     self::ajaxResponseError(__('Missing values to update preset', 'revslider'), false);
                 }
                 $result = $operations->update_preset_setting($data);
                 if ($result === true) {
                     $presets = $operations->get_preset_settings();
                     self::ajaxResponseSuccess(__('Preset created', 'revslider'), array('data' => $presets));
                 } else {
                     self::ajaxResponseError($result, false);
                 }
                 exit;
                 break;
             case 'remove_preset':
                 if (!isset($data['name'])) {
                     self::ajaxResponseError(__('Missing values to remove preset', 'revslider'), false);
                 }
                 $result = $operations->remove_preset_setting($data);
                 if ($result === true) {
                     $presets = $operations->get_preset_settings();
                     self::ajaxResponseSuccess(__('Preset deleted', 'revslider'), array('data' => $presets));
                 } else {
                     self::ajaxResponseError($result, false);
                 }
                 exit;
                 break;
             case "export_slider":
                 $sliderID = self::getGetVar("sliderid");
                 $dummy = self::getGetVar("dummy");
                 $slider->initByID($sliderID);
                 $slider->exportSlider($dummy);
                 break;
             case "import_slider":
                 $updateAnim = self::getPostGetVar("update_animations");
                 $updateNav = self::getPostGetVar("update_navigations");
                 $updateStatic = self::getPostGetVar("update_static_captions");
                 self::importSliderHandle(null, $updateAnim, $updateStatic, $updateNav);
                 break;
             case "import_slider_slidersview":
                 $viewBack = self::getViewUrl(self::VIEW_SLIDERS);
                 $updateAnim = self::getPostGetVar("update_animations");
                 $updateNav = self::getPostGetVar("update_navigations");
                 $updateStatic = self::getPostGetVar("update_static_captions");
                 self::importSliderHandle($viewBack, $updateAnim, $updateStatic, $updateNav);
                 break;
             case "import_slider_online_template_slidersview":
                 $viewBack = self::getViewUrl(self::VIEW_SLIDERS);
                 self::importSliderOnlineTemplateHandle($viewBack, 'true', 'none');
                 break;
             case "import_slide_online_template_slidersview":
                 $redirect_id = esc_attr(self::getPostGetVar("redirect_id"));
                 $viewBack = self::getViewUrl(self::VIEW_SLIDE, "id={$redirect_id}");
                 $slidenum = intval(self::getPostGetVar("slidenum"));
                 $sliderid = intval(self::getPostGetVar("slider_id"));
                 self::importSliderOnlineTemplateHandle($viewBack, 'true', 'none', array('slider_id' => $sliderid, 'slide_id' => $slidenum));
                 break;
             case "import_slider_template_slidersview":
                 $viewBack = self::getViewUrl(self::VIEW_SLIDERS);
                 $updateAnim = self::getPostGetVar("update_animations");
                 $updateStatic = self::getPostGetVar("update_static_captions");
                 self::importSliderTemplateHandle($viewBack, $updateAnim, $updateStatic);
                 break;
             case "import_slide_template_slidersview":
                 $redirect_id = esc_attr(self::getPostGetVar("redirect_id"));
                 $viewBack = self::getViewUrl(self::VIEW_SLIDE, "id={$redirect_id}");
//.........这里部分代码省略.........
开发者ID:zruiz,项目名称:NG,代码行数:101,代码来源:revslider-admin.class.php

示例5: checkPurchaseVerification

 public function checkPurchaseVerification($data)
 {
     global $wp_version;
     $response = wp_remote_post('http://updates.themepunch.tools/activate.php', array('user-agent' => 'WordPress/' . $wp_version . '; ' . get_bloginfo('url'), 'body' => array('name' => urlencode($data['username']), 'api' => urlencode($data['api_key']), 'code' => urlencode($data['code']), 'product' => urlencode('revslider'))));
     $response_code = wp_remote_retrieve_response_code($response);
     $version_info = wp_remote_retrieve_body($response);
     if ($response_code != 200 || is_wp_error($version_info)) {
         return false;
     }
     if ($version_info == 'valid') {
         update_option('revslider-valid', 'true');
         update_option('revslider-api-key', $data['api_key']);
         update_option('revslider-username', $data['username']);
         update_option('revslider-code', $data['code']);
         return true;
     } elseif ($version_info == 'exist') {
         RevSliderFunctions::throwError(__('Purchase Code already registered!', REVSLIDER_TEXTDOMAIN));
     } else {
         return false;
     }
 }
开发者ID:hathbanger,项目名称:squab,代码行数:21,代码来源:operations.class.php

示例6: createTable

 /**
  * create tables
  */
 public static function createTable($tableName)
 {
     global $wpdb;
     $parseCssToDb = false;
     $checkForTablesOneTime = get_option('revslider_checktables', '0');
     if ($checkForTablesOneTime == '0') {
         update_option('revslider_checktables', '1');
         if (RevSliderFunctionsWP::isDBTableExists(self::$table_prefix . RevSliderGlobals::TABLE_CSS_NAME)) {
             //$wpdb->tables( 'global' )
             //check if database is empty
             $result = $wpdb->get_row("SELECT COUNT( DISTINCT id ) AS NumberOfEntrys FROM " . self::$table_prefix . RevSliderGlobals::TABLE_CSS_NAME);
             if ($result->NumberOfEntrys == 0) {
                 $parseCssToDb = true;
             }
         }
     }
     if ($parseCssToDb) {
         $RevSliderOperations = new RevSliderOperations();
         $RevSliderOperations->importCaptionsCssContentArray();
         $RevSliderOperations->moveOldCaptionsCss();
     }
     //if table exists - don't create it.
     $tableRealName = self::$table_prefix . $tableName;
     if (RevSliderFunctionsWP::isDBTableExists($tableRealName)) {
         return false;
     }
     switch ($tableName) {
         case RevSliderGlobals::TABLE_SLIDERS_NAME:
             $sql = "CREATE TABLE " . self::$table_prefix . $tableName . " (\r\r\n\t\t\t\t\t\t  id int(9) NOT NULL AUTO_INCREMENT,\r\r\n\t\t\t\t\t\t  title tinytext NOT NULL,\r\r\n\t\t\t\t\t\t  alias tinytext,\r\r\n\t\t\t\t\t\t  params MEDIUMTEXT NOT NULL,\r\r\n\t\t\t\t\t\t  UNIQUE KEY id (id)\r\r\n\t\t\t\t\t\t);";
             break;
         case RevSliderGlobals::TABLE_SLIDES_NAME:
             $sql = "CREATE TABLE " . self::$table_prefix . $tableName . " (\r\r\n\t\t\t\t\t\t\t  id int(9) NOT NULL AUTO_INCREMENT,\r\r\n\t\t\t\t\t\t\t  slider_id int(9) NOT NULL,\r\r\n\t\t\t\t\t\t\t  slide_order int not NULL,\r\r\n\t\t\t\t\t\t\t  params MEDIUMTEXT NOT NULL,\r\r\n\t\t\t\t\t\t\t  layers MEDIUMTEXT NOT NULL,\r\r\n\t\t\t\t\t\t\t  UNIQUE KEY id (id)\r\r\n\t\t\t\t\t\t\t);";
             break;
         case RevSliderGlobals::TABLE_STATIC_SLIDES_NAME:
             $sql = "CREATE TABLE " . self::$table_prefix . $tableName . " (\r\r\n\t\t\t\t\t\t\t  id int(9) NOT NULL AUTO_INCREMENT,\r\r\n\t\t\t\t\t\t\t  slider_id int(9) NOT NULL,\r\r\n\t\t\t\t\t\t\t  params MEDIUMTEXT NOT NULL,\r\r\n\t\t\t\t\t\t\t  layers MEDIUMTEXT NOT NULL,\r\r\n\t\t\t\t\t\t\t  UNIQUE KEY id (id)\r\r\n\t\t\t\t\t\t\t);";
             break;
         case RevSliderGlobals::TABLE_CSS_NAME:
             $sql = "CREATE TABLE " . self::$table_prefix . $tableName . " (\r\r\n\t\t\t\t\t\t\t  id int(9) NOT NULL AUTO_INCREMENT,\r\r\n\t\t\t\t\t\t\t  handle TEXT NOT NULL,\r\r\n\t\t\t\t\t\t\t  settings MEDIUMTEXT,\r\r\n\t\t\t\t\t\t\t  hover MEDIUMTEXT,\r\r\n\t\t\t\t\t\t\t  params MEDIUMTEXT NOT NULL,\r\r\n\t\t\t\t\t\t\t  UNIQUE KEY id (id)\r\r\n\t\t\t\t\t\t\t);";
             $parseCssToDb = true;
             break;
         case RevSliderGlobals::TABLE_LAYER_ANIMS_NAME:
             $sql = "CREATE TABLE " . self::$table_prefix . $tableName . " (\r\r\n\t\t\t\t\t\t\t  id int(9) NOT NULL AUTO_INCREMENT,\r\r\n\t\t\t\t\t\t\t  handle TEXT NOT NULL,\r\r\n\t\t\t\t\t\t\t  params TEXT NOT NULL,\r\r\n\t\t\t\t\t\t\t  UNIQUE KEY id (id)\r\r\n\t\t\t\t\t\t\t);";
             break;
         case RevSliderGlobals::TABLE_NAVIGATION_NAME:
             $sql = "CREATE TABLE " . self::$table_prefix . $tableName . " (\r\r\n\t\t\t\t\t\t\t  id int(9) NOT NULL AUTO_INCREMENT,\r\r\n\t\t\t\t\t\t\t  name VARCHAR(191) NOT NULL,\r\r\n\t\t\t\t\t\t\t  handle VARCHAR(191) NOT NULL,\r\r\n\t\t\t\t\t\t\t  css MEDIUMTEXT NOT NULL,\r\r\n\t\t\t\t\t\t\t  markup MEDIUMTEXT NOT NULL,\r\r\n\t\t\t\t\t\t\t  settings MEDIUMTEXT NULL,\r\r\n\t\t\t\t\t\t\t  UNIQUE KEY id (id)\r\r\n\t\t\t\t\t\t\t);";
             break;
         default:
             RevSliderFunctions::throwError("table: {$tableName} not found");
             break;
     }
     require_once ABSPATH . 'wp-admin/includes/upgrade.php';
     dbDelta($sql);
     if ($parseCssToDb) {
         $RevSliderOperations = new RevSliderOperations();
         $RevSliderOperations->importCaptionsCssContentArray();
         $RevSliderOperations->moveOldCaptionsCss();
     }
 }
开发者ID:vicpril,项目名称:rep_bidqa,代码行数:61,代码来源:revslider-front.class.php

示例7: putCreativeLayer


//.........这里部分代码省略.........
                             $urlOgv = '';
                         }
                         $add_data .= $v_controls ? ' data-videocontrols="none"' : ' data-videocontrols="controls"';
                         $add_data .= ' data-videowidth="' . $videoWidth . '" data-videoheight="' . $videoHeight . '"';
                         if (is_ssl()) {
                             $urlPoster = str_replace("http://", "https://", $urlPoster);
                         }
                         if (!empty($urlPoster)) {
                             $add_data .= ' data-videoposter="' . $urlPoster . '"';
                         }
                         if (!empty($urlOgv)) {
                             $add_data .= ' data-videoogv="' . $urlOgv . '"';
                         }
                         if (!empty($urlWebm)) {
                             $add_data .= ' data-videowebm="' . $urlWebm . '"';
                         }
                         if (!empty($urlMp4)) {
                             $add_data .= ' data-videomp4="' . $urlMp4 . '"';
                         }
                         if (!empty($urlPoster)) {
                             if ($only_poster_on_mobile === true) {
                                 //$add_data .= ' data-posterOnMobile="on"';
                                 $add_data .= ' data-noposteronmobile="on"';
                             } else {
                                 //$add_data .= ' data-posterOnMobile="off"';
                                 $add_data .= ' data-noposteronmobile="off"';
                             }
                         }
                         if (!empty($videopreload)) {
                             $add_data .= ' data-videopreload="' . $videopreload . '"';
                         }
                         break;
                     default:
                         RevSliderFunctions::throwError("wrong video type: {$videoType}");
                         break;
                 }
                 if (RevSliderFunctions::strToBool($videoloop) == true) {
                     //fallback
                     $add_data .= ' data-videoloop="loop"';
                 } else {
                     $add_data .= ' data-videoloop="' . $videoloop . '"';
                 }
                 if ($cover == true) {
                     $dotted = RevSliderFunctions::getVal($videoData, "dotted");
                     if ($dotted !== 'none') {
                         $add_data .= ' data-dottedoverlay="' . $dotted . '"';
                     }
                     $add_data .= ' data-forceCover="1"';
                     $ratio = RevSliderFunctions::getVal($videoData, "ratio");
                     if (!empty($ratio)) {
                         $add_data .= ' data-aspectratio="' . $ratio . '"';
                     }
                 }
                 $videoAutoplay = false;
                 if (array_key_exists("autoplayonlyfirsttime", $videoData)) {
                     $autoplayonlyfirsttime = RevSliderFunctions::strToBool(RevSliderFunctions::getVal($videoData, "autoplayonlyfirsttime"));
                     if ($autoplayonlyfirsttime == true) {
                         $videoAutoplay = '1sttime';
                     }
                 }
                 if ($videoAutoplay == false) {
                     if (array_key_exists("autoplay", $videoData)) {
                         $videoAutoplay = RevSliderFunctions::getVal($videoData, "autoplay");
                     } else {
                         //backword compatability
                         $videoAutoplay = RevSliderFunctions::getVal($layer, "video_autoplay");
开发者ID:surreal8,项目名称:wptheme,代码行数:67,代码来源:output.class.php

示例8: getCatAndTaxData

 /**
  * 
  * get cats and taxanomies data from the category id's
  */
 public static function getCatAndTaxData($catIDs)
 {
     if (is_string($catIDs)) {
         $catIDs = trim($catIDs);
         if (empty($catIDs)) {
             return array("tax" => "", "cats" => "");
         }
         $catIDs = explode(",", $catIDs);
     }
     $strCats = "";
     $arrTax = array();
     foreach ($catIDs as $cat) {
         if (strpos($cat, "option_disabled") === 0) {
             continue;
         }
         $pos = strrpos($cat, "_");
         if ($pos === false) {
             RevSliderFunctions::throwError("The category is in wrong format");
         }
         $taxName = substr($cat, 0, $pos);
         $catID = substr($cat, $pos + 1, strlen($cat) - $pos - 1);
         $arrTax[$taxName] = $taxName;
         if (!empty($strCats)) {
             $strCats .= ",";
         }
         $strCats .= $catID;
     }
     $strTax = "";
     foreach ($arrTax as $taxName) {
         if (!empty($strTax)) {
             $strTax .= ",";
         }
         $strTax .= $taxName;
     }
     $output = array("tax" => $strTax, "cats" => $strCats);
     return $output;
 }
开发者ID:iq007,项目名称:MadScape,代码行数:41,代码来源:functions-wordpress.class.php

示例9: RevSliderOperations

<?php

if (!defined('ABSPATH')) {
    exit;
}
$operations = new RevSliderOperations();
$sliderID = self::getGetVar("id");
if (empty($sliderID)) {
    RevSliderFunctions::throwError("Slider ID not found");
}
$slider = new RevSlider();
$slider->initByID($sliderID);
$sliderParams = $slider->getParams();
$arrSliders = $slider->getArrSlidersShort($sliderID);
$selectSliders = RevSliderFunctions::getHTMLSelect($arrSliders, "", "id='selectSliders'", true);
$numSliders = count($arrSliders);
//set iframe parameters
$width = $sliderParams["width"];
$height = $sliderParams["height"];
$iframeWidth = $width + 60;
$iframeHeight = $height + 50;
$iframeStyle = "width:" . $iframeWidth . "px;height:" . $iframeHeight . "px;";
if ($slider->isSlidesFromPosts()) {
    $arrSlides = $slider->getSlidesFromPosts(false);
} elseif ($slider->isSlidesFromStream()) {
    $arrSlides = $slider->getSlidesFromStream(false);
} else {
    $arrSlides = $slider->getSlides(false);
}
$numSlides = count($arrSlides);
$linksSliderSettings = self::getViewUrl(RevSliderAdmin::VIEW_SLIDER, 'id=' . $sliderID);
开发者ID:vicpril,项目名称:rep_bidqa,代码行数:31,代码来源:slide-overview.php

示例10: trimArrayItems

 /**
  * do "trim" operation on all array items.
  */
 public static function trimArrayItems($arr)
 {
     if (gettype($arr) != "array") {
         RevSliderFunctions::throwError("trimArrayItems error: The type must be array");
     }
     foreach ($arr as $key => $item) {
         if (is_array($item)) {
             foreach ($item as $key => $value) {
                 $arr[$key][$key] = trim($value);
             }
         } else {
             $arr[$key] = trim($item);
         }
     }
     return $arr;
 }
开发者ID:LuisEnVilla,项目名称:viajes400,代码行数:19,代码来源:functions.class.php

示例11: getWPQuery

 /**
  * 
  * get meta query
  */
 public static function getWPQuery($filterType, $sortBy)
 {
     $response = array();
     $dayMs = 60 * 60 * 24;
     $time = current_time('timestamp');
     $todayStart = strtotime(date('Y-m-d', $time));
     $todayEnd = $todayStart + $dayMs - 1;
     $tomorrowStart = $todayEnd + 1;
     $tomorrowEnd = $tomorrowStart + $dayMs - 1;
     $start_month = strtotime(date('Y-m-1', $time));
     $end_month = strtotime(date('Y-m-t', $time)) + 86399;
     $next_month_middle = strtotime('+1 month', $time);
     //get the end of this month + 1 day
     $start_next_month = strtotime(date('Y-m-1', $next_month_middle));
     $end_next_month = strtotime(date('Y-m-t', $next_month_middle)) + 86399;
     $query = array();
     switch ($filterType) {
         case self::DEFAULT_FILTER:
             //none
             break;
         case "today":
             $query[] = array('key' => '_start_ts', 'value' => $todayEnd, 'compare' => '<=');
             $query[] = array('key' => '_end_ts', 'value' => $todayStart, 'compare' => '>=');
             break;
         case "future":
             $query[] = array('key' => '_start_ts', 'value' => $time, 'compare' => '>');
             break;
         case "tomorrow":
             $query[] = array('key' => '_start_ts', 'value' => $tomorrowEnd, 'compare' => '<=');
             $query[] = array('key' => '_end_ts', 'value' => $todayStart, 'compare' => '>=');
             break;
         case "past":
             $query[] = array('key' => '_end_ts', 'value' => $todayStart, 'compare' => '<');
             break;
         case "month":
             $query[] = array('key' => '_start_ts', 'value' => $end_month, 'compare' => '<=');
             $query[] = array('key' => '_end_ts', 'value' => $start_month, 'compare' => '>=');
             break;
         case "nextmonth":
             $query[] = array('key' => '_start_ts', 'value' => $end_next_month, 'compare' => '<=');
             $query[] = array('key' => '_end_ts', 'value' => $start_next_month, 'compare' => '>=');
             break;
         default:
             RevSliderFunctions::throwError("Wrong event filter");
             break;
     }
     if (!empty($query)) {
         $response["meta_query"] = $query;
     }
     //convert sortby
     switch ($sortBy) {
         case "event_start_date":
             $response["orderby"] = "meta_value_num";
             $response["meta_key"] = "_start_ts";
             break;
         case "event_end_date":
             $response["orderby"] = "meta_value_num";
             $response["meta_key"] = "_end_ts";
             break;
     }
     return $response;
 }
开发者ID:vicpril,项目名称:rep_bidqa,代码行数:66,代码来源:em-integration.class.php

示例12: getSlidesFromStream


//.........这里部分代码省略.........
             $arrPosts = $twitter->get_public_photos($this->getParam('twitter-user-id'), $this->getParam('twitter-include-retweets'), $this->getParam('twitter-exclude-replies'), $this->getParam('twitter-count'), $this->getParam('twitter-image-only'));
             $max_posts = $this->getParam('twitter-count', '500', self::FORCE_NUMERIC);
             $max_allowed = 500;
             $additions['twitter_user'] = $this->getParam('twitter-user-id');
             break;
         case "instagram":
             $instagram = new RevSliderInstagram($this->getParam('instagram-access-token'), $this->getParam('instagram-transient', '1200'));
             $search_user_id = $this->getParam('instagram-user-id');
             $arrPosts = $instagram->get_public_photos($search_user_id, $this->getParam('instagram-count'));
             $max_posts = $this->getParam('instagram-count', '33', self::FORCE_NUMERIC);
             $max_allowed = 33;
             break;
         case "flickr":
             $flickr = new RevSliderFlickr($this->getParam('flickr-api-key'), $this->getParam('flickr-transient', '1200'));
             switch ($this->getParam('flickr-type')) {
                 case 'publicphotos':
                     $user_id = $flickr->get_user_from_url($this->getParam('flickr-user-url'));
                     $arrPosts = $flickr->get_public_photos($user_id, $this->getParam('flickr-count'));
                     break;
                 case 'gallery':
                     $gallery_id = $flickr->get_gallery_from_url($this->getParam('flickr-gallery-url'));
                     $arrPosts = $flickr->get_gallery_photos($gallery_id, $this->getParam('flickr-count'));
                     break;
                 case 'group':
                     $group_id = $flickr->get_group_from_url($this->getParam('flickr-group-url'));
                     $arrPosts = $flickr->get_group_photos($group_id, $this->getParam('flickr-count'));
                     break;
                 case 'photosets':
                     $arrPosts = $flickr->get_photo_set_photos($this->getParam('flickr-photoset'), $this->getParam('flickr-count'));
                     break;
             }
             $max_posts = $this->getParam('flickr-count', '99', self::FORCE_NUMERIC);
             break;
         case 'youtube':
             $channel_id = $this->getParam('youtube-channel-id');
             $youtube = new RevSliderYoutube($this->getParam('youtube-api'), $channel_id, $this->getParam('youtube-transient', '1200'));
             if ($this->getParam('youtube-type-source') == "playlist") {
                 $arrPosts = $youtube->show_playlist_videos($this->getParam('youtube-playlist'), $this->getParam('youtube-count'));
             } else {
                 $arrPosts = $youtube->show_channel_videos($this->getParam('youtube-count'));
             }
             $additions['yt_type'] = $this->getParam('youtube-type-source', 'channel');
             $max_posts = $this->getParam('youtube-count', '25', self::FORCE_NUMERIC);
             $max_allowed = 50;
             break;
         case 'vimeo':
             $vimeo = new RevSliderVimeo($this->getParam('vimeo-transient', '1200'));
             $vimeo_type = $this->getParam('vimeo-type-source');
             switch ($vimeo_type) {
                 case 'user':
                     $arrPosts = $vimeo->get_vimeo_videos($vimeo_type, $this->getParam('vimeo-username'));
                     break;
                 case 'channel':
                     $arrPosts = $vimeo->get_vimeo_videos($vimeo_type, $this->getParam('vimeo-channelname'));
                     break;
                 case 'group':
                     $arrPosts = $vimeo->get_vimeo_videos($vimeo_type, $this->getParam('vimeo-groupname'));
                     break;
                 case 'album':
                     $arrPosts = $vimeo->get_vimeo_videos($vimeo_type, $this->getParam('vimeo-albumid'));
                     break;
                 default:
                     break;
             }
             $additions['vim_type'] = $this->getParam('vimeo-type-source', 'user');
             $max_posts = $this->getParam('vimeo-count', '25', self::FORCE_NUMERIC);
             $max_allowed = 60;
             break;
         default:
             RevSliderFunctions::throwError("getSlidesFromStream error: This source type must be from stream.");
             break;
     }
     if ($max_posts < 0) {
         $max_posts *= -1;
     }
     $arrPosts = apply_filters('revslider_pre_mod_stream_data', $arrPosts, $sourceType, $this->id);
     while (count($arrPosts) > $max_posts || count($arrPosts) > $max_allowed) {
         array_pop($arrPosts);
     }
     $arrPosts = apply_filters('revslider_post_mod_stream_data', $arrPosts, $sourceType, $this->id);
     $arrSlides = array();
     $templateKey = 0;
     $numTemplates = count($slideTemplates);
     if (empty($arrPosts)) {
         RevSliderFunctions::throwError(__('Failed to load Stream', REVSLIDER_TEXTDOMAIN));
     }
     foreach ($arrPosts as $postData) {
         $slideTemplate = $slideTemplates[$templateKey];
         //advance the templates
         $templateKey++;
         if ($templateKey == $numTemplates) {
             $templateKey = 0;
         }
         $slide = new RevSlide();
         $slide->initByStreamData($postData, $slideTemplate, $this->id, $sourceType, $additions);
         $arrSlides[] = $slide;
     }
     $this->arrSlides = $arrSlides;
     return $arrSlides;
 }
开发者ID:VLabsInc,项目名称:WordPressPlatforms,代码行数:101,代码来源:slider.class.php

示例13: getSettings

 /**
  * 
  * get settings object
  */
 protected static function getSettings($key)
 {
     if (!isset(self::$arrSettings[$key])) {
         RevSliderFunctions::throwError("Settings {$key} not found");
     }
     $settings = self::$arrSettings[$key];
     return $settings;
 }
开发者ID:SayenkoDesign,项目名称:ividf,代码行数:12,代码来源:base-admin.class.php

示例14: isDBTableExists

 public static function isDBTableExists($tableName)
 {
     global $wpdb;
     if (empty($tableName)) {
         RevSliderFunctions::throwError("Empty table name!!!");
     }
     $sql = "show tables like '{$tableName}'";
     $table = $wpdb->get_var($sql);
     if ($table == $tableName) {
         return true;
     }
     return false;
 }
开发者ID:khiconit,项目名称:Device-manager,代码行数:13,代码来源:database.class.php

示例15: checkPurchaseVerification

 public function checkPurchaseVerification($data)
 {
     global $wp_version;
     $response = wp_remote_post('http://updates.themepunch.tools/activate.php', array('user-agent' => 'WordPress/' . $wp_version . '; ' . get_bloginfo('url'), 'body' => array('code' => urlencode($data['code']), 'version' => urlencode(RevSliderGlobals::SLIDER_REVISION), 'product' => urlencode('revslider'))));
     $response_code = wp_remote_retrieve_response_code($response);
     $version_info = wp_remote_retrieve_body($response);
     if ($response_code != 200 || is_wp_error($version_info)) {
         return false;
     }
     if ($version_info == 'valid') {
         update_option('revslider-valid', 'true');
         update_option('revslider-code', $data['code']);
         //update_option('revslider-email', $data['email']);
         update_option('revslider-temp-active-notice', 'false');
         return true;
     } elseif ($version_info == 'exist') {
         RevSliderFunctions::throwError(__('Purchase Code already registered!', 'revslider'));
     } elseif ($version_info == 'temp_valid') {
         //only temporary active, rechecking needs to be done soon on the themepunch servers (envato API may be down)
         update_option('revslider-valid', 'true');
         update_option('revslider-code', $data['code']);
         //update_option('revslider-email', $data['email']);
         update_option('revslider-temp-active', 'true');
         update_option('revslider-temp-active-notice', 'false');
         return 'temp';
     } else {
         return false;
     }
     /*elseif($version_info == 'bad_email'){
     			return 'bad_email';
     		}elseif($version_info == 'email_used'){
     			return 'email_used';
     		}*/
 }
开发者ID:hugocica,项目名称:locomotiva-2016,代码行数:34,代码来源:operations.class.php


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