[support] Change all embedded youtube links in database to &fs=0

Jamie Holly hovercrafter at earthlink.net
Mon May 14 16:58:13 UTC 2012


It depends on how you are storing them. If they are embedded directly in 
the node body, then not without a custom module. If they are in a field, 
where just the link is stored, you can do something like this:

UPDATE {table} SET {field_name} = concat ({field_name}, '?fs=1') 
{optional where clause such as WHERE {fieldname} LIKE '%youtube.com%'

For the body method you would actually have to do a custom module using 
a regular expression to search and replace for the URL, since all 
YouTube urls end with the video ID (or query params). The problem there 
is that MySQL doesn't support regular expression search and replace, 
just plain text with the REPLACE() function.

Jamie Holly
http://www.intoxination.net
http://www.hollyit.net


On 5/14/2012 11:00 AM, Jessica Hannan - Halo Digital Design wrote:
> I have almost 200 embedded you tube videos on a site that the client would now like to change to not be resizable. I know there must be a way to do this within the database (find and replace?) but I'm not sure how. I can do it in Wordpress, so it must be doable in Drupal!
>
> Thanks for you help!
>
> Jessica Hannan
> 815-545-5541
> http://www.HaloDigitalDesign.com
> Join us on Facebook!!
> http://www.facebook.com/halodigitaldesign
>
>
>
>
>


More information about the support mailing list