Topic: Search on Gallery

Hi there,

I was just wondering if it is possible to have a search functionality within the gallery. Basically I have a a couple of galleries called animals, flowers and people.

Each images have captions in them (for example one of my images have been taken in Malysia, the other was in Brunei)

What I want to be able to do is when user types in a keyword (ie Malaysia or Brunei), the search results that will come up will be the link to the gallery that has that keyword within the caption.

Is this possible at all?

Re: Search on Gallery

SimpleViewer does not have built-in search functionality.
However, you could perhaps use Flickr as a source of images, tag your images with certain keywords and create your own search function which would then feed the search input into SimpleViewer using the flickrTags option via a flashvar when loading a gallery.
Please note that flickrTags is a SimpleViewer v2 option.

Steven Speirs
SimpleViewer Support Team.

Re: Search on Gallery

Here is a PHP index page which provides a search box for the user to type in a Flickr tag.
On clicking 'Submit', the gallery will display the correspondingly tagged images from the specified Flickr account.
Just change the 'flickrUserName' in the following code to your own Flickr username and name the page 'index.php'.
(Your web server must have PHP installed for this to work. Also, please note that this code is based on SimpleViewer v2 rather than SimpleViewer v1.)

<!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>Flickr Tag Input Demo</title>
    <style type="text/css">
    body, html {
        margin: 0;
        height: 100%;
    }
    #header {
        background-color: #222222;
        color: #ffffff;
        height: 5%;
        text-align: center;
    }
    #main {
        height: 95%;
    }
    </style>
</head>
<body>
    <div id="header">
            <form action="index.php" method="get">
                <div>Tag: <input type="text" name="tag">
                <input type="submit" value="Submit"></div>
            </form>
    </div>
    <div id="main">
        <!--START SIMPLEVIEWER EMBED.-->
        <script type="text/javascript" src="svcore/js/simpleviewer.js"></script>
        <script type="text/javascript">
        var flashvars={};
        flashvars.useFlickr="true";
        flashvars.flickrUserName="username";
        flashvars.flickrTags="<?php echo $_GET["tag"]?>";
        simpleviewer.ready(function () {
            simpleviewer.load('sv-container', '100%', '95%', '222222', true, flashvars);
        });
        </script>
        <div id="sv-container"></div>
        <!-- END SIMPLEVIEWER EMBED -->
    </div>
</body>
</html>
Steven Speirs
SimpleViewer Support Team.

Re: Search on Gallery

I tried using the google site saerch functionality. It did the search but via the XML. Is there by anyway we can use the XML within the svmanager as a part of the search functionality?

(see here:http://s000.tinyupload.com/index.php?file_id=85680909076061819296&gk=laptop)

Re: Search on Gallery

I tried using the google site saerch functionality. It did the search but via the XML.

This is the only file in which the image name is listed. Therefore, it will be the only result in the Google site search you performed.

svManager can manage and create galleries and can also create an index page of galleries but it does not have a search functionality built-in.

Try my solution above. It is relatively easy to set up (as it requires modification of only one file) and works well.

Steven Speirs
SimpleViewer Support Team.