Welcome Guest ( Log In | Register)



 
Reply to this topicStart new topic
> Php And Flash Image Gallery, Need some help in creating or editing an xml file while viewing some o
Nikolas.a
post 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! ph34r.gif
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!

Notice from rvalkass:

You need CODE tags around any code you place in a post.


This post has been edited by rvalkass: Oct 3 2007, 06:30 AM
Attached File(s)
Attached File  upload_pics.php ( 5.1k ) Number of downloads: 3
 
Go to the top of the page
 
+Quote Post
rvalkass
post Oct 3 2007, 06:38 AM
Post #2


apt-get moo
Group Icon

Group: [MODERATOR]
Posts: 2,056
Joined: 28-May 05
From: Hertfordshire, England
Member No.: 7,593
Spam Patrol



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 tongue.gif
Go to the top of the page
 
+Quote Post
Nikolas.a
post Oct 3 2007, 06:45 AM
Post #3


Newbie
*

Group: Members
Posts: 3
Joined: 3-October 07
Member No.: 51,035



QUOTE(rvalkass @ Oct 3 2007, 09:38 AM) *
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 tongue.gif


So the XML file is the key here! blink.gif
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!
Go to the top of the page
 
+Quote Post
hitmanblood
post 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 wink.gif
Go to the top of the page
 
+Quote Post
Nikolas.a
post 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
Go to the top of the page
 
+Quote Post
keego
post 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
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic

Collapse

> Similar Topics

Topics Topics
  1. Best Free Flash Editor(8)
  2. Flash Movie As Background?(20)
  3. Creating Links In Images(17)
  4. Simple C File Handling In Action(3)
  5. Watermark Your Image With Simple Php Script(34)
  6. How To Create Embed Image Mail In Gmail(49)
  7. How To Open A .daa File(37)
  8. A Trap17 How-to Guide For Beginners(12)
  9. Flash Games(4)
  10. Read File (.txt) On Another Website Using Jsp?(3)
  11. Creating Msn Account Without A Hotmail Account(3)
  12. Editing Or Modifying Joomla For A Beginner(4)
  13. Do You Use Imagefilez.com?(30)
  14. Background Image Swap Script(15)
  15. How To: Flash Streaming(4)
  1. Flash Streaming(4)
  2. Flash Media Into Html/css Website(1)
  3. Creating A Good Website, How?!(18)
  4. Best Video Editing Software(6)
  5. Free Software For File Recovery(3)
  6. Cms For Video, Embedding Flash(2)
  7. Flash Wmode(transparent) Pramater In Firefox3(on Linux) - Not Working(1)
  8. Creating A Fully Featured Cms(0)
  9. Help With Some Editing(5)
  10. Adding Flash Music Player To Home/any Page(4)
  11. Internal File Transfer(5)
  12. Gallery Not Working(2)
  13. Wordpress Error - Bytes Exausted(5)


 



- Lo-Fi Version Time is now: 27th July 2008 - 02:12 AM