forum.coppermine-gallery.net

Support => cpg1.4.x Support => Older/other versions => cpg1.4 miscellaneous => Topic started by: tripslip38 on December 01, 2005, 10:48:11 pm

Title: Download video hack for v. 1.4.2
Post by: tripslip38 on December 01, 2005, 10:48:11 pm
I found the thread for the code change in the 1.3 boards about making a link to let users download video files instead of streaming them in the embedded player. In displayimage.php 1.4, I can't even find any of the same variables to hack as was described in the 1.3 hack.

Old hack: http://forum.coppermine-gallery.net/index.php?topic=9367.0

Suggestions?

Zane
Title: Re: Download video hack for v. 1.4.2
Post by: Nibbler on December 01, 2005, 10:49:36 pm
That code is part of the theme system now, you can find it in your theme's theme.php or in include/themes.inc.php
Title: Re: Download video hack for v. 1.4.2
Post by: bwschult on December 01, 2005, 10:58:08 pm
tripslip, I would be definitely be interested in that.  As my videos don't play on Mac OS, I'm looking into alternative ways for my users to view videos other than the embedded player.
Title: Re: Download video hack for v. 1.4.2
Post by: tripslip38 on December 01, 2005, 11:20:31 pm
Ok, I searched around, and with Nibbler's redirect to the new location of the code, I came up with this solution, which worked beautifully:

Step 1) Create download.php

Copy/paste this code into a file called download.php, and put it in the Coppermine application root:

Code: [Select]
<?php
//
// hack to allow downloading of pictures and movies
// see http://forum.coppermine-gallery.net/index.php?topic=6464.0
//
define('IN_COPPERMINE',true);
define('UPLOAD_PHP',true);
define('DOWNLOAD_PHP',true);

require(
'include/init.inc.php');

function 
download()
{
        global 
$CONFIG$lang_upload_php$FORBIDDEN_SET;

        
$pid = (int) $_GET['pid'];

        
$sql 'select '.
                
'p.filepath,'.
                
'p.filesize,'.
                
'p.filename,'.
                
$CONFIG['TABLE_ALBUMS'].'.visibility, '.
                
'p.aid as aid '.
                
'from '.$CONFIG['TABLE_PICTURES'].' as p LEFT JOIN '.$CONFIG['TABLE_ALBUMS'].
                
' ON (p.aid = ' $CONFIG['TABLE_ALBUMS'].'.aid ) '.
                
' where pid='.$pid.' and approved="YES"';

        if (!empty(
$FORBIDDEN_SET)) {
                
$sql .= ' and '.$FORBIDDEN_SET;
        }

        
$result cpg_db_query($sql);

        
// No data returned; Display an error page
        
if (mysql_num_rows($result)==0) {
                
mysql_free_result($result);
                
cpg_die(CRITICAL_ERROR,$lang_upload_php['unknown']);
        }

        
$file mysql_fetch_assoc($result);
        
mysql_free_result($result);

        
// Empty output buffer
        
while(ob_get_level()>0) {
                
ob_end_clean();
        }

        
// Send binary information to the browser
        
header("Content-type: application/octet-stream");
        
header("Content-disposition: attachment; filename=".$file['filename']);
        
header("Content-Length: ".$file['filesize']);
        
header("Pragma: no-cache");
        
header("Expires: 0");
        
readfile($CONFIG['fullpath'].$file['filepath'].$file['filename']);
}

download();
?>

Step 2) Change theme.php

Open the theme.php for the theme your're using.

FIND:
Code: [Select]
        $pic_html  = '<object id="'.$player['id'].'" '.$player['classid'].$player['codebase'].$player['mime'].$image_size['whole'].'>';
        $pic_html .= "<param name=\"autostart\" value=\"$autostart\" /><param name=\"src\" value=\"". $picture_url . "\" />";
        $pic_html .= '<embed '.$image_size['whole'].' src="'. $picture_url . '" autostart="'.$autostart.'" '.$player['mime'].'></embed>';
        $pic_html .= "</object><br />\n";

REPLACE WITH:
Code: [Select]
        $pic_html  = '<object id="'.$player['id'].'" '.$player['classid'].$player['codebase'].$player['mime'].$image_size['whole'].'>';
        $pic_html .= "<param name=\"autostart\" value=\"$autostart\" /><param name=\"src\" value=\"". $picture_url . "\" />";
        $pic_html .= '<embed '.$image_size['whole'].' src="'. $picture_url . '" autostart="'.$autostart.'" '.$player['mime'].'></embed>';
        $pic_html .= "</object><br />\n";
$pic_html .= "<p><a href=\"download.php?pid={$CURRENT_PIC_DATA['pid']}\">Click here to download</a></p>";


That should do you. In addition to the media file opening in an embedded player now, a link to download will display.


Zane
Title: Re: Download video hack for v. 1.4.2
Post by: Joachim Müller on December 02, 2005, 12:10:45 am
Open the theme.php for the theme your're using, or theme.inc.php
don't!
Title: Re: Download video hack for v. 1.4.2
Post by: mini1400 on December 02, 2005, 12:17:00 pm
Open the theme.php for the theme your're using.

FIND:
Code: [Select]
        $pic_html  = '<object id="'.$player['id'].'" '.$player['classid'].$player['codebase'].$player['mime'].$image_size['whole'].'>';
        $pic_html .= "<param name=\"autostart\" value=\"$autostart\" /><param name=\"src\" value=\"". $picture_url . "\" />";
        $pic_html .= '<embed '.$image_size['whole'].' src="'. $picture_url . '" autostart="'.$autostart.'" '.$player['mime'].'></embed>';
        $pic_html .= "</object><br />\n";

REPLACE WITH:
Code: [Select]
        $pic_html  = '<object id="'.$player['id'].'" '.$player['classid'].$player['codebase'].$player['mime'].$image_size['whole'].'>';
        $pic_html .= "<param name=\"autostart\" value=\"$autostart\" /><param name=\"src\" value=\"". $picture_url . "\" />";
        $pic_html .= '<embed '.$image_size['whole'].' src="'. $picture_url . '" autostart="'.$autostart.'" '.$player['mime'].'></embed>';
        $pic_html .= "</object><br />\n";
$pic_html .= "<p><a href=\"download.php?pid={$CURRENT_PIC_DATA['pid']}\">Click here to download</a></p>";


Hmm, can't find that code in the mac_os_x theme..... any ideas?
Title: Re: Download video hack for v. 1.4.2
Post by: Paver on December 02, 2005, 01:38:52 pm
Hmm, can't find that code in the mac_os_x theme..... any ideas?

Some themes don't use all the overrides.  Go to the "sample" theme and copy the relevant section from its theme.php into your theme.php.  If you haven't done so already, I'd copy the default Mac_OS_X theme into a new folder so you can modify at will and still have the default (for upgrades and overall sanity).
Title: Re: Download video hack for v. 1.4.2
Post by: mini1400 on December 19, 2005, 05:03:28 pm
Cheers for that, works great!

http://mini1400.demon.co.uk/cpg/thumbnails.php?album=31
Title: Re: Download video hack for v. 1.4.2
Post by: hotvins on January 15, 2006, 05:15:06 pm
I am getting following error messege !!

Quote
Fatal error: Call to undefined function: db_query() in /home/vwad/public_html/masala/download.php on line 32
Title: Video Download Hack Problem
Post by: hotvins on January 15, 2006, 05:59:54 pm
I have searched very hard but cannot find solution for this

I have successfully changed the files themes.inc.php and have uploaded download.php file as per the hack instructions but I am getting just a blank page or sometimes a file gets downloaded with a 1 kb size instead of the original video file size of 346 kb.

I am confident and have checked that the video file is there and is of 346 kn in my albums/uploads folder

My gallery link is

http://hotvins.300megs.com/masala/

The file I am talking about is located here

http://hotvins.300megs.com/masala/displayimage.php?album=lastup&cat=0&pos=0

Help needed

thanks in advance

hotvins
Title: Re: Download video hack for v. 1.4.2
Post by: Paver on January 15, 2006, 08:34:21 pm
hotvins:  Check your modifications again.  db_query is a deprecated function from version 1.3.  The function in 1.4 is cpg_db_query.  You could merely fix your current error, but I would check this thread again against your code to make sure you are using everywhere the 1.4 code.
Title: Re: Video Download Hack Problem
Post by: Joachim Müller on January 15, 2006, 10:38:03 pm
Don't edit themes.inc.php!
Post what mod you're refering to.
Title: Re: Video Download Hack Problem
Post by: Joachim Müller on January 15, 2006, 10:42:56 pm
I just found out what posting you refered to, as you cross posted there as well. Merging this new thread you started with the other one you refered to. Don't double post nor cross post, it just makes supporter's life harder.
Title: Re: Download video hack for v. 1.4.2
Post by: hotvins on January 16, 2006, 03:50:58 am
sorry abt posting thing !!

this script was installed by my server using fantastico

I know the procedure to upload the script and setting it up.

Should I download latest version and upload it to my server in other folder ?

I am not able to understand what to check.

Please Help

Thanks

Hotvins
Title: Re: Download video hack for v. 1.4.2
Post by: Joachim Müller on January 16, 2006, 07:33:25 am
Fantastico is buggy and not recommended by the coppermine dev team. Upgrade to cpg1.4.3 using the package we provide.
Title: Re: Download video hack for v. 1.4.2
Post by: hotvins on January 16, 2006, 08:55:53 am
Ok GauGau Bro.

Thanks a lot I shall do that and see what happens but please keep an eye on this thread for atleast two more days from your busy schedule since I may encounter some problems and will be posting in this thread only

Cheers & Good Wishes
Hotvins
Title: Re: Download video hack for v. 1.4.2
Post by: hotvins on January 16, 2006, 05:31:33 pm
I am not getting this thing right

Please tell me again in step by step method
Title: Re: Download video hack for v. 1.4.2
Post by: hotvins on January 16, 2006, 05:44:41 pm
BTW I have installed 1.4.3 but not yet able to get download possible

http://hotvins.300megs.com/vids/
Title: Re: Download video hack for v. 1.4.2
Post by: hotvins on January 17, 2006, 02:16:17 am
Should I edit the theme.php ?
Title: Re: Download video hack for v. 1.4.2
Post by: Paver on January 17, 2006, 02:32:56 am
hotvins: Posting multiple times is not going to help to get a response faster.  The only post in the last 4 you posted that is useful is the one where you said you installed 1.4.3 and gave a link to your site.  The other 3 were really not necessary and can annoy people who want to help.

I looked at your site and here's my suggestion.  Take a look at this line again in your theme.php:
Code: [Select]
$pic_html .= "<p><a href=\"download.php?pid={$CURRENT_PIC_DATA['pid']}\">Click here to download</a></p>";I believe that in the line before this one, you are are missing the ending quotation mark.  Check your lines against the ones in the post above.
Title: Re: Download video hack for v. 1.4.2
Post by: mrandall131 on January 17, 2006, 04:47:07 am
Just to make sure, you are saying that I should copy the entire theme_html_picture function into the theme.php that I am using, and then make the modifications listed in step 2 above?

[edit]
Well, that's just what I did.  Worked perfect.  Thanks for the work guys!
Title: Re: Download video hack for v. 1.4.2
Post by: hotvins on January 17, 2006, 10:54:03 am
Thanks Paver for your reply and Sorry about all the trouble I caused.

I am not at all into php and so you will need to tell me what to edit and where to edit.

I am seeing quotation mark in the file and BTW the classic theme does not contain anything like that code. I can see the code in the theme.inc.php though.

In which of the files I need to edit the code and where ?

displayimage.php
theme.php
theme.inc.php

Also tell me the right code to paste inside the file.

Thanks in Advance

Hotvins
Title: Re: Download video hack for v. 1.4.2
Post by: Joachim Müller on January 17, 2006, 10:59:37 am
edit theme.php. If code that you want to edit appears to be "missing" in your theme, copy the corresponding section from themes/sample/theme.php (that's the reference file). Do not copy the entire content of themes/sample/theme.php, but only the stuff you want to override.
Never, ever edit include/themes.inc.php
Title: Re: Download video hack for v. 1.4.2
Post by: hotvins on January 17, 2006, 11:58:09 am
Thanks GauGau Bro

I did all the procedure and uploaded original versions of displayimage.php and theme.inc.php but still it doesn't work

it shows just a blank page with the letters "RIFFĸ" when I click on "Click here to download" link.

http://hotvins.300megs.com/vids/displayimage.php?album=lastup&cat=0&pos=0

Please help.
Title: Re: Download video hack for v. 1.4.2
Post by: Paver on January 17, 2006, 06:25:41 pm
hotvins:  Something's weird with your download.php script.  You obviously fixed your theme problem because that's all set.  Now download.php doesn't do what it's supposed to do.  Did you copy it exactly as it is shown?  download.php should not put up a banner or anything else; it should just send the header of a file to download.  ... unless your webhost is butting in and messing things up by putting up the banner & Google adwords on every page you post.  I don't know enough about webhosting issues to know if this is possible.
Title: Re: Download video hack for v. 1.4.2
Post by: Joachim Müller on January 18, 2006, 12:20:52 am
I don't know enough about webhosting issues to know if this is possible.
it is, free webhosts do this often. Usually, you can't use pre-made scripts like coppermine with those extremely ad-driven free webhosts, there are only a few exceptions to this rule.
Title: Re: Download video hack for v. 1.4.2
Post by: Paver on January 18, 2006, 12:24:43 am
it is, free webhosts do this often. Usually, you can't use pre-made scripts like coppermine with those extremely ad-driven free webhosts, there are only a few exceptions to this rule.
In that case, I guess the only option is to use a "right click to save" note and then change the theme.php download link to point to the actual video file instead of the download.php script.
Title: Re: Download video hack for v. 1.4.2
Post by: hotvins on January 18, 2006, 02:09:27 am
Quote
In that case, I guess the only option is to use a "right click to save" note and then change the theme.php download link to point to the actual video file instead of the download.php script.

To Paver & GauGau

Can you please tell me how to point it to actual video file instead of the download.php script ?

You see, you might be thinking that why does he dont know anything but I have not coded in php at all. I have just installed version 1.3 once according to instructions and if you can remember GauGau, I also had asked you about adding the code of Google Adsense at that time in the past.

So your detailed help will be appreciated in the current situation because it is not affordable for me to go for a ad free host or paid host at this point of time since I am a student.

Hotvins
Title: Re: Download video hack for v. 1.4.2
Post by: Tranz on January 18, 2006, 02:12:44 am
Are you a college student? Does your school give you webspace?

And you don't have to interpret minimal information as an expectation that you know more than you do. It's just that once we do enough support, we don't want to spend more time than necessary lest the user already knows the information. If not, we will provide more info.
Title: Re: Download video hack for v. 1.4.2
Post by: Paver on January 18, 2006, 02:49:38 am
hotvins: Where you currently have this line:
Code: [Select]
$pic_html .= "<p><a href=\"download.php?pid={$CURRENT_PIC_DATA['pid']}\">Click here to download</a></p>";Replace it with this line:
Code: [Select]
$pic_html .= "<p><a href=\"$picture_url\">Right-click and Save to download video</a></p>";
That should do it.
Title: Re: Download video hack for v. 1.4.2
Post by: nontekkyguy on March 09, 2006, 04:47:41 am
If my theme (in this case fruity theme) does not contain the following:

Hmm, can't find that code in the mac_os_x theme..... any ideas?

Where in my newly updated theme.php would I paste this info, as in before and after which lines. 

This is my theme.php coding:

// HTML template for main menu
$template_sys_menu = <<<EOT
                <div class="topmenu">
                     {BUTTONS}
                </div>
EOT;

// HTML template for template sys_menu spacer
$template_sys_menu_spacer ='';

// HTML template for the image navigation bar
$template_img_navbar = <<<EOT

        <tr>
                <td align="center" valign="middle" class="navmenu" width="48px"><a name="top_display_media"></a>
                        <a href="{THUMB_TGT}" class="navmenu_pic" title="{THUMB_TITLE}"><img src="{LOCATION}images/thumbnails.gif" align="middle" border="0px" alt="{THUMB_TITLE}" /></a>
                </td>
//                <td align="center" valign="middle" class="navmenu" width="48px">
                        <a href="javascript:;" class="navmenu_pic" onclick="blocking('picinfo','yes', 'block'); return false;" title="{PIC_INFO_TITLE}"><img src="{LOCATION}images/info.gif" border="0px" align="middle" alt="{PIC_INFO_TITLE}" /></a>
                </td>
                <td align="center" valign="middle" class="navmenu" width="48px">
                        <a href="{SLIDESHOW_TGT}" class="navmenu_pic" title="{SLIDESHOW_TITLE}"><img src="{LOCATION}images/slideshow.gif" border="0px" align="middle" alt="{SLIDESHOW_TITLE}" /></a>
                </td>
                <td align="center" valign="middle" class="navmenu" width="100%">
                        {PIC_POS}
                </td>
<!-- BEGIN report_file_button -->
                <td align="center" valign="middle" class="navmenu" width="48px">
                        <a href="{REPORT_TGT}" class="navmenu_pic" title="{REPORT_TITLE}"><img src="{LOCATION}images/report.gif" border="0" align="middle" alt="{REPORT_TITLE}" /></a>
                </td>
<!-- END report_file_button -->
<!-- BEGIN ecard_button -->
                <td align="center" valign="middle" class="navmenu" width="48px">
                        <a href="{ECARD_TGT}" class="navmenu_pic" title="{ECARD_TITLE}"><img src="{LOCATION}images/ecard.gif"  border="0px" align="middle" alt="{ECARD_TITLE}" /></a>
                </td>
<!-- END ecard_button -->
                <td align="center" valign="middle" class="navmenu" width="48px">
                        <a href="{PREV_TGT}" class="navmenu_pic" title="{PREV_TITLE}"><img src="{LOCATION}images/prev.gif"  border="0px" align="middle" alt="{PREV_TITLE}" /></a>
                </td>
                <td align="center" valign="middle" class="navmenu" width="48px">
                        <a href="{NEXT_TGT}" class="navmenu_pic" title="{NEXT_TITLE}"><img src="{LOCATION}images/next.gif"  border="0px" align="middle" alt="{NEXT_TITLE}" /></a>
                </td>
        </tr>

EOT;
?>

Title: Re: Download video hack for v. 1.4.2
Post by: Paver on March 09, 2006, 05:58:23 am
@nontekkyguy: First of all, you should use the "CODE" button to bracket code you want to paste into a posting; it makes it so much easier to read.  Second of all, you shouldn't paste code or debug_info unless you are asked to.  In this case, you can merely say your theme.php does not include the code mentioned.

Finally, what code are you referring to?  It is not clear if you mean the $pic_html line I mentioned in the post just above yours or some other line since the line you quote is not clear what you mean.
Title: Re: Download video hack for v. 1.4.2
Post by: Polifem on March 13, 2006, 11:56:29 am
hi ... i`m a novice in php ...

i`ve edited exactly what u said but it seems it doesn't do anything!!!


This is my theme.php

Code: [Select]
<?php
/*************************
  Coppermine Photo Gallery
  ************************
  Copyright (c) 2003-2005 Coppermine Dev Team
  v1.1 originaly written by Gregory DEMAR

  This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation; either version 2 of the License, or
  (at your option) any later version.
  ********************************************
  Coppermine version: 1.4.1
  $Source:
  $Revision: 1.10 $
  $Author:
  $Date: 2005/04/30 07:13:16 $
**********************************************/

define('THEME_HAS_RATING_GRAPHICS'1);
define('THEME_IS_XHTML10_TRANSITIONAL',1);

        
$pic_html  '<object id="'.$player['id'].'" '.$player['classid'].$player['codebase'].$player['mime'].$image_size['whole'].'>';
        
$pic_html .= "<param name=\"autostart\" value=\"$autostart\" /><param name=\"src\" value=\""$picture_url "\" />";
        
$pic_html .= '<embed '.$image_size['whole'].' src="'$picture_url '" autostart="'.$autostart.'" '.$player['mime'].'></embed>';        
$pic_html .= "</object><br />\n";
        
$pic_html .= "<p><a href=\"$picture_url\">Right-click and Save to download video</a></p>";

?>


and this is my download.php


Code: [Select]
<?php
//
// hack to allow downloading of pictures and movies
// see http://forum.coppermine-gallery.net/index.php?topic=6464.0
//
define('IN_COPPERMINE',true);
define('UPLOAD_PHP',true);
define('DOWNLOAD_PHP',true);

require(
'include/init.inc.php');

function 
download()
{
        global 
$CONFIG$lang_upload_php$FORBIDDEN_SET;

        
$pid = (int) $_GET['pid'];

        
$sql 'select '.
                
'p.filepath,'.
                
'p.filesize,'.
                
'p.filename,'.
                
$CONFIG['TABLE_ALBUMS'].'.visibility, '.
                
'p.aid as aid '.
                
'from '.$CONFIG['TABLE_PICTURES'].' as p LEFT JOIN '.$CONFIG['TABLE_ALBUMS'].
                
' ON (p.aid = ' $CONFIG['TABLE_ALBUMS'].'.aid ) '.
                
' where pid='.$pid.' and approved="YES"';

        if (!empty(
$FORBIDDEN_SET)) {
                
$sql .= ' and '.$FORBIDDEN_SET;
        }

        
$result cpg_db_query($sql);

        
// No data returned; Display an error page
        
if (mysql_num_rows($result)==0) {
                
mysql_free_result($result);
                
cpg_die(CRITICAL_ERROR,$lang_upload_php['unknown']);
        }

        
$file mysql_fetch_assoc($result);
        
mysql_free_result($result);

        
// Empty output buffer
        
while(ob_get_level()>0) {
                
ob_end_clean();
        }

        
// Send binary information to the browser
        
header("Content-type: application/octet-stream");
        
header("Content-disposition: attachment; filename=".$file['filename']);
        
header("Content-Length: ".$file['filesize']);
        
header("Pragma: no-cache");
        
header("Expires: 0");
        
readfile($CONFIG['fullpath'].$file['filepath'].$file['filename']);
}

download();
?>

my page is www.insomniaracing.org/gallery !!!


plz ... does anyone notice something fishy?
Title: Re: Download video hack for v. 1.4.2
Post by: Paver on March 13, 2006, 07:24:46 pm
Your problem is in your theme.php; you are not customizing theme.php correctly.  You need to copy the entire function or variable you want to customize from sample/theme.php.  You only copied a few lines.  If you read this entire thread, particularly mrandall's note about copying the theme_html_picture function, you'll understand better how to get this customization working.

Copy the entire theme_html_picture function from sample/theme.php into your theme.php, then modify the lines in that function.
Title: Re: Download video hack for v. 1.4.2
Post by: wuurp on March 16, 2006, 05:05:49 am
How can I prevent unregistered users from using this to download videos?

I've used the solution in the FAQ of limiting unregistered users to thumbnails only, and I've also edited httpd.conf to prevent direct linking to video types. But if someone just directly uses a link like this http://www.mygallery.net/download.php?pid=176 they can download the video or hotlink to it on their site.

Can I just use the same code from the FAQ, i.e.
Code: [Select]
if (!USER_ID) cpg_die(ERROR, 'You need to register to access this page', __FILE__, __LINE__);
and if so, would it go after the line
Code: [Select]
require('include/init.inc.php');
Title: Re: Download video hack for v. 1.4.2
Post by: Paver on March 16, 2006, 07:38:38 am
Sounds good to me.  Why not try it out?
Title: Re: Download video hack for v. 1.4.2
Post by: wuurp on March 21, 2006, 03:18:55 am
I waited a few days as a "courtesy" to all those who hotlinked and then tried it out. Seems to work fine. I guess I was just being overly cautious in messing with code I haven't really worked with.

Thanks.
Title: Re: Download video hack for v. 1.4.2
Post by: wuurp on April 09, 2006, 03:42:48 am
I wasn't sure if I should add to this thread, or start a new topic, but I am having memory problems using this hack.

I've been using it without problems for a couple months, but in the last few days, I have had problems running out of memory. What seems to be happening is that while the file is being downloaded, the particulary httpd thread starts consuming more memory. So if I have an 80MB file, at the end of the download, that thread is using 80+MB. After the download finishes, usually the memory is released, but not always apparently, so after a day each httpd thread was using 16-20MB even when idle. Add in a few large downloads and soon apache is using 100's of MB. I just recently updated to 1.4.4 but a clean install of both 1.4.2 and 1.4.4 exhibit this behaviour.

The only change I know of on the server is going from a 2.4 to a 2.6.8 kernel which is about the time I started having memory problems.

I've had to go back to just using a download link, which doesn't have any significant effect on the amount of memory used, but I'd like to use this again if someone has an idea how to fix it.

Title: Re: Download video hack for v. 1.4.2
Post by: superstan on October 14, 2006, 10:37:29 pm
Please can you help me with this

There is no code that looks like anything you suggest on the 1st post - that i can alter in theme.php(rainyday)

when i go to the sample theme.php - im not sure which code i need -
there is something about 'if a user has no plugin' that looks like it - but i dont know how much of the code i need

whateverr i try i get syntax errors - unexpected {{
Title: Re: Download video hack for v. 1.4.2
Post by: superstan on October 14, 2006, 10:55:42 pm
hi guys ive sorted it in fashion by copying the whole of the sample theme.php to my template theme.php - but it does spoil the look of the mavigation a bit - but at least it works

why do i have negative karma - what have I done  ???
Title: Re: Download video hack for v. 1.4.2
Post by: Tranz on October 14, 2006, 11:58:26 pm
hi guys ive sorted it in fashion by copying the whole of the sample theme.php to my template theme.php - but it does spoil the look of the mavigation a bit - but at least it works
You shouldn't have copied all of sample theme.php... just the function(s) you want to modify.
Title: Re: Download video hack for v. 1.4.2
Post by: Paver on October 15, 2006, 03:19:24 am
why do i have negative karma - what have I done  ???

See: How/why do you get negative karma? (http://forum.coppermine-gallery.net/index.php?topic=26826.0)
Title: Re: Download video hack for v. 1.4.2
Post by: Joachim Müller on October 15, 2006, 02:00:39 pm
copying the whole of the sample theme.php to my template theme.php
You mustn't do that. Only copy the section you want to see changed, not the entire content of themes/sample/theme.php
Title: Re: Download video hack for v. 1.4.2
Post by: Glorn on February 26, 2007, 06:28:01 am
With this hack in place, IE works just fine for downloading.

However, Firefox reads all files as filetype "application/octet-stream" and then saves them as such.

I know that this is from the download.php code, but does anyone know why Firefox is doing this and IE is not?

And if so, can I correct it so that Firefox recoginzes the appropriate filetype?






Thank you,

Glorn H.
Title: Re: Download video hack for v. 1.4.2
Post by: gldickens3 on November 21, 2007, 06:23:54 am
Hello,

I have a very strange problem for which I would like some guidance.

I successfully implemented this Download Video Hack modification and it works great;  That is, it works great for clients running Windows with Windows Media Player.  However, videos cease functioning once this hack is implemented on clients running Linux with the MPlayer Plug-In For Firefox.  I have tested this extensively with CentOS 5 running MPlayer version 1.0rc2 along with Mplayer Plug-In version 3.45.  I compiled both Mplayer and the Mplayer Plug-In from source and they both otherwise work great.

I have two websites running very similar copies of Coppermine.  I discovered that when I implemented the Download Video Hack on both websites that the MPlayer Plug-In quit working for both websites and that the Mplayer Plug-In began working again when I reverted back to the code without the Download Video Hack.  So, to demonstrate, I have set one website up with the Download Video Hack and set the other website up without the Download Video Hack.  Here are a couple of samples of each:

Two Videos Without Download Video Hack can be viewed at:

http://www.dickens.com/gallery/thumbnails.php?album=24

Two Videos With Download Video Hack:

http://georgiajets.org/gallery/thumbnails.php?album=24
http://georgiajets.org/gallery/thumbnails.php?album=31

The dickens.com site has not implemented the Download Video Hack whereas the georgiajets.org site has.  So, playing any of the videos on either of the sites will demonstrate what I am describing.  Please keep in mind that the client must be running MPlayer with the MPlayer Plug-In for Firefox in order to replicate this problem.

This problem may very well be caused by an issue with the MPlayer Plug-In instead of Coppermine but I wanted to see if anybody had observed this phenomona and whether there is a known work around.  I say this primarily since the Download Video Hack appears to work fine under Windows with Windows Media Player.  I am hopeful that someone has already found a solution.  I have played around with the code some but I cannot make it work.  All the while, I will readily admit that this hack shouldn't affect any media player.

I hope that this is the proper thread under which to post this issue.

Many thanks in advance for your reply.

Gordon Dickens
Title: Re: Download video hack for v. 1.4.2
Post by: gldickens3 on November 21, 2007, 09:33:21 pm
OK.  I solved my own problem.  My theme is a custom theme and uses the variable "clsid" instead of "classid" in the code that is modified for this hack.  As soon as I changed the variable "classid" in the modified code back to "clsid" then the MPlayer Plug-in started working with this hack.  I don't really understand why it was working in Windows Media Player and not with MPlayer Plug-In but I now have it working properly in both places.

FYI,

Gordon