NETWORKSTIP Networking CCNA,Centos,Ubuntu,Sql,

Made By Muhammad Nafees

Breaking

Thursday, 7 December 2017

How To Automatically Add Modesbranding to YouTube Embedded Videos in Clip-Bucket v2.6

1. Open ./plugins/embed_video_mod/embed_video_mod.php
2. Find


return $val;
 
 and before that line, insert

   /*******************************/
   /*START of modestbranding=1 MOD*/
   /*******************************/
   
   //Add ?modestbranding=1 always by default to YouTube Embedded Videos
   if(stristr($val,'youtube') !== FALSE && stristr($val,'modestbranding=1') === FALSE) {   
    $mb = "?modestbranding=1";
    $ytidlength = 11; //Length of YT Video IDs   
    
    //If code is an iframe
    if(stristr($val,'<iframe') !== FALSE) {
     //src="http://www.youtube.com/embed/ (34 chars)
     $start = strpos($val,'src="http://www.youtube.com/embed/"'); //Position where src starts
     $val = substr_replace($val, $mb, $start+34+$ytidlength, 0);
    }
      
    //If it is the old YT embed code
    if(stristr($val,'<embed') !== FALSE || stristr($val,'<object') !== FALSE) {
     //value="http://www.youtube.com/v/ (32 chars)    
     $start = strpos($val,'value="http://www.youtube.com/v/'); //Position where value starts
     $val = substr_replace($val, $mb, $start+32+$ytidlength, 0);
     //src="http://www.youtube.com/v/ (30 chars)    
     $start = strpos($val,'src="http://www.youtube.com/v/'); //Position where src starts
     $val = substr_replace($val, $mb, $start+30+$ytidlength, 0);
    }
   }
   
   /*****************************/
   /*END of modestbranding=1 MOD*/
   /*****************************/
 
3. Save & Upload 

No comments:

Post a Comment