Example #1
0
function postParse($input, $type)
{
    switch ($type) {
        // Apply changes to HTML documents
        case 'html':
            // Check we have a video to show and if not, return unchanged
            if (!defined('VIDEO_ID') || !defined('IMAGE_ID')) {
                return $input;
            }
            // Create URL to mediaplayer
            $mediaPlayerUrl = GLYPE_URL . '/plugins/player.swf';
            // Generate URL to flv file and preview image through proxy script
            $flvUrl = rawurlencode(proxifyURL(VIDEO_ID));
            $imgUrl = rawurlencode(proxifyURL(IMAGE_ID));
            // Generate HTML for the flash object with our new FLV URL
            $html = <<<OUT
<embed src="{$mediaPlayerUrl}"
        width="450"
        height="358"
        bgcolor="000000"
        allowscriptaccess="always"
        allowfullscreen="true"
        type="application/x-shockwave-flash"
        pluginspage="http://www.macromedia.com/go/getflashplayer" 
        flashvars="width=450&amp;height=388&amp;type=video&amp;fullscreen=true&amp;volume=100&amp;file={$flvUrl}&amp;image={$imgUrl}" />
OUT;
            // Add our own player into the player div
            $input = preg_replace('#<embed.*?showeq=false\\" \\/\\>#s', $html, $input, 1);
            break;
    }
    return $input;
}
Example #2
0
function postParse($input, $type)
{
    switch ($type) {
        // Apply changes to HTML documents
        case 'html':
            // Check we have a video to show and if not, return unchanged
            if (!defined('VIDEO_ID') || !defined('T_VALUE') || !defined('M_VALUE')) {
                return $input;
            }
            // Create URL to mediaplayer
            $mediaPlayerUrl = GLYPE_URL . '/plugins/player.swf';
            // Generate URL to flv file and preview image through proxy script
            $flvUrl = rawurlencode(proxifyURL(rawurldecode(sprintf(T_VALUE . 'flv2/' . VIDEO_ID . 'flv'))));
            $imgUrl = rawurlencode(proxifyURL(rawurldecode(sprintf('%s', M_VALUE))));
            // Generate HTML for the flash object with our new FLV URL
            $html = <<<OUT
<embed src="{$mediaPlayerUrl}"
        width="580"
        height="455"
        bgcolor="000000"
        allowscriptaccess="always"
        allowfullscreen="true"
        type="application/x-shockwave-flash"
        pluginspage="http://www.macromedia.com/go/getflashplayer" 
        flashvars="width=580&amp;height=455&amp;type=video&amp;fullscreen=true&amp;volume=100&amp;file={$flvUrl}&amp;image={$imgUrl}" />
OUT;
            // Add our own player into the player div
            // $input = preg_replace('/'.preg_quote('<p id="player">','/').'/s',$html,$input, 1);
            $input = preg_replace('#\\<div\\sstyle\\=\\"width\\:580px\\;\\sheight\\:455px\\"\\>.*?\\<\\/script\\>#s', '<p id="player">' . $html . '</p></DIV></br>', $input, 1);
            break;
    }
    return $input;
}
Example #3
0
function postParse($input, $type)
{
    switch ($type) {
        // Apply changes to HTML documents
        case 'html':
            // Check we have a video to show and if not, return unchanged
            if (!defined('VIDEO_ID') || !defined('T_VALUE') || !defined('D_VALUE')) {
                return $input;
            }
            // Create URL to mediaplayer
            $mediaPlayerUrl = GLYPE_URL . '/plugins/player.swf';
            // Generate URL to flv file and preview image through proxy script
            $flvUrl = rawurlencode(proxifyURL(rawurldecode(sprintf('%s', VIDEO_ID))));
            $imgUrl = rawurlencode(proxifyURL(rawurldecode(sprintf('%s', T_VALUE))));
            // Generate HTML for the flash object with our new FLV URL
            $html = <<<OUT
<embed src="{$mediaPlayerUrl}"
        width="608"
        height="400"
        bgcolor="000000"
        allowscriptaccess="always"
        allowfullscreen="true"
        type="application/x-shockwave-flash"
        pluginspage="http://www.macromedia.com/go/getflashplayer" 
        flashvars="width=608&amp;height=400&amp;type=video&amp;fullscreen=true&amp;volume=100&amp;file={$flvUrl}&amp;image={$imgUrl}" />
OUT;
            // Add our own player into the player div
            $input = preg_replace('#\\<div\\sclass\\=\\"dm_widget_videoplayer.*?\\<\\/div\\>#s', '<div class="dm_widget_videoplayer" ><div id="video_player_' . D_VALUE . '" style="width: 100%; height: 100%;">' . $html . '</div></div>', $input, 1);
            break;
    }
    return $input;
}
Example #4
0
 function reparseSalt($input)
 {
     return proxifyURL($input[1]);
 }
Example #5
0
function css_src($input)
{
    return 'src=' . $input[1] . proxifyURL($input[2]) . $input[1];
}
Example #6
0
         }
         // Current bit
         $bit = pow(2, $i);
         // Set bitfield
         if (!empty($_POST[$name])) {
             setBit($bitfield, $bit);
         }
         // Increase index
         ++$i;
     }
     // Save new bitfield in session
     $_SESSION['bitfield'] = $bitfield;
     // Save valid entry
     $_SESSION['no_hotlink'] = true;
     // Redirect to target
     redirect(proxifyURL($url));
     break;
     /*************************************************************
      * Agree to our SSL warning.
      **************************************************************/
 /*************************************************************
  * Agree to our SSL warning.
  **************************************************************/
 case 'sslagree':
     // Flag our SSL warnedness
     $_SESSION['ssl_warned'] = true;
     // Return to previous page
     $redirectTo = isset($_SESSION['return']) ? $_SESSION['return'] : 'index.php';
     // Clear session return value
     unset($_SESSION['return']);
     // Redirect
Example #7
0
        define('NO_BF', true);
        require 'init.php';
        ## Flag valid entry point (for prevention of hotlinking)
        $_SESSION['viaIndex'] = true;
        ## Check we're submitted
        if (empty($_POST['u'])) {
            localRedirect();
        }
        ## Determine our options and set _SESSION as appropriate
        # Start with empty array
        $options = array();
        # Loop through all available options
        foreach ($optionsDetails as $name => $details) {
            # Set this option to the default if the option is forced.
            if (!empty($details['force'])) {
                $_SESSION[$name] = $options[$name] = $details['default'];
            } else {
                $_SESSION[$name] = $options[$name] = empty($_POST[$name]) ? false : true;
            }
        }
        ## Regenerate bitfield
        defineBitfield($options);
        ## Validate URL
        $url = $_POST['u'];
        if (strpos($url, '://') === false) {
            $url = 'http://' . $url;
        }
        ## Redirect to browse script
        header('Location: ' . proxifyURL($url));
        break;
}
Example #8
0
         }
         // Current bit
         $bit = pow(2, $i);
         // Set bitfield
         if (!empty($_POST[$name])) {
             setBit($bitfield, $bit);
         }
         // Increase index
         ++$i;
     }
     // Save new bitfield in session
     $_SESSION['bitfield'] = $bitfield;
     // Save valid entry
     $_SESSION['no_hotlink'] = true;
     // Redirect to target
     redirect(proxifyURL($url, 'norefer'));
     break;
     /*************************************************************
      * Agree to our SSL warning.
      **************************************************************/
 /*************************************************************
  * Agree to our SSL warning.
  **************************************************************/
 case 'sslagree':
     // Flag our SSL warnedness
     $_SESSION['ssl_warned'] = true;
     // Return to previous page
     $redirectTo = isset($_SESSION['return']) ? $_SESSION['return'] : 'index.php';
     // Clear session return value
     unset($_SESSION['return']);
     // Redirect
Example #9
0
if ($fetch->abort) {
    # Action depends on reason for abort
    switch ($fetch->abort) {
        # Redirect
        case 'redirect':
            if (DEBUG_MODE) {
                $fetch->goto = '<a href="' . proxifyURL($fetch->headers['location']) . '">' . proxifyURL($fetch->headers['location']) . '</a>';
                break;
            }
            if ($fetch->status == 301) {
                header("HTTP/1.1 301 Moved Permanently", true, 301);
            }
            # Returned status of 100 should still redirect so override to 302
            $status = $fetch->status == 100 ? 302 : $fetch->status;
            # Move on and exit
            header("Location: " . proxifyURL($fetch->headers['location']), true, $status);
            exit;
            break;
            # File too large
        # File too large
        case 'filetoolarge':
            sendNoCache();
            error(sprintf($phrases['fileLimit'], round(optMAXSIZE / (1024 * 1024), 4)));
            break;
            # 304 Not Modified
        # 304 Not Modified
        case 'notmodified':
            header("HTTP/1.1 304 Not Modified", true, 304);
            exit;
            break;
    }
Example #10
0
 function facebook_replaceURL($input)
 {
     return str_replace($input[1], proxifyURL($input[1], 'ajax'), $input[0]);
 }