Jump to content

reposting of slideshowpro help with code


nsr500rossi

Recommended Posts

Hello all

I have a website that i have built myself, i am using a program called slideshowpro that displays slideshows of my photographs.

A friend of mine wrote some php code to enable the user to click on the photograph and that would open a  new window that would display the filename and thumbnail of the selected image with 2 options to purchase prints, once they clicked on purchase it would open a paypal page which would show the filename and price etc.

Here is the webpage so you can check it out.  http://www.michaelshuttleworthphotography.co.uk/Event_Photos_Part_1.html

Well this all worked fine until i upgraded slideshowpro.

The ltest version has changed the way that it creates the xml file.

Unfortunately my friend has cleared off to thailand (lucky him) and i am stuck trying to modify the code.

I must say that i know nothing about PHP.

Slideshow pro creates a folder called xml_cache. In this folder it has a number of xml files for each album or gallery.

I only need to use one of the galleries  images_gallery_2_900_598_0_80_1_80_60_0_50_1_54_41_0.xml

This holds a number of albums.

I am pretty sure that is only the edit xml file that need modification, i have tried to modify it but with no luck.

If anyone can give me some help i would be most grateful.

I have attached 3 files for you to have a look at.

 

Just to clarify things, i have built a new site that is not live. the link that i posted is the old site which is still working.

So i have 2 versions of slideshowpro running, on 2 diferent domains and isp's.

I am going to post the code for all to view.

Also i don't think anyone on the slideshowpro forums can help, everyone seems to be looking for a way to intergrate paypal.

 

This is the edit.xml file

 

<html>

<head>

  <title>PHP Test</title>

</head>

<body>

 

 

<?php

 

$file = "images.xml";

$descriptor = fopen ($file, "r");

$contents = fread($descriptor , filesize($file));

$album = '';

 

$pos1 = strpos($contents, 'javascript:NewWindow');

if ($pos1 == false) {

 

  $pieces = explode('link=""', $contents);

  $op = "";

 

  for ($i = 0; $i < count($pieces); $i++) {

 

      $tnpos = strpos($pieces[$i], 'tnPath="');

      if ($tnpos !== false)

      {

        $titpos = strpos($pieces[$i], 'ssp_director/albums/', $tnpos);

        $titpos += 20;

        $titend = strpos($pieces[$i], '/', $titpos) - $titpos;

        $album = substr($pieces[$i], $titpos, $titend);

//echo $album;

      }

 

      $halves = explode('<img src="', $pieces[$i]);

      $fileid = substr($halves[1], 0, 7);

      if (count($halves) > 1) {

        $halves[0] .= '<img src="';

 

        $pos1 = strpos($halves[1], 'unavailable');

        if ($pos1 == false) {

            $halves[1] .= "link=\"javascript:NewWindow=window.open('/Payment_page.php?name=" . $fileid . ".jpg&album=" . $album . "','myWindow','width=300,height=730,toolbar=no,location=no,status=yes,menubar=no,scrollbars=yes,resizable=yes');NewWindow.focus(); void(0);\"";

        } else {

            $halves[1] .= 'link=""';

        }

      }

      $op .= $halves[0] . $halves[1];

  }

 

  fclose($descriptor);

  unlink($file);

//$descriptor = fopen ('images.txt', "w");

  $descriptor = fopen ($file, "w");

  fwrite($descriptor,$op);

 

  echo 'done! ';

  echo count($pieces);

  echo ' pieces processed';

 

  fclose($descriptor);

 

} else {

  echo 'This file has been processed already';

}

 

?>

 

</body>

</html>

 

And the old xml file created by slideshowpro (filename is images.xml) before running the edit xml command is:

 

<?xml version="1.0" encoding="utf-8"?>

<!-- XML Generated by SlideShowPro Director v1.0.5 http://www.slideshowpro.net -->

<gallery>

  <album id="32" title="Brighton Ace Cafe Run 2006" description="Photographs from the 2006 Ace Cafe Run on Maderia Drive. Unfortunately due to a hard drive crash none of these images are available to purchase" lgPath="http://www.michaelshuttleworthphotography.co.uk/ssp_director/albums/Ace_Cafe_Run_2006/lg/" tnPath="http://www.michaelshuttleworthphotography.co.uk/ssp_director/albums/Ace_Cafe_Run_2006/tn/" tn="http://www.michaelshuttleworthphotography.co.uk/ssp_director/album-thumbs/album-32.jpg">

      <img src="ACE_001.jpg" title="This photograph is unavailable to purchase" caption="ACE_001.jpg" link="" />

      <img src="ACE_002.jpg" title="This photograph is unavailable to purchase" caption="ACE_002.jpg" link="" />

      <img src="ACE_003.jpg" title="This photograph is unavailable to purchase" caption="ACE_003.jpg" link="" />

      <img src="ACE_004.jpg" title="This photograph is unavailable to purchase" caption="ACE_004.jpg" link="" />

      <img src="ACE_005.jpg" title="This photograph is unavailable to purchase" caption="ACE_005.jpg" link="" />

      <img src="ACE_006.jpg" title="This photograph is unavailable to purchase" caption="ACE_006.jpg" link="" />

</album>

</gallery>

 

 

This is the new xml file created by slideshow pro (filename is: images_gallery_2_900_598_0_80_1_80_60_0_50_1_54_41_0.xml):

 

<?xml version="1.0" encoding="utf-8"?>

<!-- XML Generated by SlideShowPro Director v1.1.7 http://www.slideshowpro.net -->

<gallery>

  <album id="album-1" title="Robb and Lucy&#039;s Wedding" description="160 Photographs in Album" lgPath="http://www.michaelshuttleworth.com/ssp_director/p.php?a=" tnPath="http://www.michaelshuttleworth.com/ssp_director/p.php?a=" tn="http://www.michaelshuttleworth.com/ssp_director/p.php?a=R15FXiM6OT1uemwucmhjfm8nJys8PyY2Nio5LTciKyQ%2BJzA%2FPjM%3D" audio="http://www.michaelshuttleworth.com/ssp_director/album-audio/Lara`s Castle.mp3" audioCaption="Laura&#039;s castle by Yann Tiersen">

      <img src="R15FXiM6Oj1uemwucmhjfm8nJyswOzouMj8xLTI%2BPyU%2BIy0mOicmNA%3D%3D" tn="R15FXiM6Oj1uemwucmhjfm8nJysxOyY0Nyo5LTciKyQ%2BJzE%2FPzs%3D" title="Please click on photograph to purchase" caption="RLW_001.jpg" link="" />

</album>

</gallery>

 

Cheers mike

 

 

 

 

 

 

Link to comment
https://forums.phpfreaks.com/topic/85532-reposting-of-slideshowpro-help-with-code/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.