www.webdeveloper.com
Results 1 to 7 of 7

Thread: passing object info without a db?

  1. #1
    Join Date
    Jul 2008
    Posts
    53

    passing object info without a db?

    hi all,

    i have a question that i am hoping someone on here can answer

    i am working on something at the moment that kind of works but at the same doesn't.

    i have a number of swf files that have objects fed into them via php docs and mainly from a document called exhibits.php - within this document there are sections and objects/exhibits and unique id's for each.

    in the flash movie if one of the php objects is clicked it opens a pop up panel within flash that displays thumbnails/large images and some information about the object.

    so here is my problem, when the php fed flash object is clicked it calls up the document called getObjectInfo.php along with the object id as a suffix - getObjectInfo.php?oid=123 - and the pics and info appear.

    ...but it only reads the info of the one object in the getObjectInfo.php document. regardless of the id etc...

    i have tried adding all of the object details into getObjectInfo.php but it simply stops it working period. i also tried duplicating the getObjectInfo.php adding the specific individual details and then renaming the file to include the object id - getObjectInfo.php?oid=123 this doesn't work either.

    is it possible to add more than one object to the getObjectInfo.php document? without the use of a db - the project originally used a postgres db - i have the dump saved some time ago - but the dump doesn't like the media temple postgres server for some reason - so i am trying to wing it by not using a db - is it possible to do this? or am i doing the equivalent of nailing jelly to a tree?!?

    this is the getObjectInfo.php document content in it's entirity
    PHP Code:
    <response id="730" prevURL="media/gallery/images/main_730.jpg">
    <
    title><lang id="pl"><![CDATA[<strong>title</strong>]]></lang></title>

    <
    short><lang id="pl"><![CDATA[Lorem ipsum dolor sit ametconsectetur adipiscing elitMaecenas vitae sem ipsumsit amet vulputate urnaCurabitur massa auguetempus non pharetra sedfringilla eu lacusLorem ipsum dolor sit ametconsectetur adipiscing elitQuisque pretium fermentum diamet porttitor tellus pretium euAliquam facilisis tempus urna et eleifendFusce sit amet orci id felis sodales porttitorNunc tincidunt hendrerit lobortisNam id neque velitquis commodo eratDonec at gravida miPraesent volutpat eleifend justosed posuere neque pellentesque necPhasellus adipiscing mattis risus non mattisNullam scelerisque lectus et erat vestibulum imperdietMauris et nulla puruseget ornare orciCurabitur blandit dolor in nibh rutrum viverra pretium turpis posuere]]></lang></short>

    <
    description><lang id="pl"><![CDATA[<p><span>Lorem ipsum dolor sit ametconsectetur adipiscing elitMaecenas vitae sem ipsumsit amet vulputate urnaCurabitur massa auguetempus non pharetra sedfringilla eu lacusLorem ipsum dolor sit ametconsectetur adipiscing elitQuisque pretium fermentum diamet porttitor tellus pretium euAliquam facilisis tempus urna et eleifendFusce sit amet orci id felis sodales porttitorNunc tincidunt hendrerit lobortisNam id neque velitquis commodo eratDonec at gravida miPraesent volutpat eleifend justosed posuere neque pellentesque necPhasellus adipiscing mattis risus non mattisNullam scelerisque lectus et erat vestibulum imperdietMauris et nulla puruseget ornare orciCurabitur blandit dolor in nibh rutrum viverra pretium turpis posuere</p><p><a href="http://www.link.com"><b>Visit...</b></a> </p>]]></lang></description>

    <
    gallery><item id="730" ico="media/gallery/images/thumb_729.jpg" file="media/gallery/images/image_729.jpg" src="media/gallery/images/sources/sourceBig_729.jpg" type="jpg">

    <
    lang id="pl"><![CDATA[]]></lang></item><item id="730" ico="media/gallery/images/thumb_730.jpg" file="media/gallery/video/video.flv" src="media/gallery/video/video.flv" type="flv"><lang id="pl"><![CDATA[]]></lang></item><item id="731" ico="media/gallery/images/thumb_731.jpg" file="media/gallery/images/image_731.jpg" src="media/gallery/images/sources/sourceBig_731.jpg" type="jpg">

    <
    lang id="pl"><![CDATA[]]></lang></item><item id="732" ico="media/gallery/images/thumb_732.jpg" file="media/gallery/images/image_732.jpg" src="media/gallery/images/sources/sourceBig_732.jpg" type="jpg">

    <
    lang id="pl"><![CDATA[]]></lang></item><item id="733" ico="media/gallery/images/thumb_733.jpg" file="media/gallery/images/image_733.jpg" src="media/gallery/images/sources/sourceBig_733.jpg" type="jpg">

    <
    lang id="pl"><![CDATA[]]></lang></item><item id="734" ico="media/gallery/images/thumb_734.jpg" file="media/gallery/images/image_734.jpg" src="media/gallery/images/sources/sourceBig_734.jpg" type="jpg">

    <
    lang id="pl"><![CDATA[]]></lang></item><item id="735" ico="media/gallery/images/thumb_735.jpg" file="media/gallery/images/image_735.jpg" src="media/gallery/images/sources/sourceBig_735.jpg" type="jpg">

    <
    lang id="pl"><![CDATA[]]></lang></item><item id="736" ico="media/gallery/images/thumb_736.jpg" file="media/gallery/images/image_73ß∑ß˙6.jpg" src="media/gallery/images/sources/sourceBig_736.jpg" type="jpg"><lang id="pl"><![CDATA[]]></lang></item></gallery>

    </
    response
    this works fine but i can only see this information and can't add any other objects nor change the details to the specific object - how do i add the other objects to this code? any ideas?
    ...please...


  2. #2
    Join Date
    Jan 2009
    Posts
    3,346
    The short answer is yes you can manually edit the file or store its pieces to a text file to read into the php file. What you have as your contents for the php file in question is not using any php at all and could just as easily be a text file. The long answer is that there was probably a good reason the developer decided to use a db to populate the file...

  3. #3
    Join Date
    Jul 2008
    Posts
    53
    thanks for that criterion9, but returning to my original question, how do i add more individual objects to the main getObjectInfo.php file?

    duplicating the id response seems to throw it into a dizzy - and as far as i can see, there are no clues to how it makes multiple objects work.

    i am only too aware of how vague this question is, but what i am trying to work out is how to make this work via multiple objects.

    ...anyone?

  4. #4
    Join Date
    Jul 2008
    Posts
    53
    ...is there any way of creating a predefined document for the flash to files to bring in?

    the thing that i am finding hard to get my head around is the that - if one of the 'exhibit' items is clicked it does bring in the title/text/images/video defined as above - but if i adapt a file by adding the suffix php?oid=123 (or whatever the id number is) the flash does call the same .php?oid=123 but not with the specific details - it calls in the object details from my first post regardless of which exhibit is clicked.

    can i not 'force' the info from the predefined document with the manually added suffix .php?oid=123 - would that be possible to do with privileges or something?

    or is there any banchmark tags i need to add to the docs to make it work as if it were dynamically created?

    ...please?

  5. #5
    Join Date
    Jan 2009
    Posts
    3,346
    The problem you are having using _GET variables is that there is not PHP in your PHP file so it will always give you the same output. You could rename your file with a .xml extension and get the same results. Are you planning to learn PHP to make this happen?

  6. #6
    Join Date
    Jul 2008
    Posts
    53
    hi criterion9, thanks for the reply, appreciate it
    ...well, i don't think i can learn the full php methodology in a space of time i have free on this. but i 'do' understand what you are telling me, and realise that i have elemental problems with the document/data in it's basic lack of correct functioning set up.

    ...but that is what i was hoping that someone on here could put me right with - everything else works great (even this doc in theory - it passes the info/images/link to the relevant part of flash) - but i just can not work out what to do to give the document functioning as a proper list of object details - i know that it should be using a functioning db - but i am trying to sort this out as a favour/bail out for a friend of mine, who was left high and dry by the chap who was originally doing this for him - the original db was postgres (something i know little/nothing about) - i have the pgsql dump that my friend had amongst his files - but it doesn't seem to like being pasted into the pgsql db in the same one normally does to restore mysql/php db's.

    ...so long and short of it is i was hoping that either...
    a: someone on here could put me right and show me how to create a list of multiple items in the getobjectinfo.php doc by adding the required tags/script,

    or

    b: someone could tell me how i could edit the main getobjectinfo.php document to include individual object details, rename it to include the relelvant suffix (.php?oid=123) and then hopefully the flash would take that as being the dynamically/db generated file and simply call in the info from that file.

    but it doesn't seem to be a simplistic as that


    is there any standard scripting that i need to add to get either to work as i want/need it to other than < php? > and < /php >

    be grateful for anything you can throw my way

  7. #7
    Join Date
    Jan 2009
    Posts
    3,346
    Your best bet is to recreate the db in mysql if that is what you are familiar to. ?oid=blah translates to _GET['oid'] in the script. You are really going to be way over your head trying to get this to work without learning the very basics of php which you can find very quickly with a simple google search. I would recommend you hire a freelancer if this is a time sensitive issue. Many can be found on a number of sites such as getafreelancer, or rentacoder.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles