Jump to content

Need help with this code


afaaro

Recommended Posts

Hi everyone, this is my first topic I really need help if someone can give me a solution.

 

In my database; am using 2 provider which is  Youtube and Blip

 

Example I want to make if the file is youtube it should play youtube and when is blip it should play blip. How can i do it. These are the database and code

 

".$db_prefix."video_config (
				  `key` varchar(255) collate latin1_general_ci NOT NULL,
				  `value` text collate latin1_general_ci NOT NULL,
				  UNIQUE KEY `key` (`key`)
				) TYPE=MyISAM;";


"".$db_prefix."video_config (`key`, `value`) VALUES 
				('thumbnail', 'http://i.ytimg.com/vi/{{VIDEOID}}/default.jpg'),
				('width', '425'),
				('height', '355'),
				('code', '<object width=\"{{W}}\" height=\"{{H}}\"><param name=\"movie\" value=\"http://www.youtube.com/v/{{VIDEOID}}\"></param><param name=\"wmode\" value=\"transparent\"></param><embed src=\"http://www.youtube.com/v/{{VIDEOID}}\" type=\"application/x-shockwave-flash\" wmode=\"transparent\" width=\"{{W}}\" height=\"{{H}}\"></embed></object>'),
				('blipv', '<embed src=\"http://a.blip.tv/scripts/flash/showplayer.swf?file=http://blip.tv/rss/flash/{{VIDEOID}}\" type=\"application/x-shockwave-flash\" width=\"{{W}}\" height=\"{{H}}\" allowscriptaccess=\"always\" allowfullscreen=\"true\"></embed>')";


 

 


			$patterns = array('{{W}}','{{H}}','{{VIDEOID}}');
			$replaces = array($width,$height,$videoid);
			$player = str_replace($patterns,$replaces,outCode($config['code']));

			$thumbnail = str_replace("{{VIDEOID}}",$videoid,outCode($config['thumbnail']));
			$thumbnail = "<img src='$thumbnail' border='0' width='41' height='34' alt='' align='left' class='box' style='margin:3px 6px 0 2px;' />";

 

This one [ outCode($config['code']) ] is just youutbe  and I need to use this one as well  [outCode($config['blipv']) ]

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.