Allowing Only "Embed" For Videos - Your Solution

There have been several people asking about allowing *only* the embed option for videos.

I *thought* the answer had been provided, but the code that was given didn't work correctly - in that it broke the other uploads. (Sounds, photos, files)

I have come up with a quick and dirty solution to fix all of the problems. I know there are better ways of doing this, but it's beyond me at this point so I will show everyone what *I* did to get it working.

If someone else wants to provide a better way, please do. I'm only posting this because nobody else has answered all of the issues to date.

So without further adieu......

 

HERE IS HOW TO MAKE VIDEOS EMBED ONLY - WITHOUT CHANGING ANY UPLOAD FUNCTIONS FOR OTHER FILE TYPES

 

 

ALWAYS --> MAKE A BACKUP OF ANY FILES YOU ARE GOING TO EDIT!!!

HOW TO REMOVE ALL OPTIONS FOR VIDEOS EXCEPT EMBEDDING - AND THEN ONLY FOR VIDEOS


1a. OPEN THE FILE "/modules/boonex/videos/classes/BxVideosConfig.php"

2a. Find the block of code listed below.....

 

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

if(!defined("YOUTUBE_VIDEO_RSS"))

define("YOUTUBE_VIDEO_RSS", "http://gdata.youtube.com/feeds/api/videos?q=#video#");

if(!defined("YOUTUBE_VIDEO_PLAYER"))

define("YOUTUBE_VIDEO_PLAYER", '<object width="100%" height="344" style="display:block;"><param name="movie" value="http://www.youtube.com/v/#video#&rel=0&color1=0xb1b1b1&color2=0xcfcfcf&feature=player_embedded&fs=1&autoplay=#autoplay#&iv_load_policy=3&showinfo=0"></param><param name="allowFullScreen" value="true"></param><param name="wmode" value="#wmode#"></param><embed src="http://www.youtube.com/v/#video#&rel=0&color1=0xb1b1b1&color2=0xcfcfcf&feature=player_embedded&fs=1&autoplay=#autoplay#&iv_load_policy=3&showinfo=0" type="application/x-shockwave-flash" allowfullscreen="true" width="100%" height="344" wmode="#wmode#"></embed></object>');

if(!defined("YOUTUBE_VIDEO_EMBED"))

define("YOUTUBE_VIDEO_EMBED", '<object width="425" height="344" style="display:block;"><param name="movie" value="http://www.youtube.com/v/#video#&rel=0&color1=0xb1b1b1&color2=0xcfcfcf&feature=player_embedded&fs=1&autoplay=#autoplay#"></param><param name="allowFullScreen" value="true"></param><param name="wmode" value="#wmode#"></param><embed src="http://www.youtube.com/v/#video#&rel=0&color1=0xb1b1b1&color2=0xcfcfcf&feature=player_embedded&fs=1&autoplay=#autoplay#" type="application/x-shockwave-flash" allowfullscreen="true" width="425" height="344" wmode="#wmode#"></embed></object>');

}

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

 

3a. IMMEDIATELY AFTER THE LAST SEMI-COLON ADD THE FOLLOWING CODE

 

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

function getUploaderSwitcher ($sLink = '') {

return array(

_t('_' . $this->sPrefix . '_embed') => array('active' => $_REQUEST['mode'] == 'embed' ? true : false, 'href' => $sLink . "&mode=embed"),

);

}

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

 

4a. UPLOAD THE NOW EDITED FILE TO THE DIRECTORY YOU GOT IT FROM

 

 


1b. Download a copy of the "/inc/classes/BxDolFilesUploader.php" file to your desktop

2b. INSIDE OF THE FILE YOU JUST DOWNLOADED - FIND THE CODE SHOWN BELOW

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

$sForm = $this->getMultiUploadFormFile();

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

 

 

3b. NOW REPLACE THE CODE SHOWN ABOVE - WITH THE CODE BELOW

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

//$sForm = $this->getMultiUploadFormFile();

$sForm = $this->getEmbedFormFile();

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

 

4b. RENAME THIS FILE "BxDolFilesUploaderVideos.php"

5b. UPLOAD YOUR NEWLY CREATED & EDITED FILE TO THE "inc/classes/" DIRECTORY


1c. NOW OPEN FILE "/modules/boonex/videos/classes/BxVideosUploader.php"

2c. FIND THE LINE OF CODE SHOWN BELOW - IT IS NEAR THE TOP OF THE PAGE - ONLY REPLACE THE FIRST INSTANCE OF THIS CODE

bx_import('BxDolFilesUploader');

3c. REPLACE THIS LINE WITH:

//-- bx_import('BxDolFilesUploader');

bx_import('BxDolFilesUploaderVideos');

4c. UPLOAD THE NOW EDITED FILE TO THE SAME DIRECTORY YOU GOT IT FROM

 


 

 

FINALLY ~

Check your site & discover the true joy that is waiting for you in the videos area.

Now check the other areas. Notice anything?

All of the options are still present! Coolness, huh? : )

Thanks to LeonoidS & kevenmitnick for providing parts of this solution!

~ PC

Quote · 7 Feb 2010

If a premium member wants to add this to the marketplace for free, it would be a nice thing to do.  ; )

Quote · 8 Feb 2010

Did this. Checked others and no changes! Good work... awesome finisher, PC! Thank you!

Quote · 8 Feb 2010

I have to admit, you did a good job on this.  It's been posted in the Market, with full credit to you (along with a link to your profile and suggestions that they give points for it there.) 

 

 

http://www.boonex.com/unity/extensions/entry/Video_Embed_Only_for_D7_0

 

I think you might be able to post this in the Market as a free item, not sure.  But you should check on it and if you can then I'll delete the one I put up or as soon as you do become a Premium Member let me know and I'll take this down so you can post it and get the credit you deserve.

 

Again, great job on it.

Quote · 8 Feb 2010

Quote · 8 Feb 2010

Does this give you the (admin) Option of selecting to embed videos only or is it a permanent embed video solution only?

Nice bit of coding and all the best to MD for putting up on your behalf.

Stuart

There are none so blind as those that will not see.
Quote · 8 Feb 2010

Unfortunately it is a permanent feature at this point. If someone wants to take it to the next level and make it changeable via the admin that would be even better.

Then it would really be a community provided mod! : )

 

@MyDatery - I couldn't reply here for a while so I posted my appreciation below the mod listing in the Market. Thanks again for posting that.
It won't let me post any mods - free or not. I just need to come up with the moola and get me one of them spiffy licenses methinks! LOL

TYPO NOTE: The instructions indicate that the the first part of the code provided should be placed after the last "semi-colon". This is a typo. It should say to put it after the last "curly bracket".

I've been under the weather so please forgive the mistake.

 

Quote · 8 Feb 2010

Hello everyone!


Now it can be regulated from admin panel, see this mod http://www.boonex.com/unity/extensions/entry/Uploader_switcher_2010_03_05. It is free and i'll be glad for your attempts to apply it.

Regard

Quote · 5 Mar 2010

Awesome - THANK YOU!!!!

Quote · 5 Mar 2010

lol this suck because if you allow memebers to upload videos from youtube

youtube is going to make more money because all the videos have the stupid adversiting on the videos so for me this is suck

Post Reply - if you going to help - No for - bla bla bla bla
Quote · 6 Mar 2010

Hello, I just came across this post and I must say Thanks!

 

Anyway, I have run into a problem.  All options are still available in the dropdown even though embed is the only thing allowed to do.  Anybody have a solution for this?

 

I'm on 7.0.6

 

Thanks

Quote · 22 Sep 2011
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.