Topic: IE 7 does not load new galleries

I have an existing photo site built with PHP and MYSQL that I am attempting to adapt to simple viewer.

With PHP and MYSQL I query the database for the image names and path.  I then dynamically build the XML file used by simpleviewer each time. 

Works wonderfully in Firefox.  The intial load of the page has an empty QueryString which defaults the page load to the most recent photos.  Select from the menu (2001, 2002, etc) and the XML is rebuilt with the new information and the new pictures are displayed.

In IE 7 the initial XML file is built and the page displays correctly. However, selecting another menu option does not update the photos?!?!  Behind the scenes I can see that the XML file is being recreated with the correct information but it is not translating to the flash object.

It appears as if the flash object is cached in IE and will not update?!?!

Any ideas would be appreciated.

Re: IE 7 does not load new galleries

Okay, it was a matter of IE cache the xml file.  I inserted some code to concate a random number on the end of the file and now IE reloads the file each time. 

        srand &#40;&#40;double&#41; microtime&#40; &#41;*1000000&#41;;
        $random_number = rand&#40;0,10000&#41;;
        echo 'fo.addVariable&#40;"xmlDataPath", "./xml/current.xml?'. 
$random_number . '"&#41;';

Re: IE 7 does not load new galleries

hi viewaskew
could you elaborate a little more on your solution? It may help me with the problem I am having...

Where did you insert that code?
If I was to insert it into my file, do I have to change any of the code? or is it all relative in such a way that all I have to do is copy and paste the code to my file?

I really appreciate your help... wink

Re: IE 7 does not load new galleries


You should be able to make use of the code by simply copying and pasting. 

The random number generation is strictly for the simpleviewer piece and IE.  I do the work to query the database and build the XML file initially, then use the (somewhat modified) sample simpleviewer code to point to the newly generated XML file.

The code is taken from the simpleviewer sample.  The only change are the 2 lines to generate a random number and adding the "?<random number>" to the end of the XML path.

Since the xml file name remains the same, IE will not load the file again upon refresh.  Instead it is being "helpful" and using the cached file.  Tacking the random number on the end of the file makes IE refresh the file each time the page is refreshed.

Let me know if this actually answers your question.

<php....query the database, build the XML.....?>

    <script type="text/javascript">
        var fo = new FlashObject&#40;"viewer.swf", "viewer", "100%", "100%", "8", "#181818"&#41;;        
        fo.addParam&#40;"scale", "noscale"&#41;;
        srand &#40;&#40;double&#41; microtime&#40; &#41;*1000000&#41;;
        $random_number = rand&#40;0,10000&#41;;
        echo 'fo.addVariable&#40;"xmlDataPath", "./xml/current.xml?'. $random_number . '"&#41;';

Re: IE 7 does not load new galleries

hmm .. thanks viewaskew..
I think however that it doesnt apply to my problem..
Thank you anyway for clarifying.. perhaps someone else will benefit from it.
Best regards  wink