/**
  * 
  * init slide by db record
  */
 public function initByData($record)
 {
     $this->slideType = self::TYPE_GALLERY;
     $this->id = $record["id"];
     $this->sliderID = $record["slider_id"];
     $this->slideOrder = $record["slide_order"];
     $params = $record["params"];
     $params = (array) json_decode($params);
     //make the excerpt
     $title = UniteFunctionsBiz::getVal($params, "title");
     $text = UniteFunctionsBiz::getVal($params, "slide_text");
     $intro = UniteFunctionsWPBiz::getIntroFromContent($text);
     $slider = new ShowBizSlider();
     $slider->initByID($this->sliderID);
     $delimiter = $slider->getParam("word_end", ' ');
     if ($delimiter == '') {
         $delimiter = ' ';
     }
     $limit_type = $slider->getParam("limit_by_type", 'words');
     if (strlen($intro) == strlen($text)) {
         $customLimit = UniteFunctionsBiz::getVal($params, "showbiz_excerpt_limit");
         $customLimit = (int) $customLimit;
         if (!empty($customLimit)) {
             $excerpt_limit = $customLimit;
         } else {
             $excerpt_limit = $slider->getParam("excerpt_limit", 55, ShowBizSlider::VALIDATE_NUMERIC);
             $excerpt_limit = (int) $excerpt_limit;
         }
         $textForExcerpt = strip_tags($text, "<b><br><br/><i><small>");
         if ($limit_type == 'words') {
             $intro = UniteFunctionsBiz::getTextIntro($textForExcerpt, $excerpt_limit, $delimiter);
         } else {
             $intro = UniteFunctionsBiz::getTextIntroChar($textForExcerpt, $excerpt_limit);
         }
     }
     $title_limit = $slider->getParam("title_limit", 99, ShowBizSlider::VALIDATE_NUMERIC);
     $titleForExcerpt = strip_tags($title, "<b><br><br/><i><small>");
     if ($limit_type == 'words') {
         $params["title"] = UniteFunctionsBiz::getTextIntro($titleForExcerpt, $title_limit, $delimiter);
     } else {
         $params["title"] = UniteFunctionsBiz::getTextIntroChar($titleForExcerpt, $title_limit);
     }
     $params["orig_title"] = $title;
     $params["excerpt"] = $intro;
     //Lazy Load Settings
     $params["lazy_load"] = $slider->getParam("enable_lazy_load", 'off');
     $params["lazy_load_height"] = $slider->getParam("lazy_load_height", 100, ShowBizSlider::VALIDATE_NUMERIC);
     $params["lazy_load_image"] = $slider->getParam("lazy_load_image", '');
     $urlImage = UniteFunctionsBiz::getVal($params, "slide_image");
     $img_size = $slider->getParam("img_source_type", 'full');
     if ($img_size == 'custom') {
         $img_size_height = $slider->getParam("img_source_type_height", 0, ShowBizSlider::VALIDATE_NUMERIC);
         $img_size_width = $slider->getParam("img_source_type_width", 0, ShowBizSlider::VALIDATE_NUMERIC);
         if ($img_size_height > 0 && $img_size_width > 0) {
             $img_size = array($img_size_width, $img_size_height);
         } else {
             $img_size = 'full';
         }
     }
     $ratio = $slider->getParam("img_ratio", 'none');
     $refresh = $slider->getParam("refresh_images", 'false');
     $this->initImageParams($urlImage, $img_size, $ratio, $refresh);
     $this->params = $params;
     //dmp($this->params);exit();
 }