Advanced Video Embed installation manual

1. Copy "modules" folder to root directory of your Dolphin script.

2. Install "Advanced Video Embed" module from Dolphin administration -> Tools -> Modules -> Not Installed modules

3. Register at embed.ly, grab API Key and save it at your site administration->Settings->Advanced Settings->General->Embed.ly API key for Advanced Embed

4. Edit the following files (relative to root directory of your Dolphin script):

a. modules/boonex/videos/classes/BxVideosTemplate.php:
Find getFileConcept function and insert the following code:
//Rayz Advanced Video Embed begin
if($aExtra["source"] != "youtube")
$sPlayer = BxDolService::call('embed', 'get_embed_code', array($aExtra["source"], $aExtra["ext"]), 'Module');
else {
$sPlayer = str_replace("#video#", $aExtra['ext'], YOUTUBE_VIDEO_PLAYER);
$sPlayer = str_replace("#wmode#", getWMode(), $sPlayer);
$sPlayer = str_replace("#autoplay#", (getSettingValue("video", "autoPlay") == TRUE_VAL ? "1" : "0"), $sPlayer);
}
//Rayz Advanced Video Embed end

instead of:
$sPlayer = str_replace("#video#", $aExtra['ext'], YOUTUBE_VIDEO_PLAYER);
$sPlayer = str_replace("#wmode#", getWMode(), $sPlayer);
$sPlayer = str_replace("#autoplay#", (getSettingValue("video", "autoPlay") == TRUE_VAL ? "1" : "0"), $sPlayer);


Find getEmbedCode function and insert the following code:
//Rayz Advanced Video Embed begin
$sEmbedCode = BxDolService::call('embed', 'get_embed_code', array($aExtra["source"], $aExtra["video"], true), 'Module');
//Rayz Advanced Video Embed end

instead of:
$sEmbedCode = video_getCustomEmbedCode($aExtra["source"], $aExtra["video"]);

b) modules/boonex/videos/classes/BxVideosUploader.php:
Find getEmbedFormFile function and insert the following code:
//Rayz Advanced Video Embed begin
$sResult = $this->getLoadingCode() . BxDolService::call('embed', 'get_embed_form', array($this->sWorkingFile, $this->_sJsPostObject, $this->_aExtras), 'Module');
if(!empty($sResult))
return $sResult;
//Rayz Advanced Video Embed end

just before:
return $this->_getEmbedFormFile();

Find serviceAcceptEmbedFile function and insert the following code:
//Rayz Advanced Video Embed begin
list($sVideoId, $sTitle, $sDesc, $sTags, $sImage, $iDuration) = BxDolService::call('embed', 'get_embed_data', array($_POST['embed']), 'Module');
//Rayz Advanced Video Embed end

just after:
$sErrorReturn = '<script type="text/javascript">parent.' . $this->_sJsPostObject . '.showErrorMsg("video_embed_failed_message");parent.' . $this->_sJsPostObject . '.resetEmbed();</script>';
And remove or comment out all the following code to:
if(empty($sTitle)) return $sErrorReturn;
(excluding)

c) modules/boonex/videos/classes/BxVideosSearch.php:
Find serviceProfileVideoBlock function and insert the following code:
//Rayz Advanced Video Embed begin
'video' => $this->oTemplate->getFileConcept($aFile['id'], ($aFile['source'] != '' ? array('source' => $aFile['source'], 'ext' => $aFile['video']) : array())),
//Rayz Advanced Video Embed end

instead of:
'video' => $this->oTemplate->getFileConcept($aFile['id'], ($aFile['source'] == 'youtube' ? array('ext' => $aFile['video']) : array())),

d) modules/boonex/videos/js/upload.js (Dolphin 7.1.X):
Find the following code:
if($('#video_upload_form').attr("name") == 'embed')
return;

and remove it or comment out

e) flash/modules/video/inc/functions.inc.php:
Find embedVideo function and insert the following code:
//Rayz Advanced Video Embed begin
$sSource = "youtube";
if(is_integer(strpos($sVideoId, " ")))
list($sSource, $sVideoId) = explode(" ", $sVideoId, 2);
getResult("INSERT INTO `" . $sDBModule . "Files` SET `Date`='" . time() . "', `Owner`='" . $sUserId . "', `Status`='" . $sStatus . "', `Source`='" . $sSource . "', `Video`='" . $sVideoId . "', `Time`='" . ($iDuration * 1000) . "'");
//Rayz Advanced Video Embed end

just instead of:
getResult("INSERT INTO `" . $sDBModule . "Files` SET `Date`='" . time() . "', `Owner`='" . $sUserId . "', `Status`='" . $sStatus . "', `Source`='youtube', `Video`='" . $sVideoId . "', `Time`='" . ($iDuration * 1000) . "'");



-------------------------------------------------------------------------------


Get many surprises wit the first one just after subscribing to my newsletter. It is devoted to news about new Dolphin releases, my products, discounts, bug-fixes, information about promo and wholesale actions and other useful tips. It will be issued about weekly.
Name:
Email: