|
|
|
|
![]() ![]() |
Oct 3 2007, 06:17 AM
Post
#1
|
|
|
Newbie ![]() Group: Members Posts: 3 Joined: 3-October 07 Member No.: 51,035 |
Hello there and thanks for the helping hand you are offering.
PHP newbie here! So here is my problem: On my website I have a flash image gallery.The way the gallery works is by uploading pictures in a folder and editing? an xml file.(pics.xml) where it adds the following code when you upload a picture: CODE <pictures> <image location="nameofpicture1.jpg" desc="" /> <image location="nameofpicture2.jpg" desc="" /> </pictures> etc... Now I have users that upload products they sell on the website or they advertise their business(hotels, jewellers, car resellers,...) So for every "product" they post they upload their pictures to a specific path and I keep their pictures path in a mysql database. I m trying to work a solution so that everytime a visitors clicks to see a product he gets the flash gallery for that product. This means I have to create/edit the pics.xml file so that it only contains the pictures for that specific post. So the user open a view_product.php which includes a php file that contains the flash. The flash gets the pictures for the gallery from the pics.xml file. Any ideas on how to work out this problem? Edit: I just uploaded the php file that edits the xml file if that is any help. I guess I could edit that file each time a user views a post but i dont think that's a good idea! This post has been edited by rvalkass: Oct 3 2007, 06:30 AM
Attached File(s)
|
|
|
|
Oct 3 2007, 06:38 AM
Post
#2
|
|
|
apt-get moo ![]() Group: [MODERATOR] Posts: 2,056 Joined: 28-May 05 From: Hertfordshire, England Member No.: 7,593 ![]() |
That PHP file works by completely wiping and replacing the XML file each time you upload a new picture. If you only want certain pictures displayed then you need to limit which pictures the function that generates the XML can see. I would recommend creating a folder for each product, and put the images related to that product in its folder.
Then, take out the XML generating part of the upload script and put it in a new page. Make it accept a variable (the product name) each time it is run. Then adjust the path for the folder it is reading from so that it has that variable stuck on the end. This would limit it to only using images for one product. It would also put the XML file in the same folder as the images - so you'd end up with a separate XML file for each product. Then you need to find some way for the Flash gallery to accept a variable from PHP, so it can be told where the XML file is. Sorry if thats not very clear, feel free to ask if you want it explained better and I'll give it a go |
|
|
|
Oct 3 2007, 06:45 AM
Post
#3
|
|
|
Newbie ![]() Group: Members Posts: 3 Joined: 3-October 07 Member No.: 51,035 |
That PHP file works by completely wiping and replacing the XML file each time you upload a new picture. If you only want certain pictures displayed then you need to limit which pictures the function that generates the XML can see. I would recommend creating a folder for each product, and put the images related to that product in its folder. Then, take out the XML generating part of the upload script and put it in a new page. Make it accept a variable (the product name) each time it is run. Then adjust the path for the folder it is reading from so that it has that variable stuck on the end. This would limit it to only using images for one product. It would also put the XML file in the same folder as the images - so you'd end up with a separate XML file for each product. Then you need to find some way for the Flash gallery to accept a variable from PHP, so it can be told where the XML file is. Sorry if thats not very clear, feel free to ask if you want it explained better and I'll give it a go So the XML file is the key here! I had another flash that would accept a php variable but if you clicked the flash it would take you to a different website. the php file that contains the flash must be in the same folder as the xml file. So if i create a folder for each product, and upload the pictures there, create the xml and add the php(flash) file then it should work and it wouldnt mess things up? I guess working too many hours doesn't help thinking of the obvious. I m gonna try this solution and post my results. In the meantime if anyone has any other solution I d be glad to read and give it a try also! |
|
|
|
Oct 3 2007, 03:13 PM
Post
#4
|
|
|
Privileged Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: [HOSTED] Posts: 775 Joined: 13-April 07 From: mreža Member No.: 41,558 |
But where is PHP file you two are talking I where is its code I don't see it and I am ready to help
|
|
|
|
Oct 5 2007, 07:19 AM
Post
#5
|
|
|
Newbie ![]() Group: Members Posts: 3 Joined: 3-October 07 Member No.: 51,035 |
Well i finally made the files to be created automatically.
So now when i am at english/products/77(prod_id)/gallery.php i get to see the flash movies as it is supposed to be When I try to load the movie in a file in english/offer.php?id=77 the movie loads but it doesnt show the menu, the settings or the images. Does anyone know why? This is the code in english/products/77(prod_id)/gallery.php CODE <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="611" height="418" id="gallery" align="middle"> <param name="allowScriptAccess" value="sameDomain" /> <param name="movie" value="gallery.swf" /> <param name="quality" value="high" /> <param name="bgcolor" value="#ffffff" /> <embed src="gallery.swf" quality="high" bgcolor="#ffffff" width="611" height="418" name="gallery" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /> </object> CODE <? $prod_id=$_GET["id"]; ?> <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="611" height="418" id="gallery" align="middle"> <param name="allowScriptAccess" value="sameDomain" /> <param name="movie" value="products/<?="$prod_id"?>/gallery.swf" /> <param name="quality" value="high" /> <param name="bgcolor" value="#ffffff" /> <embed src="products/<?="$prod_id"?>/gallery.swf" quality="high" bgcolor="#ffffff" width="611" height="418" name="gallery" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /> </object> The movie loads ok, but it is supposed to use the following files and folders: products/77/gallery.swf (which loads) .../77/menu.xml .../77/settings.xml .../77/splash.img ../77/images_folder/ ../77/images_folder/pics.xml ../77/images_folder/images.jpg ../77/images_folder/thumbs/ ../77/images_folder/thumbs/images.jpg if you want to see the pages then: http://www.ijumpo.com/products/77/gallery.php (works ok) http://www.ijumpo.com/english/offer.php?id=77 (doesn't work) I was getting the loading menu on the top left of the flash when it couldn't find the menu.xml so my guess is the flash is being embedded in the /english/ folder but cant find the files it needs to work? This post has been edited by Nikolas.a: Oct 5 2007, 07:23 AM |
|
|
|
Dec 11 2007, 10:58 AM
Post
#6
|
|
|
Advanced Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: [HOSTED] Posts: 127 Joined: 7-December 07 Member No.: 54,372 |
i did a flash gallery recently just to test to see if my codes work and apparently it does
here is the link www.geocities.com/lub_scent/annnleon.swf The thing is i want to have a thumbnail for it as well so i can click on the photos i want to see. The post above has a good flash gallery but its not what i want. It also takes too long to load so i just want something simple clean but gives alot of options at the same time. so far all my gallery does is load external images.. and you press back or forward .. Is anyone here good at actionscript in flash at all? I really really really need help on this. This post has been edited by keego: Dec 11 2007, 11:01 AM |
|
|
|
![]() ![]() |
Similar Topics
|
Lo-Fi Version | Time is now: 27th July 2008 - 02:12 AM |