Results 1 to 9 of 9

Thread: Download Video Mod for 2.7

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1

    Default Download Video Mod for 2.7

    This mod allows registered users to download videos, FLV or Orginal video file or both. With Admin control for Vshare 2.7

    First things first Back up Back up Back Up


    open .htaccess find
    Code:
    RewriteRule ^download/(.*)/ download.php?video_id=$1 [L,QSA]
    Add this below
    Code:
    RewriteRule ^fldownload/(.*)/ fldownload.php?video_id=$1 [L,QSA]
    Then save file

    copy this code and call it fldownload.php save to root of vshare
    Code:
    <?php
    /******************************************************************************
    
     *
    
     *   COMPANY: BuyScripts.in
    
     *   PROJECT: vShare Youtube Clone
    
     *   VERSION: 2.7
    
     *   LISENSE: http://buyscripts.in/vshare-license.html
    
     *   WEBSITE: http://buyscripts.in/youtube_clone.html
    
     *
    
     *   This program is a commercial software and any kind of using it must agree 
    
     *   to vShare license.
    
     *
    
     ******************************************************************************/
    
    require 'include/config.php';
    require 'include/class.video.php';
    
    if ($config['allow_fldownload'] != 1)
    {
        echo 'Video download disabled';
        exit();
    }
    
    User::is_logged_in();
    
    $video_info = Video::get_video_info($_GET['video_id']);
    $video_name = $video_info['video_flv_name'];
    $video_dir = $video_info['video_folder'];
    $file_path = VSHARE_DIR . '/flvideo/' . $video_dir . $video_name;
    
    if (($video_name == '') || (! is_file($file_path)) || (! file_exists($file_path)))
    {
        echo 'File not found.';
        exit();
    }
    
    if (ini_get('zlib.output_compression'))
    {
        ini_set('zlib.output_compression', 'Off');
    }
    
    header('Pragma: public');
    header('Expires: 0');
    header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
    header('Cache-Control: private', false);
    header('Content-Type: application/zip');
    header('Content-Disposition: attachment; filename="' . basename($video_name) . '";');
    header('Content-Transfer-Encoding: binary');
    header('Content-Length: ' . filesize($video_name));
    readfile("$file_path");
    exit();
    open view_video.tpl add below
    Code:
    {if $allow_fldownload == 1 && $view.video_info.video_vtype eq 0}
                  
                <a href="{$base_url}/fldownload/{$view.video_info.video_id}/">
                    [img]{$img_css_url}/images/download.png[/img] Download Flv
                </a>
            {/if}
    Now open in admin folder miscellaneous.php find this
    Code:
    if (is_numeric($_POST['allow_download']))
            {
                $sql = "UPDATE `sconfig` SET
                       `svalue`='" . (int) $_POST['allow_download'] . "' WHERE
                       `soption`='allow_download'";
                mysql_query($sql) or mysql_die($sql);
                $smarty->assign('allow_download', $_POST['allow_download']);
            }
    add this below

    Code:
    if (is_numeric($_POST['allow_fldownload']))
            {
                $sql = "UPDATE `sconfig` SET
                       `svalue`='" . (int) $_POST['allow_fldownload'] . "' WHERE
                       `soption`='allow_fldownload'";
                mysql_query($sql) or mysql_die($sql);
                $smarty->assign('allow_fldownload', $_POST['allow_fldownload']);
            }
    then open in templates/admin miscellaneous.tpl find this
    Code:
    <div>
            <label for="allow_download">Allow Video Download:</label>
            <select name="allow_download" id="allow_download">
                <option value="0" {if $allow_download =='0'}selected="selected"{/if}>No</option>
                <option value="1" {if $allow_download =='1'}selected="selected"{/if}>Yes</option>
            </select>
        </div>
    Add this below
    Code:
    <div>
            <label for="allow_fldownload">Allow Video FLV Download:</label>
            <select name="allow_fldownload" id="allow_fldownload">
                <option value="0" {if $allow_fldownload =='0'}selected="selected"{/if}>No</option>
                <option value="1" {if $allow_fldownload =='1'}selected="selected"{/if}>Yes</option>
            </select>
        </div>
    Backup SQL now add this to SQL

    Code:
    INSERT INTO `sconfig` (`soption`, `svalue`) VALUES('allow_fldownload', '0');
    your done have fun
    this lets you have control over what download you want to use FLV or Original even both under site settings Miscellaneous

    :wink: :mrgreen:

  2. #2

    Unhappy MOD Error

    The MOD is installed fine but when tried to download flv the file started asked for saving.

    The file was ZERO bites.

    (the actual video was fine and plays okay on the website)

    Help please .... !!!

Similar Threads

  1. Better Download Video Mod
    By leki in forum Template Modifications
    Replies: 25
    Last Post: 01-17-2009, 03:59 AM
  2. Video download protection
    By videlov in forum General Discussions
    Replies: 10
    Last Post: 06-10-2008, 05:51 AM
  3. Allow user to download FLV video
    By gary in forum Installation Support
    Replies: 2
    Last Post: 04-28-2008, 11:52 PM
  4. cannot download .wmv video
    By robaldo in forum Installation Support
    Replies: 1
    Last Post: 03-24-2008, 08:37 AM
  5. Video Download Option
    By scwebmaster in forum Feature Requests
    Replies: 0
    Last Post: 02-09-2008, 05:54 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •