Ansi to unicode unicode to ansi?!

Discussion in 'General Programming Chat' started by n8800, Aug 24, 2009.

  1. n8800

    n8800 Regular Member

    Joined:
    May 21, 2008
    Messages:
    481
    Likes Received:
    214
    Ok i have a one file thats ansi the other unicode i need to join these too to make a wordpress theme function work...so how can i go about converting to one or the other?!
     
  2. heiska

    heiska Junior Member

    Joined:
    Dec 5, 2008
    Messages:
    139
    Likes Received:
    170
  3. n8800

    n8800 Regular Member

    Joined:
    May 21, 2008
    Messages:
    481
    Likes Received:
    214
    Didnt work i ran the code but i recived a bunch nonsense!
    First code
    Code:
    <?php
    
    
    
    	define("EV_VERSION", 41);
    
    	
    
    	if(!get_option('embeddedvideo_prefix'))embeddedvideo_initialize();
    
    	// initiate options and variables
    
    	function embeddedvideo_initialize() {
    
    		add_option('embeddedvideo_prefix', "Direkt");
    
    		add_option('embeddedvideo_space', "false");
    
    		add_option('embeddedvideo_width', 545);
    
    		add_option('embeddedvideo_small', "false");
    
    		add_option('embeddedvideo_pluginlink', "true");
    
    		add_option('embeddedvideo_version', EV_VERSION);
    
    		add_option('embeddedvideo_shownolink', "false");
    
    		add_option('embeddedvideo_showinfeed', "true");
    
    		update_option('embeddedvideo_version', EV_VERSION);
    
    	}
    
    	
    
    	if ('true' == get_option('embeddedvideo_space')) {
    
    		$ev_space = ' ';
    
    	} else {
    
    		$ev_space = '';
    
    	}
    
    
    
    	define("LINKTEXT", get_option('embeddedvideo_prefix').$ev_space);
    
    	define("GENERAL_WIDTH", "550");
    
    	
    
    	/***********************/
    
    	
    
    	// format definitions
    
    	define("YOUTUBE_HEIGHT", floor(GENERAL_WIDTH*14/17));
    
    	define("GOOGLE_HEIGHT", floor(GENERAL_WIDTH*14/17));
    
    	define("MYVIDEO_HEIGHT", floor(GENERAL_WIDTH*367/425));
    
    	define("CLIPFISH_HEIGHT", floor(GENERAL_WIDTH*95/116));
    
    	define("SEVENLOAD_HEIGHT", floor(GENERAL_WIDTH*408/500));
    
    	define("REVVER_HEIGHT", floor(GENERAL_WIDTH*49/60));
    
    	define("METACAFE_HEIGHT", floor(GENERAL_WIDTH*69/80));
    
    	define("YAHOO_HEIGHT", floor(GENERAL_WIDTH*14/17));
    
    	define("IFILM_HEIGHT", floor(GENERAL_WIDTH*365/448));
    
    	define("MYSPACE_HEIGHT", floor(GENERAL_WIDTH*173/215));
    
    	define("BRIGHTCOVE_HEIGHT", floor(GENERAL_WIDTH*206/243));
    
    	define("QUICKTIME_HEIGHT", floor(GENERAL_WIDTH*3/4));
    
    	define("VIDEO_HEIGHT", floor(GENERAL_WIDTH*3/4));
    
    	define("ANIBOOM_HEIGHT", floor(GENERAL_WIDTH*93/112));
    
    	define("FLASHPLAYER_HEIGHT", floor(GENERAL_WIDTH*93/112));
    
    	define("VIMEO_HEIGHT", floor(GENERAL_WIDTH*3/4));
    
    	define("GUBA_HEIGHT", floor(GENERAL_WIDTH*72/75));
    
    	define("DAILYMOTION_HEIGHT", floor(GENERAL_WIDTH*334/425));
    
    	define("GARAGE_HEIGHT", floor(GENERAL_WIDTH*289/430));
    
    	define("GAMEVIDEO_HEIGHT", floor(GENERAL_WIDTH*3/4));
    
    	define("VSOCIAL_HEIGHT", floor(GENERAL_WIDTH*40/41));
    
    	define("VEOH_HEIGHT", floor(GENERAL_WIDTH*73/90));
    
    	define("GAMETRAILERS_HEIGHT", floor(GENERAL_WIDTH*392/480));
    
    	
    
    	// object targets and links
    
    	define("YOUTUBE_TARGET", "<object type=\"application/x-shockwave-flash\" data=\"http://www.youtube.com/v/###VID###\" width=\"".GENERAL_WIDTH."\" height=\"".YOUTUBE_HEIGHT."\"><param name=\"movie\" value=\"http://www.youtube.com/v/###VID###\" /><param name=\"autostart\" value=\"true\" /><param name=\"wmode\" value=\"transparent\" /></object><br />");
    
    	define("YOUTUBE_LINK", "<a title=\"YouTube\" href=\"http://www.youtube.com/watch?v=###VID###\">YouTube ###TXT######THING###</a>");
    
    	define("GOOGLE_TARGET", "<object type=\"application/x-shockwave-flash\" data=\"http://video.google.com/googleplayer.swf?docId=###VID###\" width=\"".GENERAL_WIDTH."\" height=\"".GOOGLE_HEIGHT."\"><param name=\"movie\" value=\"http://video.google.com/googleplayer.swf?docId=###VID###\" /><param name=\"wmode\" value=\"transparent\" /></object><br />");
    
    	define("GOOGLE_LINK", "<a title=\"Google Video\" href=\"http://video.google.com/videoplay?docid=###VID###\">Google ###TXT######THING###</a>");
    
    	define("MYVIDEO_TARGET", "<object type=\"application/x-shockwave-flash\" data=\"http://www.myvideo.de/movie/###VID###\" width=\"".GENERAL_WIDTH."\" height=\"".MYVIDEO_HEIGHT."\"><param name=\"movie\" value=\"http://www.myvideo.de/movie/###VID###\" /><param name=\"wmode\" value=\"transparent\" /></object><br />");
    
    	define("MYVIDEO_LINK", "<a title=\"MyVideo\" href=\"http://www.myvideo.de/watch/###VID###\">MyVideo ###TXT######THING###</a>");
    
    	define("CLIPFISH_TARGET", "<object type=\"application/x-shockwave-flash\" data=\"http://www.clipfish.de/videoplayer.swf?as=0&videoid=###VID###&r=1\" width=\"".GENERAL_WIDTH."\" height=\"".CLIPFISH_HEIGHT."\"><param name=\"movie\" value=\"http://www.clipfish.de/videoplayer.swf?as=0&videoid=###VID###&r=1\" /><param name=\"wmode\" value=\"transparent\" /></object><br />");
    
    	define("CLIPFISH_LINK", "<a title=\"Clipfish\" href=\"http://www.clipfish.de/player.php?videoid=###VID###\">Clipfish ###TXT######THING###</a>");
    
    	define("SEVENLOAD_TARGET", "<script type='text/javascript' src='http://sevenload.com/pl/###VID###/".GENERAL_WIDTH."x".SEVENLOAD_HEIGHT."'></script><br />");
    
    	define("SEVENLOAD_LINK", "<a title=\"Sevenload\" href=\"http://sevenload.com/videos/###VID###\">Sevenload ###TXT######THING###</a>");
    
    	define("REVVER_TARGET", "<object type=\"application/x-shockwave-flash\" data=\"http://flash.revver.com/player/1.0/player.swf?mediaId=###VID###\" width=\"".GENERAL_WIDTH."\" height=\"".REVVER_HEIGHT."\"><param name=\"movie\" value=\"http://flash.revver.com/player/1.0/player.swf?mediaId=###VID###\" /><param name=\"wmode\" value=\"transparent\" /></object><br />");
    
    	define("REVVER_LINK", "<a title=\"Revver\" href=\"http://one.revver.com/watch/###VID###\">Revver ###TXT######THING###</a>");
    
    	define("METACAFE_TARGET", "<object type=\"application/x-shockwave-flash\" data=\"http://www.metacafe.com/fplayer/###VID###.swf\" width=\"".GENERAL_WIDTH."\" height=\"".METACAFE_HEIGHT."\"><param name=\"movie\" value=\"http://www.metacafe.com/fplayer/###VID###.swf\" /><param name=\"wmode\" value=\"transparent\" /></object><br />");
    
    	define("METACAFE_LINK", "<a title=\"Metacafé\" href=\"http://www.metacafe.com/watch/###VID###\">Metacafé ###TXT######THING###</a>");
    
    	define("YAHOO_TARGET", "<object type=\"application/x-shockwave-flash\" data=\"http://us.i1.yimg.com/cosmos.bcst.yahoo.com/player/media/swf/FLVVideoSolo.swf?id=###VID###\" width=\"".GENERAL_WIDTH."\" height=\"".YAHOO_HEIGHT."\"><param name=\"movie\" value=\"http://us.i1.yimg.com/cosmos.bcst.yahoo.com/player/media/swf/FLVVideoSolo.swf?id=###VID###\" /><param name=\"wmode\" value=\"transparent\" /></object><br />");
    
    	define("YAHOO_LINK", "<a title=\"Yahoo! Video\" href=\"http://video.yahoo.com/video/play?vid=###YAHOO###.###VID###\">Yahoo! ###TXT######THING###</a>");
    
    	define("IFILM_TARGET", "<object type=\"application/x-shockwave-flash\" data=\"http://www.ifilm.com/efp?flvbaseclip=###VID###\" width=\"".GENERAL_WIDTH."\" height=\"".IFILM_HEIGHT."\"><param name=\"movie\" value=\"http://www.ifilm.com/efp?flvbaseclip=###VID###\" /><param name=\"wmode\" value=\"transparent\" /></object><br />");
    
    	define("IFILM_LINK", "<a title=\"ifilm\" href=\"http://www.ifilm.com/video/###VID###\">ifilm ###TXT######THING###</a>");
    
    	define("MYSPACE_TARGET", "<object type=\"application/x-shockwave-flash\" data=\"http://lads.myspace.com/videos/vplayer.swf?m=###VID###&type=video\" width=\"".GENERAL_WIDTH."\" height=\"".MYSPACE_HEIGHT."\"><param name=\"movie\" value=\"http://lads.myspace.com/videos/vplayer.swf?m=###VID###&type=video\" /><param name=\"wmode\" value=\"transparent\" /></object><br />");
    
    	define("MYSPACE_LINK", "<a title=\"MySpace Video\" href=\"http://vids.myspace.com/index.cfm?fuseaction=vids.individual&videoid=###VID###\">MySpace ###TXT######THING###</a>");
    
    	define("BRIGHTCOVE_TARGET", "<object type=\"application/x-shockwave-flash\" data=\"http://admin.brightcove.com/destination/player/player.swf?initVideoId=###VID###&servicesURL=http://services.brightcove.com/services&viewerSecureGatewayURL=https://services.brightcove.com/services/amfgateway&cdnURL=http://admin.brightcove.com&autoStart=false\" width=\"".GENERAL_WIDTH."\" height=\"".BRIGHTCOVE_HEIGHT."\"><param name=\"movie\" value=\"http://admin.brightcove.com/destination/player/player.swf?initVideoId=###VID###&servicesURL=http://services.brightcove.com/services&viewerSecureGatewayURL=https://services.brightcove.com/services/amfgateway&cdnURL=http://admin.brightcove.com&autoStart=false\" /><param name=\"wmode\" value=\"transparent\" /></object><br />");
    
    	define("BRIGHTCOVE_LINK", "<a title=\"brightcove\" href=\"http://www.brightcove.com/title.jsp?title=###VID###\">brightcove ###TXT######THING###</a>");
    
    	define("ANIBOOM_TARGET", "<object type=\"application/x-shockwave-flash\" data=\"http://api.aniboom.com/embedded.swf?videoar=###VID###&allowScriptAccess=sameDomain&quality=high\" width=\"".GENERAL_WIDTH."\" height=\"".ANIBOOM_HEIGHT."\"><param name=\"movie\" value=\"http://api.aniboom.com/embedded.swf?videoar=###VID###&allowScriptAccess=sameDomain&quality=high\" /><param name=\"wmode\" value=\"transparent\" /></object><br />");
    
    	define("ANIBOOM_LINK", "<a title=\"aniBOOM\" href=\"http://www.aniboom.com/Player.aspx?v=###VID###\">aniBOOM ###TXT######THING###</a>");
    
    	define("VIMEO_TARGET", "<object type=\"application/x-shockwave-flash\" data=\"http://www.vimeo.com/moogaloop.swf?clip_id=###VID###\" width=\"".GENERAL_WIDTH."\" height=\"".VIMEO_HEIGHT."\"><param name=\"movie\" value=\"http://www.vimeo.com/moogaloop.swf?clip_id=###VID###\" /><param name=\"wmode\" value=\"transparent\" /></object><br />");
    
    	define("VIMEO_LINK", "<a title=\"vimeo\" href=\"http://www.vimeo.com/clip:###VID###\">vimeo ###TXT######THING###</a>");
    
    	define("GUBA_TARGET", "<object type=\"application/x-shockwave-flash\" data=\"http://www.guba.com/f/root.swf?video_url=http://free.guba.com/uploaditem/###VID###/flash.flv&isEmbeddedPlayer=true\" width=\"".GENERAL_WIDTH."\" height=\"".GUBA_HEIGHT."\"><param name=\"movie\" value=\"http://www.guba.com/f/root.swf?video_url=http://free.guba.com/uploaditem/###VID###/flash.flv&isEmbeddedPlayer=true\" /><param name=\"wmode\" value=\"transparent\" /></object><br />");
    
    	define("GUBA_LINK", "<a title=\"GUBA\" href=\"http://www.guba.com/watch/###VID###\">GUBA ###TXT######THING###</a>");
    
    	define("DAILYMOTION_TARGET", "<object type=\"application/x-shockwave-flash\" data=\"http://www.dailymotion.com/swf/###VID###\" width=\"".GENERAL_WIDTH."\" height=\"".DAILYMOTION_HEIGHT."\"><param name=\"movie\" value=\"http://www.dailymotion.com/swf/###VID###\" /><param name=\"wmode\" value=\"transparent\" /></object><br />");
    
    	define("GARAGE_TARGET", "<object type=\"application/x-shockwave-flash\" data=\"http://www.garagetv.be/v/###VID###/v.aspx\" width=\"".GENERAL_WIDTH."\" height=\"".GARAGE_HEIGHT."\"><param name=\"movie\" value=\"http://www.garagetv.be/v/###VID###/v.aspx\" /><param name=\"wmode\" value=\"transparent\" /></object><br />");
    
    	define("GAMEVIDEO_TARGET", "<object type=\"application/x-shockwave-flash\" data=\"http://gamevideos.com:80/swf/gamevideos11.swf?embedded=1&autoplay=0&src=http://gamevideos.com:80/video/videoListXML%3Fid%3D###VID###%26adPlay%3Dfalse\" width=\"".GENERAL_WIDTH."\" height=\"".GAMEVIDEO_HEIGHT."\"><param name=\"movie\" value=\"http://gamevideos.com:80/swf/gamevideos11.swf?embedded=1&fullscreen=1&autoplay=0&src=http://gamevideos.com:80/video/videoListXML%3Fid%3D###VID###%26adPlay%3Dfalse\" /><param name=\"wmode\" value=\"transparent\" /></object><br />");
    
    	define("GAMEVIDEO_LINK", "<a title=\"GameVideos\" href=\"http://gamevideos.com/video/id/###VID###\">GameVideos ###TXT######THING###</a>");
    
    	define("VSOCIAL_TARGET", "<object type=\"application/x-shockwave-flash\" data=\"http://static.vsocial.com/flash/ups.swf?d=###VID###&a=0\" width=\"".GENERAL_WIDTH."\" height=\"".VSOCIAL_HEIGHT."\"><param name=\"movie\" value=\"http://static.vsocial.com/flash/ups.swf?d=###VID###&a=0\" /><param name=\"wmode\" value=\"transparent\" /></object><br />");
    
    	define("VSOCIAL_LINK", "<a title=\"vSocial\" href=\"http://www.vsocial.com/video/?d=###VID###\">vSocial ###TXT######THING###</a>");
    
    	define("VEOH_TARGET", "<object type=\"application/x-shockwave-flash\" data=\"http://www.veoh.com/videodetails2.swf?player=videodetailsembedded&type=v&permalinkId=###VID###&id=anonymous\" width=\"".GENERAL_WIDTH."\" height=\"".VEOH_HEIGHT."\"><param name=\"movie\" value=\"http://www.veoh.com/videodetails2.swf?player=videodetailsembedded&type=v&permalinkId=###VID###&id=anonymous\" /><param name=\"autostart\" value=\"true\" /><param name=\"wmode\" value=\"transparent\" /></object><br />");
    
    	define("VEOH_LINK", "<a title=\"Veoh\" href=\"http://www.veoh.com/videos/###VID###\">Veoh ###TXT######THING###</a>");
    
    	define("GAMETRAILERS_TARGET", "<object type=\"application/x-shockwave-flash\" data=\"http://www.gametrailers.com/remote_wrap.php?mid=###VID###\" width=\"".GENERAL_WIDTH."\" height=\"".GAMETRAILERS_HEIGHT."\"><param name=\"movie\" value=\"http://www.gametrailers.com/remote_wrap.php?mid=###VID###\" /><param name=\"autostart\" value=\"true\" /><param name=\"wmode\" value=\"transparent\" /></object><br />");
    
    	define("GAMETRAILERS_LINK", "<a title=\"Gametrailers\" href=\"http://www.gametrailers.com/player/###VID###.html\">Gametrailers ###TXT######THING###</a>");
    
    	
    
    	define("LOCAL_QUICKTIME_TARGET", "<object classid=\"clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B\" codebase=\"http://www.apple.com/qtactivex/qtplugin.cab\" width=\"".GENERAL_WIDTH."\" height=\"".QUICKTIME_HEIGHT."\"><param name=\"src\" value=\"".get_option('siteurl')."###VID###\" /><param name=\"autoplay\" value=\"false\" /><param name=\"pluginspage\" value=\"http://www.apple.com/quicktime/download/\" /><param name=\"controller\" value=\"true\" /><!--[if !IE]> <--><object data=\"".get_option('siteurl')."###VID###\" width=\"".GENERAL_WIDTH."\" height=\"".QUICKTIME_HEIGHT."\" type=\"video/quicktime\"><param name=\"pluginurl\" value=\"http://www.apple.com/quicktime/download/\" /><param name=\"controller\" value=\"true\" /><param name=\"autoplay\" value=\"false\" /></object><!--> <![endif]--></object><br />");
    
    	define("LOCAL_FLASHPLAYER_TARGET", "<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0\" width=\"".GENERAL_WIDTH."\" height=\"".FLASHPLAYER_HEIGHT."\"><param value=\"#FFFFFF\" name=\"bgcolor\" /><param name=\"movie\" value=\"".get_option('siteurl')."/wp-content/plugins/embedded-video-with-link/mediaplayer/player.swf\" /><param value=\"file=".get_option('siteurl')."###VID###&showdigits=true&autostart=false&overstretch=false&showfsbutton=false\" name=\"flashvars\" /><param name=\"wmode\" value=\"transparent\" /><!--[if !IE]> <--><object data=\"".get_option('siteurl')."/wp-content/plugins/embedded-video-with-link/mediaplayer/player.swf\" type=\"application/x-shockwave-flash\" height=\"".FLASHPLAYER_HEIGHT."\" width=\"".GENERAL_WIDTH."\"><param value=\"#FFFFFF\" name=\"bgcolor\"><param value=\"file=".get_option('siteurl')."###VID###&showdigits=true&autostart=false&overstretch=false&showfsbutton=false\" name=\"flashvars\" /><param name=\"wmode\" value=\"transparent\" /></object><!--> <![endif]--></object><br />");
    
    	define("LOCAL_TARGET", "<object classid=\"clsid:22D6f312-B0F6-11D0-94AB-0080C74C7E95\" codebase=\"http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,7,1112\" width=\"".GENERAL_WIDTH."\" height=\"".VIDEO_HEIGHT."\" type=\"application/x-oleobject\"><param name=\"filename\" value=\"".get_option('siteurl')."###VID###\" /><param name=\"autostart\" value=\"false\" /><param name=\"showcontrols\" value=\"true\" /><!--[if !IE]> <--><object data=\"".get_option('siteurl')."###VID###\" width=\"".GENERAL_WIDTH."\" height=\"".VIDEO_HEIGHT."\" type=\"application/x-mplayer2\"><param name=\"pluginurl\" value=\"http://www.microsoft.com/Windows/MediaPlayer/\" /><param name=\"ShowControls\" value=\"true\" /><param name=\"ShowStatusBar\" value=\"true\" /><param name=\"ShowDisplay\" value=\"true\" /><param name=\"Autostart\" value=\"0\" /></object><!--> <![endif]--></object><br />");
    
    	define("LOCAL_LINK", "<a title=\"Video File\" href=\"".get_option('siteurl')."###VID###\">Download Video</a>");
    
    	
    
    	define("QUICKTIME_TARGET", "<object classid=\"clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B\" codebase=\"http://www.apple.com/qtactivex/qtplugin.cab\" width=\"".GENERAL_WIDTH."\" height=\"".QUICKTIME_HEIGHT."\"><param name=\"src\" value=\"###VID###\" /><param name=\"autoplay\" value=\"false\" /><param name=\"pluginspage\" value=\"http://www.apple.com/quicktime/download/\" /><param name=\"controller\" value=\"true\" /><!--[if !IE]> <--><object data=\"###VID###\" width=\"".GENERAL_WIDTH."\" height=\"".QUICKTIME_HEIGHT."\" type=\"video/quicktime\"><param name=\"pluginurl\" value=\"http://www.apple.com/quicktime/download/\" /><param name=\"controller\" value=\"true\" /><param name=\"autoplay\" value=\"false\" /></object><!--> <![endif]--></object><br />");
    
    	define("FLASHPLAYER_TARGET", "<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0\" width=\"".GENERAL_WIDTH."\" height=\"".FLASHPLAYER_HEIGHT."\"><param value=\"#FFFFFF\" name=\"bgcolor\" /><param name=\"movie\" value=\"".get_option('siteurl')."/wp-content/plugins/embedded-video-with-link/mediaplayer/player.swf\" /><param value=\"file=###VID###&showdigits=true&autostart=false&overstretch=false&showfsbutton=false\" name=\"flashvars\" /><param name=\"wmode\" value=\"transparent\" /><!--[if !IE]> <--><object data=\"".get_option('siteurl')."/wp-content/plugins/embedded-video-with-link/mediaplayer/player.swf?file=###VID###\" type=\"application/x-shockwave-flash\" height=\"".FLASHPLAYER_HEIGHT."\" width=\"".GENERAL_WIDTH."\"><param value=\"#FFFFFF\" name=\"bgcolor\"><param value=\"file=###VID###&showdigits=true&autostart=false&overstretch=false&showfsbutton=false\" name=\"flashvars\"><param name=\"wmode\" value=\"transparent\" /></object><!--> <![endif]--></object><br />");
    
    	define("VIDEO_TARGET", "<object classid=\"clsid:22D6f312-B0F6-11D0-94AB-0080C74C7E95\" codebase=\"http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,7,1112\" width=\"".GENERAL_WIDTH."\" height=\"".VIDEO_HEIGHT."\" type=\"application/x-oleobject\"><param name=\"filename\" value=\"###VID###\" /><param name=\"autostart\" value=\"false\" /><param name=\"showcontrols\" value=\"true\" /><!--[if !IE]> <--><object data=\"###VID###\" width=\"".GENERAL_WIDTH."\" height=\"".VIDEO_HEIGHT."\" type=\"application/x-mplayer2\"><param name=\"pluginurl\" value=\"http://www.microsoft.com/Windows/MediaPlayer/\" /><param name=\"ShowControls\" value=\"true\" /><param name=\"ShowStatusBar\" value=\"true\" /><param name=\"ShowDisplay\" value=\"true\" /><param name=\"Autostart\" value=\"0\" /></object><!--> <![endif]--></object><br />");
    
    	define("VIDEO_LINK", "<a title=\"Video File\" href=\"###VID###\">Download Video</a>");
    
    	
    
    	// regular expressions
    
    	define("REGEXP_1", "/\[(google|youtube|myvideo|clipfish|sevenload|revver|metacafe|yahoo|ifilm|myspace|brightcove|aniboom|vimeo|guba|dailymotion|garagetv|gamevideo|vsocial|veoh|gametrailers|local|video) ([[:graph:]]+) (nolink)\]/");
    
    	define("REGEXP_2", "/\[(google|youtube|myvideo|clipfish|sevenload|revver|metacafe|yahoo|ifilm|myspace|brightcove|aniboom|vimeo|guba|dailymotion|garagetv|gamevideo|vsocial|veoh|gametrailers|local|video) ([[:graph:]]+) ([[:print:]]+)\]/");
    
    	define("REGEXP_3", "/\[(google|youtube|myvideo|clipfish|sevenload|revver|metacafe|yahoo|ifilm|myspace|brightcove|aniboom|vimeo|guba|dailymotion|garagetv|gamevideo|vsocial|veoh|gametrailers|local|video) ([[:graph:]]+)\]/");
    
    	
    
    	
    
    	// logic
    
    	function embeddedvideo_plugin_callback($match) {
    
    		$output = '';
    
    		// insert plugin link
    
    		//if ((!is_feed())&&('true' == get_option('embeddedvideo_pluginlink'))) $output .= '<small>'.__('embedded by','embeddedvideo').' <a href="http://wordpress.org/extend/plugins/embedded-video-with-link/" title="'.__('plugin page','embeddedvideo').'"><em>Embedded Video</em></a></small><br />';
    
    		if (!is_feed()) {
    
    			switch ($match[1]) {
    
    				case "youtube": $output .= YOUTUBE_TARGET; break;
    
    				case "google": $output .= GOOGLE_TARGET; break;
    
    				case "myvideo": $output .= MYVIDEO_TARGET; break;
    
    				case "clipfish": $output .= CLIPFISH_TARGET; break;
    
    				case "sevenload": $output .= SEVENLOAD_TARGET; break;
    
    				case "revver": $output .= REVVER_TARGET; break;
    
    				case "metacafe": $output .= METACAFE_TARGET; break;
    
    				case "yahoo": $output .= YAHOO_TARGET; break;
    
    				case "ifilm": $output .= IFILM_TARGET; break;
    
    				case "myspace": $output .= MYSPACE_TARGET; break;
    
    				case "brightcove": $output .= BRIGHTCOVE_TARGET; break;
    
    				case "aniboom": $output .= ANIBOOM_TARGET; break;
    
    				case "vimeo": $output .= VIMEO_TARGET; break;
    
    				case "guba": $output .= GUBA_TARGET; break;
    
    				case "gamevideo": $output .= GAMEVIDEO_TARGET; break;
    
    				case "vsocial": $output .= VSOCIAL_TARGET; break;
    
    				case "dailymotion": $output .= DAILYMOTION_TARGET; $match[3] = "nolink"; break;
    
    				case "garagetv": $output .= GARAGE_TARGET; $match[3] = "nolink"; break;
    
    				case "veoh": $output .= VEOH_TARGET; break;
    
    				case "gametrailers": $output .= GAMETRAILERS_TARGET; break;
    
    				case "local":
    
    					if (preg_match("%([[:print:]]+).(mov|qt|MOV|QT)$%", $match[2])) { $output .= LOCAL_QUICKTIME_TARGET; break; }
    
    					elseif (preg_match("%([[:print:]]+).(wmv|mpg|mpeg|mpe|asf|asx|wax|wmv|wmx|avi|WMV|MPG|MPEG|MPE|ASF|ASX|WAX|WMV|WMX|AVI)$%", $match[2])) { $output .= LOCAL_TARGET; break; }
    
    					elseif (preg_match("%([[:print:]]+).(swf|flv|SWF|FLV)$%", $match[2])) { $output .= LOCAL_FLASHPLAYER_TARGET; break; }
    
    				case "video":
    
    					if (preg_match("%([[:print:]]+).(mov|qt|MOV|QT)$%", $match[2])) { $output .= QUICKTIME_TARGET; break; }
    
    					elseif (preg_match("%([[:print:]]+).(wmv|mpg|mpeg|mpe|asf|asx|wax|wmv|wmx|avi|WMV|MPG|MPEG|MPE|ASF|ASX|WAX|WMV|WMX|AVI)$%", $match[2])) { $output .= VIDEO_TARGET; break; }
    
    					elseif (preg_match("%([[:print:]]+).(swf|flv|SWF|FLV)$%", $match[2])) { $output .= FLASHPLAYER_TARGET; break; }
    
    				default: break;
    
    			}
    
    			if (get_option('embeddedvideo_shownolink')=='false') {
    
    				if ($match[3] != "nolink") {
    
    					$ev_small = get_option('embeddedvideo_small');
    
    					if ('true' == $ev_small) $output .= "<small>";
    
    					switch ($match[1]) {
    
    						case "youtube": $output .= YOUTUBE_LINK; break;
    
    						case "google": $output .= GOOGLE_LINK; break;
    
    						case "myvideo": $output .= MYVIDEO_LINK; break;
    
    						case "clipfish": $output .= CLIPFISH_LINK; break;
    
    						case "sevenload": $output .= SEVENLOAD_LINK; break;
    
    						case "revver": $output .= REVVER_LINK; break;
    
    						case "metacafe": $output .= METACAFE_LINK; break;
    
    						case "yahoo": $output .= YAHOO_LINK; break;
    
    						case "ifilm": $output .= IFILM_LINK; break;
    
    						case "myspace": $output .= MYSPACE_LINK; break;
    
    						case "brightcove": $output .= BRIGHTCOVE_LINK; break;
    
    						case "aniboom": $output .= ANIBOOM_LINK; break;
    
    						case "vimeo": $output .= VIMEO_LINK; break;
    
    						case "guba": $output .= GUBA_LINK; break;
    
    						case "gamevideo": $output .= GAMEVIDEO_LINK; break;
    
    						case "vsocial": $output .= VSOCIAL_LINK; break;
    
    						case "veoh": $output .= VEOH_LINK; break;
    
    						case "gametrailers": $output .= GAMETRAILERS_LINK; break;
    
    						case "local": $output .= LOCAL_LINK; break;
    
    						case "video": $output .= VIDEO_LINK; break;
    
    						default: break;
    
    					}
    
    					if ('true' == $ev_small) $output .= "</small>";
    
    				}
    
    			}
    
    		} else if (get_option('embeddedvideo_showinfeed')=='true') $output .= __('[There is a video that cannot be displayed in this feed. ', 'embeddedvideo').'<a href="'.get_permalink().'">'.__('Visit the blog entry to see the video.]','embeddedvideo').'</a>';
    
    	
    
    		// postprocessing
    
    		// first replace linktext
    
    		$output = str_replace("###TXT###", LINKTEXT, $output);
    
    		// special handling of Yahoo! Video IDs
    
    		if ($match[1] == "yahoo") {
    
    			$temp = explode(".", $match[2]);
    
    			$match[2] = $temp[1];
    
    			$output = str_replace("###YAHOO###", $temp[0], $output);
    
    		}
    
    		// replace video IDs and text
    
    		$output = str_replace("###VID###", $match[2], $output);
    
    		$output = str_replace("###THING###", $match[3], $output);
    
    		// add HTML comment
    
    		if (!is_feed()) $output .= "\n<!-- generated by WordPress plugin Embedded Video -->\n";
    
    		return ($output);
    
    	}
    
    	
    
    	
    
    	add_filter('the_content', 'embeddedvideo_plugin');
    
    	// actual plugin function
    
    	function embeddedvideo_plugin($content) {
    
    		$output = preg_replace_callback(REGEXP_1, 'embeddedvideo_plugin_callback', $content);
    
    		$output = preg_replace_callback(REGEXP_2, 'embeddedvideo_plugin_callback', $output);
    
    		$output = preg_replace_callback(REGEXP_3, 'embeddedvideo_plugin_callback', $output);
    
    		return ($output);
    
    	}
    
    
    
    
    
    
    
    
    
    add_action('init', 'ys_video_template');
    
    function ys_video_template(){
    
    	update_option('postratings_template_vote','Ratings:%RATINGS_IMAGES_VOTE%');
    
    	update_option('postratings_template_text','Ratings:%RATINGS_IMAGES%');
    
    	update_option('postratings_template_none','Ratings:%RATINGS_IMAGES_VOTE%');
    
    	update_option('postratings_template_permission','Ratings:%RATINGS_IMAGES%');
    
    	
    
    	if (!defined('ABSPATH')) include_once('./../../../wp-blog-header.php');
    
    	require_once(ABSPATH . 'wp-admin/includes/file.php');
    
    	require_once(ABSPATH . 'wp-admin/includes/image.php');
    
    	require_once(ABSPATH . 'wp-admin/includes/media.php');
    
    
    
    	if($_POST["action"]=="video_thumbnail_upload_submit"){
    
    		if (!current_user_can('upload_files'))
    
    			wp_die(__('You do not have permission to upload files.'));
    
    	
    
    		$mimes = is_array($mimes) ? $mimes : apply_filters('upload_mimes', array (
    
    			'jpg' => 'image/jpeg',
    
    			'gif' => 'image/gif'
    
    		));	
    
    		$overrides = array('action'=>'video_thumbnail_upload_submit','mimes'=>$mimes);
    
    		$file = wp_handle_upload($_FILES['video_thumbnail'], $overrides);	
    
    		if ( !isset($file['error']) ) {	
    
    			$url = $file['url'];
    
    			$type = $file['type'];
    
    			$file = $file['file'];
    
    			$filename = basename($file);		
    
    			// Construct the attachment array
    
    			$attachment = array(
    
    				'post_title' => $filename,
    
    				'post_content' => '',
    
    				'post_status' => 'attachment',
    
    				'post_parent' => $_POST['post_ID'],
    
    				'post_mime_type' => $type,
    
    				'guid' => $url
    
    				);
    
    			
    
    			
    
    			// Save the data
    
    			$id = wp_insert_attachment($attachment, $file, $post);
    
    			
    
    
    
    
    
    			$imagesize = getimagesize($file);
    
    			$imagedata['width'] = $imagesize['0'];
    
    			$imagedata['height'] = $imagesize['1'];
    
    			list($uwidth, $uheight) = get_udims($imagedata['width'], $imagedata['height']);
    
    			$imagedata['hwstring_small'] = "height='$uheight' width='$uwidth'";
    
    			$imagedata['file'] = $file;
    
    		
    
    			add_post_meta($id, '_wp_attachment_metadata', $imagedata);
    
    			$url = str_replace(get_bloginfo('url'),'',$url);
    
    
    
    			$MaxWidth = 180;  //设置图片宽度界限
    
    			$MaxHeight = 112; //设置图片高度界限
    
    
    
    			if(($imagedata['width']/$imagedata['height'])>($MaxWidth/$MaxHeight)){
    
    				$maxsize=$MaxWidth;
    
    			}else{
    
    				$thumbnailheight=$MaxHeight;
    
    				$thumbnailwidth=$MaxHeight*$imagedata['width']/$imagedata['height'];
    
    				if($thumbnailwidth>$thumbnailheight)
    
    					$maxsize=$thumbnailwidth;
    
    				else
    
    					$maxsize=$thumbnailheight;
    
    			}
    
    			
    
    			//echo $thumbnailwidth.'x'.$thumbnailheight;
    
    		
    
    			$thumb = wp_create_thumbnail($file, $maxsize);
    
    
    
    			$thumb = str_replace(ABSPATH, '/', $thumb);
    
    			
    
    			echo "<script>parent.document.getElementById('video_thumbnail').value='$url';</script>";
    
    			echo "<script>parent.document.getElementById('video_thumbnail_small').value='$thumb';</script>";
    
    			echo "<script>parent.document.getElementById('video_thumbnail_preview').src='".get_bloginfo('url')."$thumb';parent.document.getElementById('video_thumbnail_preview').style.display='';</script>";
    
    			$_GET["action"]="video_upload_form";
    
    		}else{
    
    			echo 'upload error.';
    
    		}
    
    	}
    
    
    
    	
    
    	if($_GET["action"]=="video_upload_form"){
    
    		?>
    
            <style type="text/css">
    
    		<!--
    
    		body {
    
    			margin-left: 0px;
    
    			margin-top: 0px;
    
    			margin-right: 0px;
    
    			margin-bottom: 0px;
    
    		}
    
    		-->
    
    		</style>
    
    		<table border="0" cellspacing="0" cellpadding="0">
    
    			<form name="video_thumbnail_upload_form" enctype="multipart/form-data" method="post" action="" target="_self">
    
    			<tr>
    
    			<td>               
    
    				<input name="video_thumbnail" type="file" id="video_thumbnail" value="" style="width: 300px" width="300" />
    
    			</td>
    
    			<td><input type="submit" id="video_thumbnail_submit" name="video_thumbnail_submit" value="Upload" /><input type="hidden" name="action" value="video_thumbnail_upload_submit" /><input type="hidden" name="post_ID" id="post_ID" value="" /><script>document.getElementById('post_ID').value = parent.document.getElementById('post_ID').value;	</script></td>
    
    			</tr>
    
    			</form>
    
    		</table>
    
    		<?php
    
    		exit(0);
    
    	}
    
    }
    
    
    
    if(!function_exists('ys_movie_form')){
    
    	add_action( 'edit_form_advanced', 'ys_movie_form');
    
    	function ys_movie_form() {
    
    		global $post_ID;
    
    		?>
    
    		<div id="wpcms_message1" class="postbox movie_form"><h3>Video Settings</h3><div class="inside">
    
    			<table id="movie_table">
    
    			<tr>
    
    			  <td width="104" class="left">Video Portal:</td>
    
    			  <td width="217"><select name="video_portal" id="video_portal">
    
    						<option value="youtube" <?php if(get_post_meta($post_ID, '_video_portal',true)=="youtube"){echo ' selected="selected"';}?>>YouTube</option>
    
    						<option value="google" <?php if(get_post_meta($post_ID, '_video_portal',true)=="google"){echo ' selected="selected"';}?>>Google Video</option>
    
    						<option value="myspace" <?php if(get_post_meta($post_ID, '_video_portal',true)=="myspace"){echo ' selected="selected"';}?>>Myspace Video</option>
    
    						<option value="dailymotion" <?php if(get_post_meta($post_ID, '_video_portal',true)=="dailymotion"){echo ' selected="selected"';}?>>dailymotion</option>
    
    						<option value="revver" <?php if(get_post_meta($post_ID, '_video_portal',true)=="revver"){echo ' selected="selected"';}?>>Revver</option>
    
    						<option value="sevenload" <?php if(get_post_meta($post_ID, '_video_portal',true)=="sevenload"){echo ' selected="selected"';}?>>Sevenload</option>
    
    						<option value="clipfish" <?php if(get_post_meta($post_ID, '_video_portal',true)=="clipfish"){echo ' selected="selected"';}?>>Clipfish</option>
    
    						<option value="metacafe" <?php if(get_post_meta($post_ID, '_video_portal',true)=="metacafe"){echo ' selected="selected"';}?>>Metacafé</option>
    
    						<option value="myvideo" <?php if(get_post_meta($post_ID, '_video_portal',true)=="myvideo"){echo ' selected="selected"';}?>>MyVideo</option>
    
    						<option value="yahoo" <?php if(get_post_meta($post_ID, '_video_portal',true)=="yahoo"){echo ' selected="selected"';}?>>Yahoo! Video</option>
    
    						<option value="ifilm" <?php if(get_post_meta($post_ID, '_video_portal',true)=="ifilm"){echo ' selected="selected"';}?>>ifilm</option>
    
    						<option value="brightcove" <?php if(get_post_meta($post_ID, '_video_portal',true)=="brightcove"){echo ' selected="selected"';}?>>brightcove</option>
    
    						<option value="aniboom" <?php if(get_post_meta($post_ID, '_video_portal',true)=="aniboom"){echo ' selected="selected"';}?>>aniBOOM</option>
    
    						<option value="vimeo" <?php if(get_post_meta($post_ID, '_video_portal',true)=="vimeo"){echo ' selected="selected"';}?>>vimeo</option>
    
    						<option value="guba" <?php if(get_post_meta($post_ID, '_video_portal',true)=="guba"){echo ' selected="selected"';}?>>GUBA</option>
    
    						<option value="garagetv" <?php if(get_post_meta($post_ID, '_video_portal',true)=="garagetv"){echo ' selected="selected"';}?>>Garage TV</option>
    
    						<option value="gamevideo" <?php if(get_post_meta($post_ID, '_video_portal',true)=="gamevideo"){echo ' selected="selected"';}?>>GameVideos</option>
    
    						<option value="vsocial" <?php if(get_post_meta($post_ID, '_video_portal',true)=="vsocial"){echo ' selected="selected"';}?>>vSocial</option>
    
    						<option value="veoh" <?php if(get_post_meta($post_ID, '_video_portal',true)=="veoh"){echo ' selected="selected"';}?>>Veoh</option>
    
    						<option value="gametrailers" <?php if(get_post_meta($post_ID, '_video_portal',true)=="gametrailers"){echo ' selected="selected"';}?>>Gametrailers</option>
    
    					  </select></td>
    
    			  </tr>
    
    			<tr>
    
    			<td class="left">Video ID:</td>
    
    			<td><input name="video_id" type="text" id="video_id" tabindex="7" value="<?php echo get_post_meta($post_ID, '_video_id',true);?>" size="40" /></td>
    
    			</tr>
    
                <!--
    
    			<tr>
    
    			<td class="left">Width:</td>
    
    			<td><input name="video_width" type="text" id="video_width" tabindex="7" value="<?php echo get_post_meta($post_ID, '_video_width',true);?>" size="20" maxlength="20" /> px</td>
    
    			</tr>
    
    			<tr>
    
    			<td class="left">Height:</td>
    
    			<td><input type="text" id="video_height" name="video_height" tabindex="7" value="<?php echo get_post_meta($post_ID, '_video_height',true);?>" /> px</td>
    
    			</tr>
    
                -->
    
    			<tr>
    
    			  <td class="left">Thumbnail:</td>
    
    			  <td colspan="2">   
    
                  	<div><img id="video_thumbnail_preview" style=" clear:both;<?php if(!get_post_meta($post_ID, '_video_thumbnail_small',true)){ echo 'display:none;';}?>" src="<?php echo get_post_meta($post_ID, '_video_thumbnail_small',true);?>" /></div>
    
    				<iframe name="video_upload_iframe" style="width:380px;height:30px;" frameborder="0" scrolling="no" src="<?php bloginfo("url")?>?action=video_upload_form"></iframe>
    
                    <input type="hidden" name="video_thumbnail" id="video_thumbnail" value="<?php echo get_post_meta($post_ID, '_video_thumbnail',true);?>" />
    
                    <input type="hidden" name="video_thumbnail_small" id="video_thumbnail_small" value="<?php echo get_post_meta($post_ID, '_video_thumbnail_small',true);?>" />
    
    			</td>
    
    			</tr>
    
                <tr>
    
    			<td class="left">DVD Download Url:</td>
    
    			<td><input name="video_dvd_downurl" type="text" id="video_dvd_downurl" size="40" value="<?php echo get_post_meta($post_ID, '_video_dvd_downurl',true);?>" /></td>
    
    			</tr>
    
                <tr>
    
    			<td class="left">Featured:</td>
    
    			<td><input name="video_featured" type="checkbox" id="video_featured" value="1" <?php if(get_post_meta($post_ID, '_video_featured',true)){ echo 'checked="checked"';}?> /></td>
    
    			</tr>
    
    			</table>    
    
    		</div></div>
    
    		<?php
    
    	}
    
    }
    
    
    
    //add_action('admin_footer', "ys_movie_admin_footer");
    
    add_action( 'edit_form_advanced', "ys_video_admin_footer");
    
    function ys_video_admin_footer(){
    
    	?>
    
    	<script type="text/javascript">
    
    	(function($) {
    
    		if($("#normal-sortables")){
    
    			$("#normal-sortables").hide();
    
    		}
    
    	})(jQuery);
    
    	</script>
    
    	<?php
    
    }
    
    
    
    
    
    add_action('publish_post', 'ys_video_add_post_meta');
    
    function ys_video_add_post_meta($post_ID) {
    
    	global $wpdb;
    
    	update_post_meta($post_ID, '_video_portal', $_POST["video_portal"]);
    
    	update_post_meta($post_ID, '_video_id', $_POST["video_id"]);
    
    	update_post_meta($post_ID, '_video_width', $_POST["video_width"]);	
    
    	update_post_meta($post_ID, '_video_height', $_POST["video_height"]);
    
    	update_post_meta($post_ID, '_video_thumbnail', $_POST["video_thumbnail"]);
    
    	update_post_meta($post_ID, '_video_thumbnail_small', $_POST["video_thumbnail_small"]);
    
    	update_post_meta($post_ID, '_video_featured', $_POST["video_featured"]);
    
    	update_post_meta($post_ID, '_video_dvd_downurl', $_POST["video_dvd_downurl"]);
    
    }
    
    
    
    add_action('delete_post', 'ys_video_delete_post_meta');
    
    function ys_video_delete_post_meta($post_ID) {
    
    	global $wpdb;
    
    	delete_post_meta($post_ID, '_video_thumbnail');
    
    	delete_post_meta($post_ID, '_video_thumbnail_small');
    
    	delete_post_meta($post_ID, '_video_portal');
    
    	delete_post_meta($post_ID, '_video_id');
    
    	delete_post_meta($post_ID, '_video_width');
    
    	delete_post_meta($post_ID, '_video_height');
    
    	delete_post_meta($post_ID, '_video_featured');
    
    	delete_post_meta($post_ID, '_video_dvd_downurl');
    
    }
    
    
    
    
    
    
    
    
    
    
    
    
    
    function featured_fields($content) {
    
    	$content .= ", f1.meta_value AS video_id ";
    
    	return $content;
    
    }
    
    function featured_join($content) {
    
    	global $wpdb;
    
    	$content .= " LEFT JOIN $wpdb->postmeta AS f1 ON f1.post_id = $wpdb->posts.ID";
    
    	return $content;
    
    }
    
    function featured_where_featured($content) {
    
    	$content .= " AND f1.meta_key = '_video_featured' and f1.meta_value = '1'";
    
    	return $content;
    
    }
    
    
    
    function featured_where_no_featured($content) {
    
    	$content .= " AND f1.meta_key = '_video_featured' and f1.meta_value = ''";
    
    	return $content;
    
    }
    
    
    
    
    
    if ( function_exists('register_sidebar') )
    
    
    
    	register_sidebar(array(
    
    			'name' => 'Sidebar_left',
    
    			'before_widget' => '<ul id="%1$s" class="widget %2$s">',
    
    			'after_widget' => '</ul>',
    
    			'before_title' => '<h2>',
    
    			'after_title' => '</h2>'
    
    	));
    
    	register_sidebar(array(
    
    			'name' => 'Sidebar_right',
    
    			'before_widget' => '<ul id="%1$s" class="widget %2$s">',
    
    			'after_widget' => '</ul>',
    
    			'before_title' => '<h2>',
    
    			'after_title' => '</h2>'
    
    	));
    
    ?>
    Second code

    Code:
    <?php
    if ( function_exists('register_sidebar') )
    register_sidebar(array('name'=>'Index Sidebar',
    'before_widget' => '<div class="blockhead">',
    'after_widget' => '</div>',
    'before_title' => '<h3>',
    'after_title' => '</h3></div><div class="block">',
    ));
    ?>
    <?php
    if ( function_exists('register_sidebar') )
    register_sidebar(array('name'=>'Single Sidebar',
    'before_widget' => '<div class="blockhead">',
    'after_widget' => '</div>',
    'before_title' => '<h3>',
    'after_title' => '</h3></div><div class="block">',
    ));
    ?>
    <?php
    if ( function_exists('register_sidebar') )
    register_sidebar(array('name'=>'Page Sidebar',
    'before_widget' => '<div class="blockhead">',
    'after_widget' => '</div>',
    'before_title' => '<h3>',
    'after_title' => '</h3></div><div class="block">',
    ));
    ?>
    <?php
    if ( function_exists('register_sidebar') )
    register_sidebar(array('name'=>'Blog Sidebar',
    'before_widget' => '<div class="blockhead">',
    'after_widget' => '</div>',
    'before_title' => '<h3>',
    'after_title' => '</h3></div><div class="block">',
    ));
    ?>
    <?php function get_thumbnail($postID) {
        if( function_exists('p75GetThumbnail') ) {
            $thumbnail = p75GetThumbnail($postID);
            return $thumbnail ? $thumbnail : get_bloginfo('template_url') . '/images/default-thumb.png';
        }
        return "";
    }
    
    function get_video($postID) {
        if( function_exists('p75GetVideo') ) {
            $video = p75GetVideo($postID);
            return $video ? "<div class='video'>" . $video . "</div>" : "";
        }
        return "";
    }
    ?>
    <?php
    load_theme_textdomain('ondemand_monger');
    
    class OnDemand {
    
    	function addOptions () {
    
    		if (isset($_POST['ondemand_reset'])) { OnDemand::initOptions(true); }
    
    		if (isset($_POST['ondemand_save'])) {
    
    			$aOptions = OnDemand::initOptions(false);
    			$aOptions['featured-count'] = $_POST['featured-count'];
    			$aOptions['featured-cat'] = $_POST['featured-cat'];
    			$aOptions['sideblog-title'] = stripslashes($_POST['sideblog-title']);		
    			$aOptions['sideblog-count'] = $_POST['sideblog-count'];
    			$aOptions['sideblog-cat'] = $_POST['sideblog-cat'];
    			$aOptions['footer-text'] = stripslashes($_POST['footer-text']);
    			update_option('ondemand_theme', $aOptions);
    
    		}
    		
    		add_theme_page("On Demand Theme Options", "On Demand Options", 'edit_themes', basename(__FILE__), array('OnDemand', 'displayOptions'));
    	}
    	
    	function initOptions ($bReset) {
    		$aOptions = get_option('ondemand_theme');
    		if (!is_array($aOptions) || $bReset) {
    			$aOptions['featured-count'] = '6';
    			$aOptions['featured-cat'] = '3';
    			$aOptions['sideblog-title'] = 'Sideblog';
    			$aOptions['sideblog-count'] = '5';
    			$aOptions['sideblog-cat'] = '4';
    			$aOptions['footer-text'] = '2008 SomeSite.com - All Rights Reserved';
    			update_option('ondemand_theme', $aOptions);
    		}
    		return $aOptions;
    	}
    
    	function displayOptions () {
    		$aOptions = OnDemand::initOptions(false);
    ?>
    
    <div class="wrap">
    	<h2>On Demand Theme Options</h2>	
        <div style="margin-left:0px;">
        <form action="#" method="post" enctype="multipart/form-data" name="massive_form" id="massive_form">
    		<fieldset name="general_options" class="options">
    		
            <h3 style="margin-bottom:0px;">Featured Content Carousel Options</h3>        
            <p style="margin-top:0px;">Use the fields below to edit your feature content carousel (home page) options.</p>
    		
            Featured Category ID Number: (You can easily find your category ID number using the "<a href="http://wordpress.org/extend/plugins/reveal-ids-for-wp-admin-25/" title="Reveal ID's" target="_blank">Reveal ID's</a>" Plugin)<br />
    		<div style="margin:0;padding:0;">
            <input name="featured-cat" id="featured-cat" value="<?php echo($aOptions['featured-cat']); ?>" size="2" ></input>   
            </div><br /> 
            
            Number of Featured Post Items to Display:<br />
    		<div style="margin:0;padding:0;">
            <input name="featured-count" type="text" id="featured-count" value="<?php echo($aOptions['featured-count']); ?>" size="2" /> 
            </div><br />
    
            <h3 style="margin-bottom:0px;">Standard Blog Post (Non Video Posts) Options:</h3>
            <p style="margin-top:0px;">Use the fields below to edit your standard blog post options (non video posts) & sideblog widget options.</p>
     
            Blog Category ID Number: (You can easily find your category ID number using the "<a href="http://wordpress.org/extend/plugins/reveal-ids-for-wp-admin-25/" title="Reveal ID's" target="_blank">Reveal ID's</a>" Plugin)<br />
    		<div style="margin:0;padding:0;">
            <input name="sideblog-cat" id="sideblog-cat" value="<?php echo($aOptions['sideblog-cat']); ?>" size="2" ></input>   
            </div><br /> 
            
            Sideblog Title:<br />
            <div style="margin:0;padding:0;">
            <input name="sideblog-title" id="sideblog-title" size="15" value="<?php echo($aOptions['sideblog-title']); ?>"></input> 
            </div><br />
            
            Number of Sideblog Items to Display:<br />
    		<div style="margin:0;padding:0;">
            <input name="sideblog-count" type="text" id="sideblog-count" value="<?php echo($aOptions['sideblog-count']); ?>" size="2" /> 
            </div><br />
            
            <h3 style="margin-bottom:0px;">Footer Copyright Text Options:</h3>
            <p style="margin-top:0px;">Use the fields below to edit your copyright text within the footer.</p>
            
            Footer Text:<br />
            <div style="margin:0;padding:0;">
            <input name="footer-text" id="footer-text" size="75" value="<?php echo($aOptions['footer-text']); ?>"></input> 
            </div><br />
                                    
    		</fieldset>
    		<p class="submit"><input type="submit" name="ondemand_reset" value="Reset" /></p>
    		<p class="submit"><input type="submit" name="ondemand_save" value="Save" /></p>
    	</form>      
    </div>
    <?php
    	}
    }
    
    // Register functions
    add_action('admin_menu', array('OnDemand', 'addOptions'));
    
    ?>
    I need to join these two but they are two different languages :(