forum.coppermine-gallery.net
Support => Italian (Italiano) => Closed boards => Language Specific Support => cpg1.4.x Italian (Italiano) => Topic started by: Aquilasfx on October 28, 2007, 07:44:42 pm
-
Uso l'ultima versione del coppermine e la mod movie_download rivisitata per permettere il download delle immagini; se volessi far scaricare la foto solo ai registrati? Permettere la visualizzazione ma disabilitare il tasto destro. Quindi solo se registrati vedere link che permette il download? E' possibile?
-
Avendo io scarsissime conoscenze per la manipolazione del codice, ho chiesto nel thread di annuncio di questo plugin se qualcuno sa come fare ;-)
Ti tengo al corrente appena qualcuno ci aiuta. Se, per caso, qualcuno (italiano) con maggiori conoscenze sa come farlo... noi siamo qui!
-
just_some_guy (http://forum.coppermine-gallery.net/index.php?action=profile;u=47152) suggerisce di provare questo blocco di codice al plugin.
<?php
$result = mysql_query("SELECT user_name FROM {$CONFIG['TABLE_USERS']} WHERE user_group = Registered AND uid = $uid");
if {
mysql_num_rows($result) == 0;
echo 'Registered user function';
} else {
?>
Aggiungi anche un segno } alla fine del file prima di ?>
Facci sapere se funziona!
-
just_some_guy (http://forum.coppermine-gallery.net/index.php?action=profile;u=47152) suggerisce di provare questo blocco di codice al plugin.
<?php
$result = mysql_query("SELECT user_name FROM {$CONFIG['TABLE_USERS']} WHERE user_group = Registered AND uid = $uid");
if {
mysql_num_rows($result) == 0;
echo 'Registered user function';
} else {
?>
Aggiungi anche un segno } alla fine del file prima di ?>
Facci sapere se funziona!
Dove lo devo aggiungere? Dentro lo script codebase.php ?
-
C'è una migliore soluzione proposta dallo stesso Stramm, autore del plugin.
Apri codebase.php e aggiungi
if(!USER_ID) return $pic_data;
dopo
global $CONFIG;
L'ho provato sulla mia galleria e funziona ;-)
-
Uso l'ultima versione del coppermine e la mod movie_download rivisitata per permettere il download delle immagini; se volessi far scaricare la foto solo ai registrati? Permettere la visualizzazione ma disabilitare il tasto destro. Quindi solo se registrati vedere link che permette il download? E' possibile?
ciao dove trovo la mod movie_download?
-
ciao dove trovo la mod movie_download?
Hai richiesto la stessa cosa QUI (http://forum.coppermine-gallery.net/index.php?topic=47962.0).
-
Ciao,
ho scaricato il plugin... solo che non mi appare nessun pulsante con la scritta download...
ho cercato nel codebase.php questo
if(!USER_ID) return $pic_data;
ma non c'è
devo aggiungerlo io?
elvis
-
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
-
Ciao,
ho scaricato il plugin... solo che non mi appare nessun pulsante con la scritta download...
ho cercato nel codebase.php questo
if(!USER_ID) return $pic_data;
ma non c'è
devo aggiungerlo io?
elvis
Sì devi aggiungerlo tu.
Un link alla tua galleria per vedere cosa non funziona?
-
ecco qua il link.
http://www.elvisq.it/cpg1413/displayimage.php?album=6&pos=4 (http://www.elvisq.it/cpg1413/displayimage.php?album=6&pos=4)
se io clicco sopra al link mi fa scaricare un file picture
help me!!
grazie
elvis
-
Il codice corretto (quantomeno funziona sulla mia galleria!) dovrebbe essere il seguente (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;
if(!USER_ID) return $pic_data;
$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 DOCUMENT</a>';
$pic_data['html'] = $pic_data['html'].$download_link_data;
return $pic_data;
}
?>
-
il codice corretto è questo!!
<?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;
if(!USER_ID) return $pic_data;
$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;
}
?>
ciao a tutti!! :D ;) ;)