Topic: Simpleviewer 2.0 not working on iphone

Dear Simpleviewer,

I have been trying to get this great program to work on an iphone. It's working fine on the web in all browsers

When I try & get it to run on iphone I get "Gallery xml not found". After some testing I tracked down the problem - I use a dynamic image gallery so have changed the gallery.xml to gallery.asp & this change stops it working on the iphone although it will work on all standard browsers even safari so is not a browser issue with gallery.asp on a standard pc.

a)flashvars.galleryURL = "gallery.asp"; (works on all browsers & not on iphone)
b)flashvars.galleryURL = "gallery.xml"; (works on all browsers & iphone)

I read the various posts & it seems that changing the content type can resove this issue

<cfcontent type="text/xml; charset=UTF-8" reset="Yes" />

I have tried various options like adding
response.AddHeader "Content-Type", "text/xml;charset=UTF-8"

to the index.asp gallery page & it just falls over on a standard browser

Any advice help on this would be great.

Apart from this it works really well (click view slideshow on link below) - it would be great to get this working on the iphone too.

http://www.jeffkrotz.com/order_photos_m … geNumber=1

Re: Simpleviewer 2.0 not working on iphone

Have you tried using Response.ContentType = "text/xml" to set the content type?

http://support.microsoft.com/kb/301244

Mike Richards
SimpleViewer Support Team.

Re: Simpleviewer 2.0 not working on iphone

Hi Mike -  thanks for the reply I have tried adding

<%
Response.ContentType = "text/xml"
%>

to gallery.asp - it doesn't generate errors but still no iphone

adding to index.asp gives XML Parsing Error:

this is the link - as you can see it works in all browsers OK - just not on iphone
http://www.jeffkrotz.com/simpleviewer/index.asp

For some reason the cut down browser on the iphone doesn't seem to like

flashvars.galleryURL = "gallery.asp";

it only works if I change it to flashvars.galleryURL = "gallery.xml";

Re: Simpleviewer 2.0 not working on iphone

It doesn't seem to be working on my Palm Pre either. Can you post the code for the gallery.asp page?

Mike Richards
SimpleViewer Support Team.

Re: Simpleviewer 2.0 not working on iphone

Great thanks - Mike I have emailed the test scripts to support@simpleviewer.net

Please let me know if I should upload them here

many thanks for your help

Re: Simpleviewer 2.0 not working on iphone

If you could post the source in this thread that would be great.

Mike Richards
SimpleViewer Support Team.

Re: Simpleviewer 2.0 not working on iphone

code for index.asp is:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html"><head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8">
   
    <title>SimpleViewer Gallery</title>
</head>

<style type="text/css">   
    /* hide from ie on mac \*/
    html {
        height: 100%;
        /*overflow: hidden;*/
    }   
    #flashcontent {
        height: 100%;
    }
    /* end hide */
    body {
        height: 100%;
        margin: 0;
        padding: 0;
    }   
   
</style>
<body >
   
    <!--START SIMPLEVIEWER EMBED.-->
    <script type="text/javascript" src="svcore/js/simpleviewer.js"></script>
    <script type="text/javascript">
    var flashvars = {};
    flashvars.galleryURL = "gallery.asp";
    var params = {};
    params.wmode = "";
    var attributes = {};
    attributes.id = "svInstance";
   
    jQuery(document).ready(function () {
    SV.simpleviewer.load("sv-container", "100%", "100%", "222222", true, flashvars, params, attributes);
    });
    </script>
   
   
    <!--<script type="text/javascript">
    jQuery(document).ready(function () {
        SV.simpleviewer.load('sv-container', '100%', '100%', '222222', true);
    });
    </script>-->
    <div id="sv-container" ></div>
    <!-- END SIMPLEVIEWER EMBED -->

</body>
</html>


code for

gallery.asp is below -  the 'Response.ContentType = "text/xml" is commented out as it didn't reolve the problem

<%
'Response.ContentType = "text/xml"
%>
<?xml version="1.0" encoding="UTF-8"?>

<simpleviewergallery
   
    galleryStyle="MODERN"
    title="SimpleViewer Gallery"
    textColor="FFFFFF"
    frameColor="FFFFFF"
    frameWidth="20"
    thumbPosition="LEFT"
    thumbColumns="3"
    thumbRows="3"
    showOpenButton="TRUE"
    showFullscreenButton="TRUE"   
    maxImageWidth="640"
    maxImageHeight="640"
    useFlickr="false"
    flickrUserName=""
    flickrTags=""
    languageCode="AUTO"
    languageList=""       
    imagePath="images/"
    thumbPath="thumbs/"
   
>

<image imageURL="images/wide.jpg" thumbURL="thumbs/wide.jpg" linkURL="" linkTarget="" >
    <caption><![CDATA[Welcome to <u><a href="http://www.simpleviewer.net" target="_blank">SimpleViewer</a></u>.]]></caption>   
</image>

</simpleviewergallery>

Re: Simpleviewer 2.0 not working on iphone

I don't know a lot about using asp, but can you pass plain xml like that? Shouldn't it be a bit more like the example found in the link below?

http://www.cyberslingers.com/weblog/pos … Flash.aspx

Mike Richards
SimpleViewer Support Team.

Re: Simpleviewer 2.0 not working on iphone

That's asp.net which is slightly different as this is classic asp - the previous link is a similar idea here:

http://support.microsoft.com/kb/301244

the actual gallery.xml code I'm using on the live site is more complicated than the test scripts & I have listed it below & it does work in this format

This link below is an example of an image gallery from the live site & as you can see it works in all browsers - including safari although in earlier versions say safari 3 you have to refresh the page for the gallery to load - click "view slideshow on this link"

http://www.jeffkrotz.com/order_photos_m … geNumber=1

I think the issue is to do with the cut down version of the safari browser running on the iphone not liking this. I'm not sure it worth trying to recode the script below just to get it to work on the iphone -maybe if this was converted into proper .net code it would work.

Also another tip for anyone using this gallery in an iframe as per the above link - they need to add in this css to get rid of the white border around the gallery in IE6 & safari & some other browsers

<style type="text/css">   
    /* hide from ie on mac \*/
    html {
        height: 100%;
        overflow: hidden;
    }   
    #flashcontent {
        height: 100%;
    }
    /* end hide */
    body {
        height: 100%;
        margin: 0;
        padding: 0;
    }   
   
</style>

'=====script listing - this is the gallery.xml script which generates the xml code

<%
Response.Expires = 60
Response.Expiresabsolute = Now() - 1
Response.AddHeader "pragma","no-cache"
Response.AddHeader "cache-control","private"
Response.CacheControl = "no-cache"
%>
<!--#include file="conn_str.asp"-->
<%
            MyPage = session("PageNumber")
            If MyPage = "" Then MyPage = 1
            PageSize = 15
            NoResults = false
           
            set conn = server.createobject("adodb.connection")
            conn.Open DbConn_ConnectionString
           
            '################we've already checked that Session("MasterID") has a value in the top frame
            'if Session("MasterID") = "" then
            %>
<!--<script language="JavaScript">
                            open("events-viewer.asp","_top")
            </script>-->
<%
            'else
                MasterID = Session("MasterID")
            'end if
           
            sqlstmt = "SELECT DISTINCT FileName,Prod_Code,Name from basket where MasterID =" & MasterID
            sqlstmt = sqlstmt & " ORDER BY Prod_Code"
           
            '===============new MySQL version
            sqlstmt = sqlstmt & " LIMIT " & (MyPage-1)*PageSize & ", " & PageSize
            '===============end
           
           
                            '===============new MySQL version
                            SQLFirstCount = "SELECT COUNT(DISTINCT FileName) AS NumRecords from basket where MasterID =" & MasterID 
                            SQLFullCount = SQLFirstCount & sql
                            Set rs2 = conn.Execute (SQLFullCount)
                            'allrecords = CLng(rs2("NumRecords"))
                            allrecords = rs2("NumRecords")
                            allpages = (allrecords / PageSize) - 0.5
                            allpages = CInt(allpages) + 1
                            set rs2 = Nothing
                            '===============end
           
            Set rs = Server.CreateObject("ADODB.Recordset")
            rs.Open sqlstmt, conn, 3, 3
           
            If session("PageNumber") = "" Then
              intPageNum = 1
            Else
              intPageNum = CInt(session("PageNumber"))
            End If
           
            If rs.Eof or rs.Bof Then
               NoResults = true
               else
               Name = rs("Name")
            End If
            '=======================
%>
<?xml version="1.0" encoding="UTF-8"?>

<simpleviewergallery
   
    galleryStyle="MODERN"
    title="&lt;font size=&quot;13&quot;&gt;<%=Name %>&lt;/font&gt;"
    textColor="FFFFFF"
    frameColor="ffffff"
    frameWidth="0"
    thumbPosition="LEFT"
    thumbColumns="3"
    thumbRows="5"
    showOpenButton="TRUE"
    showFullscreenButton="TRUE"   
    maxImageWidth="1100"
    maxImageHeight="850"
    useFlickr="false"
    flickrUserName=""
    flickrTags=""
    languageCode="AUTO"
    languageList=""       
    imagePath="images/<%=MasterID%>/"
    thumbPath="images/<%=MasterID%>/"
   
>
  <%
               If Not NoResults then
                         For intCount = 1 To pagesize            
                                    If rs.EOF Then Exit For
                                                Name = rs("Name")
                                                FileName = rs("Filename")
                                                Prod_Code = rs("Prod_Code")
                                                'ID = rs("ID")
                                                %>
                                                  <%If FileName <> "" Then %>
                                                                  <%
                                                                          ImageName = left(FileName,Len(FileName)-4)
                                                                        ThumbFileName = left(FileName,Len(FileName)-4) & "thumb" & ".jpg"
                                                                        theFile = Server.MapPath("images") &"\"& MasterID &"\"& FileName
                                                                       
                                                                %>
                                                                 <image imageURL="images/<%=MasterID%>/<%=FileName%>" thumbURL="images/<%=MasterID%>/<%=ThumbFileName%>" linkURL="" linkTarget="" >
                                                                <caption><![CDATA[<% If intPageNum > 1 Then %><a href="order_photos_main_gallery.asp?PageNumber=<%=(MyPage-1)%>" target="_top"><font color="#FF0000" size="16">&lt; Last 15&nbsp;&nbsp;&nbsp;&nbsp;</font></a><% End If %><% If intPageNum < allpages Then %><a href="order_photos_main_gallery.asp?PageNumber=<%=(MyPage+1)%>" target="_top"><font color="#FF0000" size="16"> Next 15 &gt;</font></a><% End If %><br><a href="shop.asp?fileloc=<%= MasterID %>&picid=<%=ImageName %>" target="mainarea"><font color="#FF0000" size="16">Order Print</font></a>]]></caption>
                                                                </image>
                                                                    <%
                                                 End If
                                               
                                        rs.MoveNext
                                        If rs.EOF Then Exit For
                                       
                                                 
                         Next
            End If       
                                   
             %>
</simpleviewergallery>
<%
rs.Close
Set rs = nothing

conn.Close
Set conn = nothing
%>

Re: Simpleviewer 2.0 not working on iphone

Huh, in the past there have been similar issue with php and setting the content type fixed it. Maybe try forcing utf8 in addition to the content type, not sure if that would be done with ContentEncoding or CodePage or CharSet for XML in ASP.

Mike Richards
SimpleViewer Support Team.

Re: Simpleviewer 2.0 not working on iphone

Hi Mike - I have been doing some more work on this - if you disable flash in the browser then you get this message xml gallery not found- since iphone has no flash allowed - I think this is the reason why it's appearing. I am going to try & work around & setup a flash detection & manually redirect the user to the full.html which is the non flash version. I can get this to work but I get a javascript error Error: 'parameters.galleryURL' is null or not an object  - although if you close this down it will work

I have installed this program manually by editing the html & .js scripts rather than using the svBuilder & think this is the main problem

will keep you posted - thanks alot for your help!!

Re: Simpleviewer 2.0 not working on iphone

Hi Mike - just one last question

Is there any info on how to configure the non flash version
when I browse to this file in the simpleviewer zip -  svcore/full.html   it plays a non flash version of the  viewer although it seems to throw up javascript errors Error: 'parameters.galleryURL' is null or not an object

If I could manully redirect to a non flash version of the viewer then this would be a work around for the iphone not running flash

cheers

Re: Simpleviewer 2.0 not working on iphone

There are not a lot of built-in configuration options for the mobile gallery, however it is still in active development.

If I could manully redirect to a non flash version of the viewer then this would be a work around for the iphone not running flash

You could try using swfobject for this.

Mike Richards
SimpleViewer Support Team.