Advanced search  

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Pages: 1 [2]   Go Down

Author Topic: Self-contained Slideshow?  (Read 30798 times)

0 Members and 1 Guest are viewing this topic.

Slideshow Bob

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 20
Re: Self-contained Slideshow?
« Reply #20 on: September 05, 2006, 03:12:36 am »

OK, now I see what's going on.  For starters, the script can work with the development code.  However, it needs to be adjusted slightly.

the image stmt needs to be changed from: <img src="" name='SlideShow'>
to:  <img src="xxx" name='SlideShow'> where xxx is the url of the 1st random image generated by the PHP script.

somehow, a <blockquote></blockquote> stmt gets inserted before the PIC[a++] stmts. that should come out.  There are also a number of PIC statements where the picture name and part of the url is blank.

be sure to include a </head> stmt in the html.  In add'n, there's a </td> tag towards the end of the html which should be removed
« Last Edit: September 05, 2006, 03:41:55 am by Slideshow Bob »
Logged

vuud

  • Moderator
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1803
  • [cpmfetch.fistfullofcode.com]
    • Fist Full Of Code
Re: Self-contained Slideshow?
« Reply #21 on: September 05, 2006, 04:05:22 am »

OK, now I see what's going on.  For starters, the script can work with the development code.  However, it needs to be adjusted slightly.

the image stmt needs to be changed from: <img src="" name='SlideShow'>
to:  <img src="xxx" name='SlideShow'> where xxx is the url of the 1st random image generated by the PHP script.


Yep, I mentioned that with the code I posted.  I was thinking someone could rig up something in the javascript to set that right off the bat, instead of hard coding the src tag.

Quote
somehow, a <blockquote></blockquote> stmt gets inserted before the PIC[a++] stmts. that should come out.  There are also a number of PIC statements where the picture name and part of the url is blank.

Yeah, I noticed that also - fixed in the dev version I am working on now... if you want to get rid of it, open up cpmfetch_dao.php in an editor and search for

Code: [Select]
$this->debugPrint(mysql_error($this->dbconnection));
Then comment it out with // in front of it.

That was actually a pain to find...   

Quote
be sure to include a </head> stmt in the html.  In add'n, there's a </td> tag towards the end of the html which should be removed

Your right - sloppy html on my part.  I will edit my original post of the solution with this...

Thanks
Logged
Please post for help to the forum... PM me only if you are sending security related items (passwords, security problems, etc).

cpmFetch - Images, RSS feeds from CPG from outside CPG
New release notification signup also. 
See http://cpmfetch.fistfullofco

Slideshow Bob

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 20
Re: Self-contained Slideshow?
« Reply #22 on: September 05, 2006, 04:13:26 am »

whoohoo!  It works!

Is there a way to get rid of the random blank filename/urls?  If so, then it'll work 100%

Here's an example of one of 'em:

Pic[a++]='http://www.mysite.org/coppermine//images/'
Logged

Slideshow Bob

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 20
Re: Self-contained Slideshow?
« Reply #23 on: September 05, 2006, 04:49:02 am »

Here's some updated (working) code.  It fixes the symptom of the blank file URL, but not the cause.

Note: it only seems to work when called directly from the cpmfetch directory.  Even when adjusting the include variable...

<script>
var slideShowSpeed = 9000
var crossFadeDuration = 5
var Pic = new Array()
var a = 0

<?php
include "./cpmfetch.php";
$objCpm = new cpm();
$objCpm->cpm_setReturnType("resultset");
$data = $objCpm->cpm_viewRandomMediaFrom(1000, 1000, "");
$counter=0;

foreach ($data as $row) {
   $imagename = $objCpm->getImageToUse($row['pFilepath'], $row['pFilename'] ,"normal_");
   if(substr($imagename,strlen($imagename)-1,1)=="/")continue;
   if($counter++ > 20)break;
   print "Pic[a++]='" . $imagename . "'\n";
}
?>

var t
var j = 0
var p = Pic.length
var preLoad = new Array()
for (i = 0; i < p; i++){
   preLoad = new Image()
   preLoad.src = Pic
}

function runSlideShow(){

  if (document.all){
     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 (document.all){
     document.images.SlideShow.filters.blendTrans.Play()
  }

   j = j + 1
   if (j > (p-1)) j=0
   t = setTimeout('runSlideShow()', slideShowSpeed)
}
</script>
Logged

vuud

  • Moderator
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1803
  • [cpmfetch.fistfullofcode.com]
    • Fist Full Of Code
Re: Self-contained Slideshow?
« Reply #24 on: September 05, 2006, 04:57:58 am »

Here's some updated (working) code.  It fixes the symptom of the blank file URL, but not the cause.

Where is the blank url coming from?  Is it in the original data like cpmfetch is producing an empty row at the beginning or end?

Arrghh
Logged
Please post for help to the forum... PM me only if you are sending security related items (passwords, security problems, etc).

cpmFetch - Images, RSS feeds from CPG from outside CPG
New release notification signup also. 
See http://cpmfetch.fistfullofco

Slideshow Bob

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 20
Re: Self-contained Slideshow?
« Reply #25 on: September 05, 2006, 05:01:23 am »

it's comming from the call.  My guess is, there's some minor strangeness in the database.  However, if it's in mine, it's probably elsewhere too.  The bandaid fix seems to work ok.
Logged

cgc0202

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 199
Sequential Slideshow
« Reply #26 on: September 05, 2006, 03:46:03 pm »

Hi Vuud,

Let me clarify this point only, since the others require just patience until the features become available.

I dunno... once you retrieve the data you could use php to sort it by filename or something?  Are you assuming they were added into CPG in the correct order?

For your case I guess it clearly must be available, but this is the first case that actually demonstrated needing that that I have seen...  so its not exactly a commonly requested thing.  Sorting the results is on the scope, so maybe that would solve your problem.

Vuud

Yes, I see no other way, but to manually arrange a set of photos before they are upoaded, so that they are in the correct order of the sequencea by adding 01, 02, 03, etc.. to the photoset has to be in sequence.  That was how I made it to run in sequence also in the CPG.

CGC
Logged

shamrock

  • Coppermine newbie
  • Offline Offline
  • Posts: 4
Re: Self-contained Slideshow?
« Reply #27 on: September 07, 2006, 05:35:13 pm »

It is just me or is anyone else getting the error:  Line 53 Object expected

My code for line 53 is:
Code: [Select]
<body onload="runSlideShow()">
Logged

vuud

  • Moderator
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1803
  • [cpmfetch.fistfullofcode.com]
    • Fist Full Of Code
Re: Self-contained Slideshow?
« Reply #28 on: September 08, 2006, 01:34:36 am »

It is just me or is anyone else getting the error:  Line 53 Object expected

My code for line 53 is:
Code: [Select]
<body onload="runSlideShow()">

Wierd.  Not me.  Are you using some strange browser?  Forget the javascript above it or something?
Logged
Please post for help to the forum... PM me only if you are sending security related items (passwords, security problems, etc).

cpmFetch - Images, RSS feeds from CPG from outside CPG
New release notification signup also. 
See http://cpmfetch.fistfullofco

shamrock

  • Coppermine newbie
  • Offline Offline
  • Posts: 4
Re: Self-contained Slideshow?
« Reply #29 on: September 08, 2006, 03:30:58 pm »

I'm using Internet Explorer for now and I've copied the script above...my cpmFetch folder is inside coppermine (cmg is the directory).  I'll paste my code below:
Code: [Select]
<html>
<head>
<script>
var slideShowSpeed = 9000
var crossFadeDuration = 5
var Pic = new Array()
var a = 0

<?php
include "./cpmfetch.php";
$objCpm = new cpm("/cmg");
$objCpm->cpm_setReturnType("resultset");
$data $objCpm->cpm_viewRandomMediaFrom(10001000"");
$counter=0;

foreach (
$data as $row) {
   
$imagename $objCpm->getImageToUse($row['pFilepath'], $row['pFilename'] ,"normal_");
   if(
substr($imagename,strlen($imagename)-1,1)=="/")continue;
   if(
$counter++ > 20)break;
   print 
"Pic[a++]='" $imagename "'\n";
}
?>


var t
var j = 0
var p = Pic.length
var preLoad = new Array()
for (i = 0; i < p; i++){
   preLoad = new Image()
   preLoad.src = Pic
}

function runSlideShow(){

  if (document.all){
     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 (document.all){
     document.images.SlideShow.filters.blendTrans.Play()
  }

   j = j + 1
   if (j > (p-1)) j=0
   t = setTimeout('runSlideShow()', slideShowSpeed)
}
</script>
</head>
<body onload="runSlideShow()">

<img src="./cmg/displayimage.php?album=1&pos=0" name='SlideShow'>

</body>
</html>

The error I get is: Line 53 - object expected

By the way, I've verified that my cpmFetch is working properly by running the test.php file and the pictures display fine...the code for it is as follows:
Code: [Select]
<?php
include "cpmfetch.php";
$objCpm = new cpm("/cmg");
$objCpm->cpm_viewLastAddedMediaFrom(4,1,"album=1");
$objCpm->cpm_close();
?>
Logged

niks_007

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 73
Re: Self-contained Slideshow?
« Reply #30 on: December 20, 2006, 03:28:16 pm »

hi
      i found this thread after searing so much its gr8 but the only problem is with the first image is not opened it shows a cross there then it wirks fine. i just cant understand why its having such problem i have tried altering the code but not found solution can some other java script code can work with it. i just wonder.

its live demo is here i have fetched the thumb images.
http://www.lakesparadise.com/test1.php

Niks

Logged

phill104

  • Administrator
  • Coppermine addict
  • *****
  • Country: gb
  • Offline Offline
  • Gender: Male
  • Posts: 4885
    • Windsurf.me
Re: Self-contained Slideshow?
« Reply #31 on: January 30, 2007, 09:31:51 pm »

I've not installed cpmfetch before but this item interests me. I'm going to try to install now and I will report back how it goes.

Sorry to take up forum space but I'll get you prepared for my incompetence.
Logged
It is a mistake to think you can solve any major problems just with potatoes.

vuud

  • Moderator
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1803
  • [cpmfetch.fistfullofcode.com]
    • Fist Full Of Code
Re: Self-contained Slideshow?
« Reply #32 on: January 30, 2007, 11:05:54 pm »

hi
      i found this thread after searing so much its gr8 but the only problem is with the first image is not opened it shows a cross there then it wirks fine. i just cant understand why its having such problem i have tried altering the code but not found solution can some other java script code can work with it. i just wonder.

its live demo is here i have fetched the thumb images.
http://www.lakesparadise.com/test1.php

Niks



I think when we all got bored with poking it with a pointy stick thats where we were.  Should not be hard to fix, just no one sat down to do it.

Post a solution for future users if you find one please :)




Logged
Please post for help to the forum... PM me only if you are sending security related items (passwords, security problems, etc).

cpmFetch - Images, RSS feeds from CPG from outside CPG
New release notification signup also. 
See http://cpmfetch.fistfullofco

phill104

  • Administrator
  • Coppermine addict
  • *****
  • Country: gb
  • Offline Offline
  • Gender: Male
  • Posts: 4885
    • Windsurf.me
Re: Self-contained Slideshow?
« Reply #33 on: January 30, 2007, 11:12:26 pm »

I got everything to install properly and ver easy it was too. Brilliant job.

It's just doing slideshows that I cannot currently suss.

I keep getting the error on line 28 'preload[...].src' is null or not an object.

<html>
<head>
<script>
var slideShowSpeed = 3000
var crossFadeDuration = 4
var Pic = new Array()
var a = 0

<?php
include "./cpg133/cpmfetch.php";
$objCpm = new cpm("./cpg133");
$objCpm->cpm_setReturnType("resultset");
$data = $objCpm->cpm_viewLastAddedMediaFrom(1000, 1000, "");

foreach ($data as $row) {
   $imagename = $objCpm->getImageToUse($row['pFilepath'], $row['pFilename'] ,"normal_");
   print "Pic[a++]='" . $imagename . "'\n";
}
?>

var t
var j = 0
var p = Pic.length
var preLoad = new Array()
for (i = 0; i < p; i++){
   preLoad = new Image()
   preLoad.src = Pic
}

function runSlideShow(){

  if (document.all){
     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 (document.all){
     document.images.SlideShow.filters.blendTrans.Play()
  }

   j = j + 1
   if (j > (p-1)) j=0
   t = setTimeout('runSlideShow()', slideShowSpeed)
}
</script>
<body onLoad="runSlideShow()">

<img src="./cpg133/displayimage.php?album=1&pos=0" name='SlideShow'></td>

</body>
</html>
 
Logged
It is a mistake to think you can solve any major problems just with potatoes.

RCurtis

  • Coppermine newbie
  • Offline Offline
  • Posts: 1
Re: Self-contained Slideshow?
« Reply #34 on: May 02, 2007, 02:07:04 am »

I guess I am just not looking in the right place...  Is there any "final result" as to how to get this to work?  There are lot's of code samples sprinkled through this thread...but I can't seem to find "the final word".  Also, cannot find any docs on the file "slideshow.php" included in the 2.0 stable release.  It *appears* to be a possible end result to allow this... It runs without error, but only displays a small square with a red "X".
Logged

ericr23

  • Coppermine newbie
  • Offline Offline
  • Posts: 16
Re: Self-contained Slideshow?
« Reply #35 on: September 19, 2007, 05:26:34 pm »

<?php
foreach ($data as $row) {
   $imagename = $objCpm->getImageToUse($row['pFilepath'], $row['pFilename'] ,"normal_");
   print "Pic[a++]='" . $imagename . "'\n";
}
?>

How would you get the link for each image, using similar code?
Logged
Pages: 1 [2]   Go Up
 

Page created in 0.031 seconds with 19 queries.