nsr500rossi
Members-
Posts
10 -
Joined
-
Last visited
Never
Profile Information
-
Gender
Not Telling
nsr500rossi's Achievements
Newbie (1/5)
0
Reputation
-
Hi I have an editxml.php file that takes this code: Hi <img src="RLW_001.jpg" title="Please click on photograph to purhase" caption="RLW_001.jpg" link="" /> and when run, turns it into this code: <img src="BST 001.jpg" title="Please click on photograph to purchase" caption="BST 001.jpg" link="javascript:NewWindow=window.open('/Payment_page.php?name=BST 001.jpg&album=Brighton speed trials 2006','myWindow','width=300,height=660,toolbar=no,location=no,status=yes,menubar=no,scrollbars=yes,resizable=yes');NewWindow.focus(); void(0);" /> I need to change the editxml.php so that it creates a xml file like this <img src="ECO_007.jpg" title="Please click on Photograph to purchase" caption="ECO_007.jpg" link="http://www.michaelshuttleworth.com/Payment_page2.php?name=ECO_007.jpg&album=Ecofair_2006" target="_self" /> Ignore the filenames (i have taken them from different sources) Here is the editxml.php code that needs changing: <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> I guess the javascript newwindow code needs replacing, i have tried but can't quite get it right. If anyone out there can show me what to change i would be so so grateful. Many thanks Mike
-
Sorry about the lack of tags. Well i added the Ecofair to the _2006 code in my xml file and it worked. So i know that it can work, but i still have the problem of generating the images.xml file correctly. It is still shortening my thumbnail file name. Still need help please Mike
-
Hi Revraz Ok so i am he original newbie. How do i echo the album? Mike
-
Hi, Can anyone tell me why my filename is being chopped in half when i run my editxml.php command The problem line in the code is: name=ECO_001.jpg&album=_2006' it should read name=ECO_001.jpg&album=Ecofair_2006' This is the code that is created after running the editxml.php command. <?xml version="1.0" encoding="utf-8"?> <gallery> <album title="Ecofair 2006" description="Photographs from the 2006 Ecofair in Burgess Hill" lgPath="http://www.michaelshuttleworth.com/Event/albums/Ecofair_2006/lg/" tnPath="http://www.michaelshuttleworth.com/Event/albums/Ecofair_2006/tn/"> <img src="ECO_001.jpg" title="Please click on Photograph to purchase" caption="ECO_001.jpg" link="javascript:NewWindow=window.open('/Payment_page.php?name=ECO_001.jpg&album=_2006','myWindow','width=300,height=700,toolbar=no,location=no,status=yes,menubar=no,scrollbars=yes,resizable=yes');NewWindow.focus(); void(0);" /> </album> </gallery> Here is the editxml.php code <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], 'Event/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=700,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> A friend of mine wrote the code for me and it works fine on my old website http://www.michaelshuttleworthphotography.co.uk/Event_Photos_Part_1.html As you can see when you click on the image it gets the image info and thumbnail and opens it in a new window. On my new site it is tripping up on getting the thumbnail. Thanks in advance Mike
-
[an error occurred while processing this directive]
nsr500rossi replied to nsr500rossi's topic in PHP Coding Help
Ok i have moved the php file to my main public folder and it works. It seems that when i move it back to it's original location it fails. Just to clarify. The original location for the file is in a mysql database. I have two running databases on my website, one for wordpress and one for slideshowpro. I wonder why it is not working when it is placed in my slideshowpro folder. All was working well with the exact same setup when my hosts were easyspace Mike -
[an error occurred while processing this directive]
nsr500rossi replied to nsr500rossi's topic in PHP Coding Help
If i login to my control panel i am given the option to choose between php4, php5 and php5 fastCGI. I have tried them all with no success. I have a file called php.ini in my main directory. Mike -
Hi, i am getting this message even though i am only running this php code as a test. <?php phpinfo(); ?> My host is bluehost Can anyone let me know what i am doing wrong Cheers Mike
-
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'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'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
-
Slideshowpro and PHP desperate need of help
nsr500rossi replied to nsr500rossi's topic in PHP Coding Help
Hi Daukan Thanks for the reply, unfortunately i can not go back to the old version all the images are stored in a mysql database. 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'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'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 -
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. Many thanks Mike [attachment deleted by admin]