ciao,
sono riuscito a far uscire la scritta però quando ci clicco sopra.. che sia un immagine o documento mi scarica un file picture senza estensione
dove sbaglio?
ecco i miei codice:
codebase.php
<?php
/**************************************************
CPG Movie Download Link Plugin for Coppermine Photo Gallery
*************************************************
Copyright (c) 2006 Thomas Lange <stramm@gmx.net>
*************************************************
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.10
CPG Movie Download Link Plugin version: 1.1
$Revision: 1.0 $
$Author: stramm $
***************************************************/
if (!defined('IN_COPPERMINE')) die('Not in Coppermine...');
$thisplugin->add_filter('file_data','download_link_add_data');
function download_link_add_data($pic_data){
global $CONFIG;
$fullsize_url = get_pic_url($pic_data);
$mime_content = cpg_get_type($pic_data['filename']);
if ($mime_content['content']=='movie') {
$download_link_data = ' <a class="admin_menu" href="index.php?file=movie_download/down&link=' .$fullsize_url.'" title="Download">DOWNLOAD VIDEO</a>';
}
if ($mime_content['content']=='document') {
$download_link_data = ' <a class="admin_menu" href="index.php?file=movie_download/down&link=' .$fullsize_url.'" title="Download">DOWNLOAD DOCUMENT</a>';
}
if ($mime_content['content']=='image') {
$download_link_data = ' <a class="admin_menu" href="index.php?file=movie_download/down&link=' .$fullsize_url.'" title="Download">DOWNLOAD IMMAGINE</a>';
}
$pic_data['html'] = $pic_data['html'].$download_link_data;
return $pic_data;
}
?>
down.php
<?php
/**************************************************
CPG Movie Download Link Plugin for Coppermine Photo Gallery
*************************************************
Copyright (c) 2006 Thomas Lange <stramm@gmx.net>
*************************************************
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.10
CPG Movie Download Link Plugin version: 1.1
$Revision: 1.0 $
$Author: stramm $
***************************************************/
$link = isset($_REQUEST['link']) ? $_REQUEST['link'] : null;
header( 'Content-type: application/octet-stream' );
header( 'Content-Length: ' . filesize( $link ) );
header( 'Content-Disposition: attachment; filename="' . basename( $link ) . '"' );
readfile( $link );
?>
configuration.php
<?php
$name='Movie Download Link Plugin ';
$description='This plug-in displays a download link below a movie in intermediate view';
$author='Thomas Lange - Stramm <a href="mailto:stramm@gmx.net">stramm@gmx.net</a>)';
$version='1.0';
?>
grazie
elvis