$Isvideo = 0; $getimagesrc = $this->cdnurl . "/images/uploads/finaoimages/" . $allimages['uploadfile_name']; if (isset($getimagesdetails) && count($getimagesdetails) >= 1) { foreach ($getimagesdetails as $imgvalues) { if ($imgvalues["uploadfile_id"] == $allimages["uploaddetail_id"]) { $resizeWidth = $imgvalues["resizeWidth"]; $resizeHeight = $imgvalues["resizeHeight"]; } } } } else { $getimagesrc = ""; if ($allimages["videoid"] != "") { $Isvideo = 1; //532, 305 $videocode = FinaoController::getviddlembedCode($allimages["videoid"], 560, 360); } elseif ($allimages["video_embedurl"] != "") { $Isvideo = 1; $videocode = $allimages["video_embedurl"]; } } //} } } if ($resizeWidth != 0 && $resizeHeight != 0) { $style = 'width="' . $resizeWidth . '" height="' . $resizeHeight . '"'; } else { $style = ""; } ?>
public function actionBrowseVideoImage() { $uploadtype = isset($_REQUEST['imgvid']) ? $_REQUEST['imgvid'] : ""; if ($uploadtype != "") { $page = isset($_REQUEST['pageid']) ? $_REQUEST['pageid'] : 1; $targetdiv = $_REQUEST['targetdiv']; $limit = 1; $uptypeid = Lookups::model()->findByAttributes(array('lookup_type' => 'uploadtype', 'lookup_name' => $uploadtype)); $criteria = new CDbCriteria(); $criteria->condition = " explore_finao = 1 and uploadtype = " . $uptypeid->lookup_id; $criteria->order = "updateddate desc"; $uploadImages = Uploaddetails::model()->findAll($criteria); $upPageNav = FinaoController::getpagedetails($uploadImages, 1, $page, 1); //$criteria->limit = $upPageNav["limittxt"]; //$lim = FinaoController::getpagecount(count($uploadImages),$limit,$page); //print_r($upPageNav);exit; $criteria->limit = $upPageNav['limittxt']; $criteria->offset = $upPageNav['offset']; $uploadImages = Uploaddetails::model()->findAll($criteria); $videoembedurl = ""; $caption = ""; $userimg = ""; if (isset($uploadImages) && $uploadImages != "" && count($uploadImages) >= 1) { foreach ($uploadImages as $vidup) { if ($uploadtype == 'Video') { if ($vidup->videoid != "" && $vidup->videostatus == 'ready') { $videoembedurl = FinaoController::getviddlembedCode($vidup->videoid); } elseif ($vidup->video_embedurl != "") { $videoembedurl = $vidup->video_embedurl; } } elseif ($uploadtype == 'Image') { $filename = $vidup->uploadfile_path . "/" . $vidup->uploadfile_name; if (file_exists(Yii::app()->basePath . "/../" . $filename)) { $videoembedurl = Yii::app()->baseUrl . $filename; } } $caption = $vidup->caption; $userimg = User::model()->findByPk($vidup->uploadedby); } } $this->renderPartial('_browserImagVideo', array('videoembedurl' => $videoembedurl, 'uploadtype' => $uploadtype, 'upPageNav' => $upPageNav, 'caption' => $caption, 'targetdiv' => $targetdiv, 'userinfo' => $userimg)); } }