Ismet posted on May 16, 2010 05:55

If you are using Biz Modules Ultra Video Gallery module to display Youtube videos under your DotNetNuke portal, you will most likely have issues with added videos. They no longer displayed correctly within your system right?
Then make sure to use following code from Host > SQL.
Note: You better create a database backup first.
declare @itemid int
declare @videopath nvarchar(200)
DECLARE mycursor CURSOR FOR
select ItemId,VideoPath from {databaseOwner}{objectQualifier}UVG_Video where charindex('.youtube.', lower(VideoPath)) > 1 order by itemid
OPEN mycursor
FETCH NEXT FROM mycursor INTO @itemid, @videopath
WHILE @@FETCH_STATUS = 0
BEGIN
declare @videoId nvarchar(11)
declare @embedcode nvarchar(2000)
select @videoid=substring(@videopath, charindex('?v=',@videopath)+3, 11)
select @embedcode ='<div><object width="425" height="355"><param name="movie" value="http://www.youtube.com/v/' + @videoid +'" /><param name="wmode" value="transparent" /><param name="flashVars" value="autoplay=1" /><embed src="http://www.youtube.com/v/' + @videoid +'" type="application/x-shockwave-flash" width="425" height="355" wmode="transparent" flashVars="autoplay=1"></embed></object></div>'
update {databaseOwner}{objectQualifier}UVG_Video set VideoPath = null, EmbedCode = @embedcode where ItemId = @ItemId
PRINT cast(@ItemId as varchar(10)) + ' - ' + @videoid + ' - ' + @embedcode
FETCH NEXT FROM mycursor INTO @itemid, @videopath
END
CLOSE mycursor
DEALLOCATE mycursor