Nov 21, 2009

Php And Flash Image Gallery - Need some help in creating or editing an xml file while viewing some o

free web hosting
Open Discussion > MODERATED AREA > Computers > Programming Languages > PHP Programming

Php And Flash Image Gallery - Need some help in creating or editing an xml file while viewing some o

Nikolas.a
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.

 

 

 


Comment/Reply (w/o sign-up)

rvalkass
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

 

 

 


Comment/Reply (w/o sign-up)

Nikolas.a
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!

Comment/Reply (w/o sign-up)

hitmanblood
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

Comment/Reply (w/o sign-up)

Nikolas.a
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?

Comment/Reply (w/o sign-up)

keego
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.

Comment/Reply (w/o sign-up)



Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

This textarea will convert to Rich-Text automatically (IE, Firefox, Chrome)

Similar Topics

Keywords : php, flash, image, gallery, creating, editing, xml, file, viewing, o

  1. Gallery Help Needed
    errors help help (10)
  2. Php - Fetching Random Line From A Text File
    and displaying it using AJAX/iframe (0)
    What you should know: HTML, PHP basics (executing php scripts) Examples: Using AJAX Using
    iframe Download Examples Using this script you can display a random quote/fact every time a
    visitor clicks the link. It happens dynamically without reloading the whole page. Useful for keeping
    a site fresh and lively. For example, you can have it in "About Me" page of a website which is
    rarely updated. All the quotes are stored in a text file separated by a line break. Although I have
    included a sample collection, you are free to modify or create your own. Thanks to Davi....
  3. Linux/ Apache /mod_rewrite Issue
    Error when accessing a file (4)
    running on Ubuntu 8.04 with an XAMPP - php5.2.5, Apache 2., etc Getting this error when I try to
    access an sNews CMS which requires mod_rewrite and is installed locally: QUOTE Apache/2.2.8
    (Unix) DAV/2 mod_ssl/2.2.8 OpenSSL/0.9.8e PHP/5.2.5 mod_apreq2-20051231/2.6.0 mod_perl/2.0.2
    Perl/v5.10.0 configured -- resuming normal operations /opt/lampp/htdocs/jim/snews/.htaccess:
    RewriteBase: argument is not a valid URL /opt/lampp/htdocs/jim/snews/.htaccess: RewriteBase:
    argument is not a valid URL Using this link: http://localhost/jim/snews/snews16_ema....
  4. Flash And Php
    How? (5)
    Guys, if I did some flash game. How can I say set it that it works with php?....
  5. Php Configuration File
    "config.php" (18)
    I did create this topic mainly because I want to know everything about that configuration file. I
    will post other replies if I want to know more depending on your experience. Is this code correct
    for that file: CODE $host="localhost"; $dbname="XXX"; $dbuser="XXX"; $dbpass="XXX";
    $connection=mysql_connect($host, $dbuser, $dbpass) or die(mysql_error()); mysql_select_db($dbname)
    or die(mysql_error()); ?> Add your suggestions or improve it.....
  6. Image Upload
    ?!? (11)
    I need the image upload script which automatically resized the image by specified size and store it
    in the specified folder.....
  7. Creating Something With Co-ordinates With Php.
    Something like you see in those web-based php games, like a map or som (12)
    Well, i was just wondering if something simple and basic could be made (like a small map where you
    could move around on, like you click up, and your position moves up and reports it to the
    database..etc) with co-ordinates in php . Taking the x-axis and the y-axis into consideration.
    Things like maps which online games have such as web-based space games or legacy-game.net. Thanks
    for any feedback, ~Aldo....
  8. Need Some Help In File Browser
    listing all sub folders and files in them. (8)
    Hey I want to create a very simple file browser, so that, it reads all the sub-folders which are
    places in a directory, and the files inside the sub-folders (It reads only files inside sub-folders
    and list them in simply. ) Also, it creates a directory (any name) inside each sub folder. My
    Following code reads on the files inside the main directory, it does not read the files inside the
    sub-folders.. I appreciate any help. CODE $path = "./"; $dir_handle = @opendir($path) or
    die("Unable to open $path"); while ($file = readdir($dir_handle)) { if($file == "." || $fil....
  9. Updating Php File Through A Web Form
    (5)
    Hello, i'm not sure if this can be done with php or not but what i need is a way to make an php
    file that have an html form on it and it will take the info you put in to that form and write it to
    an existing php file, for example: if i have the file news.php and the file news_update.php. if you
    went to news_update.php you would get an form with a text area for you to write a new addition for
    the news.php file and when you hit submit it will add what you typed in the form to the file
    news.php. If this is going to be a big code or a hard one to make but some one think....
  10. File Checker-how To Check File Whith Html Through Html?
    (2)
    edit:sorry for the mistake it is php not html and its with not whith my code checking script= CODE
    $file = '$CHECK'; if (file_exists($file)) {     echo "The file $filename exists"; } else
    {     echo "The file $filename does not exist"; } ?> my question is how to check the file whith
    html example:on a page a text box is provided and a button the user writes a file name (or website)
    the user clicks on the submit button then it checks and show it (with the code above) i got the
    code CODE $filename=$_POST ; if (file_exists($filename)) {     echo "The....
  11. Flash With Php
    (1)
    Is it possible pass flash variables to be processed in PHP language? Example: Enter Login and
    password in a flash aplication and this variables (login and password) to be used in PHP?....
  12. Get A Image Indentifier With Gd Library
    GD library question (7)
    Hey fellow coders, I'm having a problem. If you output a im indentifier in php with gd libary.
    With this method for example: CODE header("(anti-spam-(anti-spam-(anti-spam-content-type:)))
    image/png"); $imgWidth = 50; $imgHeight = 50; $image=imagecreate($imgWidth, $imgHeight);
    $colorBlack = imagecolorallocate($image, 0, 0, 0);  // first color you define with colorallocate is
    also the color of the background of your image imagepng ($image); imagedestroy ($image); // This
    gives you a page with a black image of 50x50 pixels. ?> If i look at the source c....
  13. No File Extension
    (3)
    On MediaWiki, the URL of the content is http://YOURWIKI.com/index.php/Blah Is it possible to
    create a page or two that doesn't have a file extension? If so, how is it done?....
  14. Creating A Login Box That Links To My Phpbb Forum
    Have my phpBB Forum Intergrated with my Website (4)
    Can someone please give me a code that I can use to put a login box on my website, that will login a
    user into my phpBB Forum? Sort of like Having my phpBB Forum Intergrated with my Website? Thank you
    so much if you can! /angel.gif" style="vertical-align:middle" emoid=":angel:" border="0"
    alt="angel.gif" /> Ex. ....
  15. Php Only Gallery
    I don't know PHP well and can't find a free script (7)
    I will pay for this. More info on payment on bottom of post. Alright I know just about everything
    about CSS and Ruby on Rails I know more then enough to make certain apps, but i have never been good
    at PHP. I do know that this script would be fairly short though. Does anyone know how to make this
    web photo gallery with PHP only. I don't want MySQL. No need for it. In my root folder I'll
    make a gallery folder. Inside of that will be photography, illustrations, personal, etc. Inside of
    those is where I want the script. So there wil be a script for each one, but....
  16. File Upload
    File upload (1)
    I need to add a facility on my customer's website so his clients can send him jobs, typically
    5mb - 50mb. I've looked around the web and researched this, and tried a few tests (failed), but
    my brain's beginning to hurt. Could someone please tell me the best way to go about this,
    please. The site is done in Flash, but I'm sure a link to an html page would be ok if necessary.....
  17. Trap17 Board Status Dynamic Image
    (13)
    I was really board a few days ago and decided to make a trap17 board status image for my sig
    /tongue.gif" style="vertical-align:middle" emoid=":P" border="0" alt="tongue.gif" /> That is the
    current beta. I'm still working on it so that it might display the most recent post or
    somthing, i'm not sure. After I finish it ill give out the source code but if you want one
    right now you can pm me and ill set one up to get the info on your account ^.^ So I was wondering
    how you members liked it? You'll probably think that its a waste of time, but alas as I sai....
  18. <?php ?> Unique Visitors Script
    Flat file unique visitors script (no sessions) (2)
    This is really simple script. Well at least this part is, but it could be extendable. Only problem
    is that it's not really for massive websites with hundread of visitors a day, but rather for
    small ones. But it is a good script to figure out how to make a visitor counter script. Anyway
    here's the snippet. CODE function getVisits($variable) {     $visits = array();     if
    ($handle = opendir('stats/')) {     while (false !== ($file = readdir($handle))) {
            if ($file != "." && $file != "..") {             array_push($visits, $file);         } ....
  19. Evilboard (forum Software) - Multiple Categorys - Don't Work :(
    I am creating a forum and i can't fix more then 1 category. (6)
    I am at the moment trying to program my own forum, but i need more then a single category, here is
    my source: CODE function cat () { include("functions/functions.php"); echo '  
    Forum ';      global $catid;   $db = new db;   $db->connect();   $connect =
    $db->query("SELECT * FROM eb_forum WHERE catecory = '1'");   # START GET CATEGORYS #
      $catz = array();   while ( $cat = mysql_fetch_object( $connect ) ) {   /*echo "         
    {$cat->name}      Topics:      Replies:      ";*/     $catz .= "        {$cat->name}
      ....
  20. Watermark Your Image With Simple Php Script
    found it on the net (39)
    This script was found on the net http://tips-scripts.com/?tip=watermark#tip B&T's Tips &
    Scripts site. Just in case the site may not show, I will include the code here: List of things
    needed: 1. your image in any format 2. watermark image--in gif format with transparent background 3.
    script below with name (i.e. watermark.php) CODE // this script creates a watermarked image
    from an image file - can be a .jpg .gif or .png file // where watermark.gif is a mostly transparent
    gif image with the watermark - goes in the same directory as this script // where this....
  21. Creating Profiles In Php/mysql ?
    (7)
    i've started to learn php..im familiar to basics of php and mysql now.Now for example i want
    that some user can register to my website , and after that he can Login and log out , and he can see
    his profile.is there any tutorial about this ? or any helping url .. or any helping answer please
    /smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" />....
  22. Dynamic Image / Signature Generator
    a simple code to change text on an image (12)
    In search of dynamically changing quote, saying or all other types of text on an image I came across
    a code that I have modified to fit my initial usage. This procedure requires two files and short
    knowledge of PHP. If you are familiar with Trap17's sig rotation code you will understand this
    procedure very fast. Code 1: dynamic_sig.php (you can rename this to index.php and you'll see
    at the end why) Code 2: a simple text file named anything (I will call it name.txt ) Code 1
    CODE header("Content-type: image/png"); $image = imagecreatefrompng("../i....
  23. Include File.php?id=something
    using the include() function (13)
    Well, I am making a full CMS system for my site, and want to make the index.php file to include the
    view.php?id=1 file. I tried with this code, but it didn't work: CODE This is the error
    I get: CODE Warning: main(view.php?id=1) : failed to open stream: Invalid argument in
    C:\server\xampp\htdocs\test\index.php on line 1 Warning: main() : Failed opening
    'view.php?id=1' for inclusion (include_path='.;C:\server\xampp\php\pear\') in
    C:\server\xampp\htdocs\test\index.php on line 1 So what can I do?....
  24. File Uploading Issues
    (5)
    i have never tried to have files uploaded and i am still not able to do so. here is the codes that i
    am using right out of the php manual and it still isnt working. i have also listed the
    warnings/errors listed on the resulting page. my permissions are set to 777 also. i have a folder
    set up on my server as "uploads". i am however not sure if i have a default temp folder on my
    server. can anyone help me figure out what i am not doing correctly or what my next step is? this
    is the form that i am using: html Code: CODE        Choose a file to upload:     ....
  25. Error When Using file_put_contents()
    failed to call to undefined function (5)
    Hey all, I decided to write a script which writes some text to a file, but I have a problem when I
    execute the script, I get a fatal error: QUOTE(homepage) Fatal error : Call to undefined
    function: file_put_contents() in /home/cmatcme/public_html/afile.php on line 55 This is the
    code I'm using to write the file: $ipfnsdoc = "/home/cmatcme/public_html/afolder/afile.txt";
    if (!is_readable($ipfnsdoc)) { echo "File cannot be read"; $stopload = 1; } if
    (!is_writable($ipfnsdoc)) { echo " \nFile cannot be written to"; $stoploa....
  26. Script: Php Jukebox
    A one file script! (6)
    This scripts is so simple, you dont need to edit ANY of it! All you have to do is make a folder
    called 'songs' and put some audio files in it. Here is the whole page, I named it index.php
    and put it in a folder called 'music': CODE PHP jukebox ©2005 Craig lloyd.
    All rights reserved. Visit cragllo.com for more scripts --> /** * ©2005 Craig lloyd. All rights
    reserved. * * Mod Title:           Simple PHP Jukebox * Author:              Craig Lloyd * Author
    Email:        cragllo@cragllo.com * Author Homepage:     http://www.cragllo.com/ * Des....
  27. Getting List Of Directories And Files Using Php
    PHP Function for Directory and File List (6)
    is there a php function that lists the content of some folder.... example: /New folder new.txt
    left.gif download.zip dc.exe ....so is there..? /rolleyes.gif' border='0'
    style='vertical-align:middle' alt='rolleyes.gif' /> ....
  28. Pages In 1 File
    ?? (10)
    I know its possible to put many pages inside 1 file. But how? Lets say you have a guestbook with
    different pages for signing and viewing. How to make so those pages are in 1 file? /huh.gif"
    style="vertical-align:middle" emoid=":huh:" border="0" alt="huh.gif" />....
  29. Invision Power Board help
    Editing Redirections.. (5)
    I put the login for the forums on the index of my site. (mysite.com/index.php) I want to be able to
    log on there, then have it go to another page of my site (mysite.com/members/index.php), and link
    the forums from that page, rather than it redirecting me straight to the forums. Anyone have an idea
    on how to accompolish this?....
  30. PHP flash
    (8)
    function label($string) { global $f; $t = new SWFTextField(); $t->setFont($f);
    $t->addString($string); $t->setHeight(200); $t->setBounds(4000,200); return $t; }
    function addLabel($string) { global $p; $i = $p->add(label($string)); $p->nextFrame();
    $p->remove($i); } function rect($r, $g, $b, $signal)//buttonstyle { $s = new
    SWFShape(); if($signal==0) { $s->setRightFill($s->addFill(220, 220, 220)); }
    else { $s->setRightFill($s->addFill(10, 10, 10)); } $s->drawLine(1....

    1. Looking for php, flash, image, gallery, creating, editing, xml, file, viewing, o
Similar
Gallery Help Needed - errors help help
Php - Fetching Random Line From A Text File - and displaying it using AJAX/iframe
Linux/ Apache /mod_rewrite Issue - Error when accessing a file
Flash And Php - How?
Php Configuration File - "config.php"
Image Upload - ?!?
Creating Something With Co-ordinates With Php. - Something like you see in those web-based php games, like a map or som
Need Some Help In File Browser - listing all sub folders and files in them.
Updating Php File Through A Web Form
File Checker-how To Check File Whith Html Through Html?
Flash With Php
Get A Image Indentifier With Gd Library - GD library question
No File Extension
Creating A Login Box That Links To My Phpbb Forum - Have my phpBB Forum Intergrated with my Website
Php Only Gallery - I don't know PHP well and can't find a free script
File Upload - File upload
Trap17 Board Status Dynamic Image
<?php ?> Unique Visitors Script - Flat file unique visitors script (no sessions)
Evilboard (forum Software) - Multiple Categorys - Don't Work :( - I am creating a forum and i can't fix more then 1 category.
Watermark Your Image With Simple Php Script - found it on the net
Creating Profiles In Php/mysql ?
Dynamic Image / Signature Generator - a simple code to change text on an image
Include File.php?id=something - using the include() function
File Uploading Issues
Error When Using file_put_contents() - failed to call to undefined function
Script: Php Jukebox - A one file script!
Getting List Of Directories And Files Using Php - PHP Function for Directory and File List
Pages In 1 File - ??
Invision Power Board help - Editing Redirections..
PHP flash

Searching Video's for php, flash, image, gallery, creating, editing, xml, file, viewing, o
See Also,
advertisement


Php And Flash Image Gallery - Need some help in creating or editing an xml file while viewing some o

Affordable Web Hosting, Low cost Web Hosting - ComputingHost.com