a small code help

Discussion in 'PHP' started by djjenny, Nov 10, 2009.

  1. #1
    Hi

    i have zshare script i am plan to add on my site but duntknow where to add it can some one help me how to add it

    i have seen this site using some redirect :http://watch0nline.info/videos.php?vid=5111d2b9c

    if any one help me it will be usefull

    this one is the code of php melody

    
    <?php
    // +------------------------------------------------------------------------+
    // | PHP Melody version 1.6 ( www.phpsugar.com )
    // +------------------------------------------------------------------------+
    // | PHP Melody IS NOT FREE SOFTWARE
    // | If you have downloaded this software from a website other
    // | than www.phpsugar.com or if you have received
    // | this software from someone who is not a representative of
    // | phpSugar, it's likely that you are involved in an illegal activity.
    // | ---
    // | In such case, please contact: support@phpsugar.com.
    // +------------------------------------------------------------------------+
    // | Developed by: phpSugar (www.phpsugar.com) / support@phpsugar.com
    // | Copyright: (c) 2004-2009 PhpSugar.com. All rights reserved.
    // +------------------------------------------------------------------------+
    
    session_start();
    require_once('config.php');
    require_once('include/functions.php');
    
    //	set ad cookie ?
    if (empty($_COOKIE[COOKIE_VIDEOAD]))
    {
    	if ($config['total_videoads'] > 0)
    	{
    		if ($config['videoads_delay'] != 0)
    		{
    			setcookie(COOKIE_VIDEOAD, $video_ad_hash, time() + $config['videoads_delay'], COOKIE_PATH);
    		}
    	}
    }
    
    if (empty($_GET['vid'])) 
    {
    	exit();
    } 
    else 
    {
    	$temp		= array();
    	$video		= array();
    	$mime_type	= 'video/x-flv';
    	
    	$video_id 	= secure_sql($_GET['vid']);
    		
    	$sql = "SELECT pm_videos.*, pm_videos_urls.mp4, pm_videos_urls.direct 
    			FROM pm_videos 
    			LEFT JOIN pm_videos_urls 
    				   ON (pm_videos.uniq_id = pm_videos_urls.uniq_id) 
    			WHERE pm_videos.uniq_id = '". $video_id ."'";
    
    	$result =  @mysql_query($sql);
    	$video = @mysql_fetch_assoc($result);
    	mysql_free_result($result);
    	
    	$mime_types = array('flv' => 'video/x-flv',
    						'mp4' => 'video/mp4',
    						'mov' => 'video/quicktime',
    						'wmv' => 'video/x-ms-wmv'
    						);
    						
    	define('PHPMELODY', true);
    
    	switch ($video['source_id'])
    	{
    		case 3:	//	Youtube
    		
    			include(ABSPATH . "admin/src/youtube.php");
    
    			if ($video['direct'] == '')
    			{
    				$video['direct'] = 'http://www.youtube.com/watch?v='. $video['yt_id'];
    			}
    			
    			$flv_url = get_flv($video['direct'], _USE_HQ_VIDS);
    		break;
    		
    		
    		case 5:	//	Dailymotion
    
    			@include(ABSPATH . "admin/src/dailymotion.php");
    			
    			if (_USE_HQ_VIDS)
    			{
    				$flv_url = get_hd($video['direct']);
    			}
    			if ((_USE_HQ_VIDS && $flv_url == '') || ( ! _USE_HQ_VIDS))
    			{
    				$flv_url = get_flv($video['direct']);
    			}
    		break;
    		
    		case 9:	//	VEOH
    
    			@include(ABSPATH . "admin/src/veoh.php");
    			
    			do_main($temp, $video['direct']);
    			$flv_url = $temp['url_flv'];
    			unset($temp);
    		break;
    		
    		case 6:	//	Metacafe
    		
    			@include(ABSPATH . "admin/src/metacafe.php");
    
    			$flv_url = get_flv($video['direct']);
    			unset($temp);
    		break;
    		
    		case 20:	//	FunnyOrDie
    		
    			$parts = explode("/", $video['direct']);
    			$vid_id = $parts[ count($parts)-2 ];
    			$flv_url = 'http://videos0.ordienetworks.com/videos/'.$vid_id.'/sd.flv';
    		break;
    		
    		case 16:	//	Vimeo
    		
    			@include(ABSPATH . "admin/src/vimeo.php");
    			
    			do_main($temp, $video['direct']);
    			$flv_url = $temp['url_flv'];
    			unset($temp);
    		break;
    		
    		
    		case 4:	//	Google
    			
    			@include(ABSPATH . "admin/src/google.php");
    			
    			do_main($temp, $video['direct']);
    			
    			$flv_url = $temp['url_flv'];
    			unset($temp);
    		break;
    	
    		default:
    		
    			if ($video['source_id'] == 1 || $video['source_id'] == 2)
    			{
    				if(strpos($video['url_flv'], 'http://') !== false)
    				{
    					$flv_url = $video['url_flv'];
    				}
    				else
    				{
    					$flv_url = _VIDEOS_DIR . $video['url_flv'];
    				}
    				
    				$ext = strtolower(array_pop(explode('.', $video['url_flv'])));
    
    				if (array_key_exists($ext, $mime_types))
    				{
    					$mime_type = $mime_types[$ext];
    				}
    				else if (function_exists('finfo_open')) 
    				{
    					$finfo 		= finfo_open(FILEINFO_MIME);
    					$mime_type 	= finfo_file($finfo, _VIDEOS_DIR_PATH . $video['url_flv']);
    					finfo_close($finfo);
    				}
    			}
    			else
    			{
    				$flv_url = $video['url_flv'];
    			}
    			
    		break;
    	}
    
    	header("Cache-Control: no-store, no-cache, must-revalidate");
    	header("Content-Type: ". $mime_type);
    	header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
    	header('Location: '. $flv_url);
    }
    exit();
    ?>
    
    Code (markup):

     
    djjenny, Nov 10, 2009 IP
  2. AndrewRae

    AndrewRae Greenhorn

    Messages:
    16
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    11
    #2
    Post this request in the phpSugar forums.

    Someone will help you there.
     
    AndrewRae, Nov 30, 2009 IP
  3. inanobot

    inanobot Peon

    Messages:
    46
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    I think it is a module of some script that used to run web video file (FLV), so first of all you must have the script to run this module
     
    inanobot, Nov 30, 2009 IP