forum.coppermine-gallery.net
Support => cpg1.3.x Support => Older/other versions => cpg1.3 Miscellaneous => Topic started by: poubao on August 06, 2004, 10:22:16 pm
-
bonsoir,
i modify include/slideshow.inc.php and add a jsscript and you can listen music when you view your
photos in slides show.
Démo at: http://cpalaos.cabiddu.net/displayimage.php?album=1&pid=6&slideshow=7000
-
care to post your modifications as a hack?
GauGau
-
bonsoir gaugau,
yes if you want,any script for music can work
i post the script i have,it's not mine but i have not the Name of the author for contribute :-[
<!-- beginning of script-->
<SCRIPT LANGUAGE=javascript>
titreMP3 = new Array;
cheminMP3 = new Array;
titreMP3[0] = "Sao phou thac khoy hack";title of music
cheminMP3[0] = "http://cpalaos.cabiddu.net/music/lamlao02.ra";path of music file
titreMP3[1] = "insert the title";
cheminMP3[1] = "insert the path of your music file";
titreMP3[2] = "Lamlao03";
cheminMP3[2] = "http://cpalaos.cabiddu.net/music/lamlao03.ra";
titreMP3[3] = "Lamlao04";
cheminMP3[3] = "http://cpalaos.cabiddu.net/music/lamlao04.ra";
function ChangeMp3(formulaire)
{
numero = formulaire.ListeMP3.options[formulaire.ListeMP3.selectedIndex].value;
if(document.getElementById && document.all && numero != "")
{
document.getElementById("blocson").innerHTML = "<EMBED SRC=\""+cheminMP3[numero]+"\" AUTOSTART=TRUE WIDTH=1 HEIGHT=1>";
}
}
if(document.getElementById && document.all)
{
document.write("<FORM><SELECT NAME=ListeMP3 onChange=\"ChangeMp3(this.form)\">")
document.write("<OPTION VALUE=''> Choix musique (choice music)\n");
for(i=0;i<cheminMP3.length;i++)
{
document.write("<OPTION VALUE=\""+i+"\"> "+titreMP3+"\n");
}
document.write('</SELECT></FORM><DIV ID=blocson></DIV>')
}
</SCRIPT>
<!-- end script-->
delete red text and change title and path of music files
you can add many music .ra,.mp3,midi,.... JUST HAVE THE GOOD PLUG IN
-
could someone confirm this hack works?
GauGau
-
hi,
I send the jsscript to hama he use .mp3 audio files,and I use .ra audio files
to the hama slideshow http://www.dorfschule.ch/copper/displayimage.php?album=74&pid=3672&slideshow=5000 it's work !!! ;)
poubao
the script : replace in the first part "title of your music" with the title,replace "path of your music file" as "http://your site/music/your music.mp3"
<SCRIPT LANGUAGE=javascript>
titreMP3 = new Array;
cheminMP3 = new Array;
titreMP3[1] = "title of your music";
cheminMP3[1] = "path of your music file";
titreMP3[2] = "title of your music";
cheminMP3[2] = "path of your music file";
titreMP3[3] = "title of your music";
cheminMP3[3] = "path of your music file";
function ChangeMp3(formulaire)
{
numero = formulaire.ListeMP3.options[formulaire.ListeMP3.selectedIndex].value;
if(document.getElementById && document.all && numero != "")
{
document.getElementById("blocson").innerHTML = "<EMBED SRC=\""+cheminMP3[numero]+"\" AUTOSTART=TRUE WIDTH=1 HEIGHT=1>";
}
}
if(document.getElementById && document.all)
{
document.write("<FORM><SELECT NAME=ListeMP3 onChange=\"ChangeMp3(this.form)\">")
document.write("<OPTION VALUE=''> Choix musique (choice music)\n");
for(i=0;i<cheminMP3.length;i++)
{
document.write("<OPTION VALUE=\""+i+"\"> "+titreMP3+"\n");
}
document.write('</SELECT></FORM><DIV ID=blocson></DIV>')
}
</SCRIPT>
<!-- FIN DU SCRIPT -->
-
Doesn't work with Firefox - there's no drop down box to choose music from.
-
I like this Mod. I have installed this and it works. I added a stop Music In the drop down box to turn the Music off. Nice job poubao. Take a look here. :)
Demo: SlideShow (http://www.thepcwarzone.com/gallery/displayimage.php?album=8&pid=87&slideshow=5000)
To Login: Username: Test
Password: Test
-
will it make a difference that my pages are in English when this script isn't in english, or should it work anyway? Because I have put the script in and it isn't working. Do I have to modify any other files?
Here is what the code for include/slideshow.inc.php looks like right now, have I done something wrong??
<?php
// ------------------------------------------------------------------------- //
// Coppermine Photo Gallery 1.3.1 //
// ------------------------------------------------------------------------- //
// Copyright (C) 2002-2004 Gregory DEMAR //
// http://www.chezgreg.net/coppermine/ //
// ------------------------------------------------------------------------- //
// Updated by the Coppermine Dev Team //
// (http://coppermine.sf.net/team/) //
// see /docs/credits.html for details //
// ------------------------------------------------------------------------- //
// 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. //
// ------------------------------------------------------------------------- //
// CVS version: $Id: slideshow.inc.php,v 1.5 2004/07/09 06:57:56 gaugau Exp $
// ------------------------------------------------------------------------- //
?>
<script language="JavaScript" type="text/JavaScript">
// (C) 2000 www.CodeLifter.com
// http://www.codelifter.com
// Free for all users, but leave in this header
// NS4-6,IE4-6
// Fade effect only in IE; degrades gracefully
// $Id: slideshow.inc.php,v 1.5 2004/07/09 06:57:56 gaugau Exp $
// Set slideShowSpeed (milliseconds)
var slideShowSpeed = <?php echo (int)$HTTP_GET_VARS['slideshow'] ?>
// Agent sniffer shamelessly 'stolen' from the excellent X library from cross-browser.com
var xOp7=false,xOp5or6=false,xIE4Up=false,xNN4=false,xUA=navigator.userAgent.toLowerCase();
if(window.opera){
xOp7=(xUA.indexOf('opera 7')!=-1 || xUA.indexOf('opera/7')!=-1);
if (!xOp7) xOp5or6=(xUA.indexOf('opera 5')!=-1 || xUA.indexOf('opera/5')!=-1 || xUA.indexOf('opera 6')!=-1 || xUA.indexOf('opera/6')!=-1);
}
else if(document.layers) xNN4=true;
else {xIE4Up=document.all && xUA.indexOf('msie')!=-1 && parseInt(navigator.appVersion)>=4;}
// Duration of crossfade (seconds)
var crossFadeDuration = 3
// Specify the image files
var Pic = new Array() // don't touch this
// to add more images, just continue
// the pattern, adding to the array below
<?php
$i = 0;
$j = 0;
$pid = (int)$HTTP_GET_VARS['pid'];
$start_img = '';
$pic_data = get_pic_data($HTTP_GET_VARS['album'], $pic_count, $album_name, -1, -1, false);
foreach ($pic_data as $picture) {
if($CONFIG['thumb_use']=='ht' && $picture['pheight'] > $CONFIG['picture_width'] ){ // The wierd comparision is because only picture_width is stored
$condition = true;
}elseif($CONFIG['thumb_use']=='wd' && $picture['pwidth'] > $CONFIG['picture_width']){
$condition = true;
}elseif($CONFIG['thumb_use']=='any' && max($picture['pwidth'], $picture['pheight']) > $CONFIG['picture_width']){
$condition = true;
}else{
$condition = false;
}
if (is_image($picture['filename'])) {
if ($CONFIG['make_intermediate'] && $condition ) {
$picture_url = get_pic_url($picture, 'normal');
} else {
$picture_url = get_pic_url($picture, 'fullsize');
}
echo "Pic[$i] = '" . $picture_url . "'\n";
if ($picture['pid'] == $pid) {
$j = $i;
$start_img = $picture_url;
}
$i++;
}
}
?>
var t
var j = <?php echo "$j\n" ?>
var p = Pic.length
var pos = j
var preLoad = new Array()
function preLoadPic(index)
{
if (Pic[index] != ''){
window.status='Loading : '+Pic[index]
preLoad[index] = new Image()
preLoad[index].src = Pic[index]
Pic[index] = ''
window.status=''
}
}
function runSlideShow(){
if (xIE4Up){
document.images.SlideShow.style.filter="blendTrans(duration=2)"
document.images.SlideShow.style.filter= "blendTrans(duration=crossFadeDuration)"
document.images.SlideShow.filters.blendTrans.Apply()
}
document.images.SlideShow.src = preLoad[j].src
if (xIE4Up){
document.images.SlideShow.filters.blendTrans.Play()
}
pos = j
j = j + 1
if (j > (p-1)) j=0
t = setTimeout('runSlideShow()', slideShowSpeed)
preLoadPic(j)
}
function endSlideShow(){
self.document.location = 'displayimage.php?album=<?php echo isset($HTTP_GET_VARS['album']) ? $HTTP_GET_VARS['album'] : '';
echo isset($HTTP_GET_VARS['cat']) ? '&cat=' . $HTTP_GET_VARS['cat'] : '' ?>&pos='+pos
}
preLoadPic(j)
</script>
<SCRIPT LANGUAGE=javascript>
titleeMP3 = new Array;
cheminMP3 = new Array;
titreMP3[1] = "Whatever";
cheminMP3[1] = "http://princesserica.net/Proud/PicturePlayground/whatever2.mp3";
titreMP3[2] = "title of your music";
cheminMP3[2] = "path of your music file";
titreMP3[3] = "title of your music";
cheminMP3[3] = "path of your music file";
function ChangeMp3(formulaire)
{
numero = formulaire.ListeMP3.options[formulaire.ListeMP3.selectedIndex].value;
if(document.getElementById && document.all && numero != "")
{
document.getElementById("blocson").innerHTML = "<EMBED SRC=\""+cheminMP3[numero]+"\" AUTOSTART=TRUE WIDTH=1 HEIGHT=1>";
}
}
if(document.getElementById && document.all)
{
document.write("<FORM><SELECT NAME=ListeMP3 onChange=\"ChangeMp3(this.form)\">")
document.write("<OPTION VALUE=''> Choix musique (choice music)\n");
for(i=0;i<cheminMP3.length;i++)
{
document.write("<OPTION VALUE=\""+i+"\"> "+titreMP3+"\n");
}
document.write('</SELECT></FORM><DIV ID=blocson></DIV>')
}
</SCRIPT>
<!-- FIN DU SCRIPT -->
-
This How I installed it. Just fill in the blanks for your Music.
<?php
// ------------------------------------------------------------------------- //
// Coppermine Photo Gallery 1.3.1 //
// ------------------------------------------------------------------------- //
// Copyright (C) 2002-2004 Gregory DEMAR //
// http://www.chezgreg.net/coppermine/ //
// ------------------------------------------------------------------------- //
// Updated by the Coppermine Dev Team //
// (http://coppermine.sf.net/team/) //
// see /docs/credits.html for details //
// ------------------------------------------------------------------------- //
// 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. //
// ------------------------------------------------------------------------- //
// CVS version: $Id: slideshow.inc.php,v 1.5 2004/07/09 06:57:56 gaugau Exp $
// ------------------------------------------------------------------------- //
?>
<SCRIPT LANGUAGE=javascript>
titreMP3 = new Array;
cheminMP3 = new Array;
titreMP3[0] = "title of your music";
cheminMP3[0] = "path of your music file";
titreMP3[1] = "title of your music";
cheminMP3[1] = "path of your music file";
titreMP3[2] = "title of your music";
cheminMP3[2] = "path of your music file";
titreMP3[3] = "title of your music";
cheminMP3[3] = "path of your music file";
titreMP3[4] = "title of your music";
cheminMP3[4] = "path of your music file";
titreMP3[5] = "title of your music";
cheminMP3[5] = "path of your music file";
titreMP3[6] = "title of your music";
cheminMP3[6] = "path of your music file";
titreMP3[7] = "title of your music";
cheminMP3[7] = "path of your music file";
titreMP3[8] = "title of your music";
cheminMP3[8] = "path of your music file";
titreMP3[9] = "title of your music";
cheminMP3[9] = "path of your music file";
titreMP3[10] = "Stop Music";
cheminMP3[10] = "Stop";
function ChangeMp3(formulaire)
{
numero = formulaire.ListeMP3.options[formulaire.ListeMP3.selectedIndex].value;
if(document.getElementById && document.all && numero != "")
{
document.getElementById("blocson").innerHTML = "<EMBED SRC=\""+cheminMP3[numero]+"\" AUTOSTART=TRUE WIDTH=1 HEIGHT=1>";
}
}
if(document.getElementById && document.all)
{
document.write("<FORM><SELECT NAME=ListeMP3 onChange=\"ChangeMp3(this.form)\">")
document.write("<OPTION VALUE=''> Select Music\n");
for(i=0;i<cheminMP3.length;i++)
{
document.write("<OPTION VALUE=\""+i+"\"> "+titreMP3[i]+"\n");
}
document.write('</SELECT></FORM><DIV ID=blocson></DIV>')
}
</SCRIPT>
<!-- FIN DU SCRIPT -->
<script language="JavaScript" type="text/JavaScript">
// (C) 2000 www.CodeLifter.com
// http://www.codelifter.com
// Free for all users, but leave in this header
// NS4-6,IE4-6
// Fade effect only in IE; degrades gracefully
// $Id: slideshow.inc.php,v 1.5 2004/07/09 06:57:56 gaugau Exp $
// Set slideShowSpeed (milliseconds)
var slideShowSpeed = <?php echo (int)$HTTP_GET_VARS['slideshow'] ?>
// Agent sniffer shamelessly 'stolen' from the excellent X library from cross-browser.com
var xOp7=false,xOp5or6=false,xIE4Up=false,xNN4=false,xUA=navigator.userAgent.toLowerCase();
if(window.opera){
xOp7=(xUA.indexOf('opera 7')!=-1 || xUA.indexOf('opera/7')!=-1);
if (!xOp7) xOp5or6=(xUA.indexOf('opera 5')!=-1 || xUA.indexOf('opera/5')!=-1 || xUA.indexOf('opera 6')!=-1 || xUA.indexOf('opera/6')!=-1);
}
else if(document.layers) xNN4=true;
else {xIE4Up=document.all && xUA.indexOf('msie')!=-1 && parseInt(navigator.appVersion)>=4;}
// Duration of crossfade (seconds)
var crossFadeDuration = 3
// Specify the image files
var Pic = new Array() // don't touch this
// to add more images, just continue
// the pattern, adding to the array below
<?php
$i = 0;
$j = 0;
$pid = (int)$HTTP_GET_VARS['pid'];
$start_img = '';
$pic_data = get_pic_data($HTTP_GET_VARS['album'], $pic_count, $album_name, -1, -1, false);
foreach ($pic_data as $picture) {
if($CONFIG['thumb_use']=='ht' && $picture['pheight'] > $CONFIG['picture_width'] ){ // The wierd comparision is because only picture_width is stored
$condition = true;
}elseif($CONFIG['thumb_use']=='wd' && $picture['pwidth'] > $CONFIG['picture_width']){
$condition = true;
}elseif($CONFIG['thumb_use']=='any' && max($picture['pwidth'], $picture['pheight']) > $CONFIG['picture_width']){
$condition = true;
}else{
$condition = false;
}
if (is_image($picture['filename'])) {
if ($CONFIG['make_intermediate'] && $condition ) {
$picture_url = get_pic_url($picture, 'normal');
} else {
$picture_url = get_pic_url($picture, 'fullsize');
}
echo "Pic[$i] = '" . $picture_url . "'\n";
if ($picture['pid'] == $pid) {
$j = $i;
$start_img = $picture_url;
}
$i++;
}
}
?>
var t
var j = <?php echo "$j\n" ?>
var p = Pic.length
var pos = j
var preLoad = new Array()
function preLoadPic(index)
{
if (Pic[index] != ''){
window.status='Loading : '+Pic[index]
preLoad[index] = new Image()
preLoad[index].src = Pic[index]
Pic[index] = ''
window.status=''
}
}
function runSlideShow(){
if (xIE4Up){
document.images.SlideShow.style.filter="blendTrans(duration=2)"
document.images.SlideShow.style.filter= "blendTrans(duration=crossFadeDuration)"
document.images.SlideShow.filters.blendTrans.Apply()
}
document.images.SlideShow.src = preLoad[j].src
if (xIE4Up){
document.images.SlideShow.filters.blendTrans.Play()
}
pos = j
j = j + 1
if (j > (p-1)) j=0
t = setTimeout('runSlideShow()', slideShowSpeed)
preLoadPic(j)
}
function endSlideShow(){
self.document.location = 'displayimage.php?album=<?php echo isset($HTTP_GET_VARS['album']) ? $HTTP_GET_VARS['album'] : '';
echo isset($HTTP_GET_VARS['cat']) ? '&cat=' . $HTTP_GET_VARS['cat'] : '' ?>&pos='+pos
}
preLoadPic(j)
</script>
-
Thank you so much, that worked like a charm ;)
-
Any plans on making this work with browsers other than IE? I still haven't seen cross-browser functionality.
-
Thank you so much, that worked like a charm ;)
No problem.
-
Any plans on making this work with browsers other than IE? I still haven't seen cross-browser functionality.
I am not sure how to do that. Maybe someone eles can help.
-
This script work under firefox ! ;)
http://cpalaos.cabiddu.net/displayimage.php?album=lastup&cat=30&pid=1462&slideshow=7000 (http://cpalaos.cabiddu.net/displayimage.php?album=lastup&cat=30&pid=1462&slideshow=7000)
sorry songs are in .ra (realplayer) ;D
<!-- DEBUT DU SCRIPT -->
<SCRIPT LANGUAGE=javascript>
titreMP3 = new Array;
cheminMP3 = new Array;
titreMP3[0] = "title of song";
cheminMP3[0] = "http://your domaine.com/music/name file.mp3";
titreMP3[1] = "title of song";
cheminMP3[1] = "http://your domaine.com/music/name file.mp3";
titreMP3[2] = "title of song";
cheminMP3[2] = "http://your domaine.com/music/name file.mp3";
titreMP3[3] = "title of song";
cheminMP3[3] = "http://your domaine.com/music/name file.mp3";
titreMP3[4] = "title of song";
cheminMP3[4] = "http://your domaine.com/music/name file.mp3";
titreMP3[5] = "title of song";
cheminMP3[5] = "http://your domaine.com/music/name file.mp3";
function ChangeMp3(formulaire)
{
numero = formulaire.ListeMP3.options[formulaire.ListeMP3.selectedIndex].value;
if((document.getElementById || document.all) && numero != "")
{
document.getElementById("blocson").innerHTML = "<EMBED SRC=\""+cheminMP3[numero]+"\" AUTOSTART=TRUE WIDTH=1 HEIGHT=1 type=\"audio/mpeg\" />";
}
}
if(document.getElementById || document.all)
{
document.write("<FORM><SELECT NAME=ListeMP3 onChange=\"ChangeMp3(this.form)\">")
document.write("<OPTION VALUE=''> Choix musique (choice music)\n");
for(i=0;i<cheminMP3.length;i++)
{
document.write("<OPTION VALUE=\""+i+"\"> "+titreMP3+"\n");
}
document.write('</SELECT></FORM><DIV ID=blocson></DIV>')
}
</SCRIPT>
<!-- FIN DU SCRIPT -->
just download music plugin for firefox
poubao :D