Dynamic content slideshow.

  • 1
  • Question
  • Updated 2 years ago
  • Answered
Hello,

I am attempting to create a presentation for our animal shelter. This would be data that is always changing and updating so the content would have to be very dynamic. The idea I have in my head is this Broken down as simply as I know how.

1. A simple background with a frame.

2. In this frame the ideal widget would then be pulling photos of available adoptions from a share drive on our network/web server.

My questions are essentially as such, What widget needs to be used and how do I point it to a local directory to use all content in said directory with a *.jpg type.

 My goal is to make the content of the slides as dynamic as possible while still easy to maintain for the staff of the animal shelter.

If what I want is unsupported or just unrealistic, I appreciate your time in this.
Photo of Evan Knowlton

Evan Knowlton

  • 90 Points 75 badge 2x thumb

Posted 2 years ago

  • 1
Photo of Robb

Robb, Official Rep

  • 76,676 Points 50k badge 2x thumb
Hi Evan,

Actually, I think we have a very simple option for this: The Image Widget!

Here is what you would do:
  1. At Rise Storage (https://storage.risevision.com), create a Folder called Available Adoptions. In that folder, upload all the images that you want to show.
  2. In your Presentation Placeholder, click Image, and in the Storage window that jumps up, select that Available Adoptions folder.
  3. Once the folder has been added to your Placeholder, you can click on it in the Placeholder Playlist to modify the duration, image scaling, etc.
This way, all you have to do is upload or delete files from that folder, and the Widget will automatically check and add/remove any images that are no longer included.

Will that work?
Photo of Evan Knowlton

Evan Knowlton

  • 90 Points 75 badge 2x thumb
Yes, I am aware that is an option.

However I was attempting to avoid using an external storage solution.Is there no way to map it to folder hosted internally on our web server?
Photo of Robb

Robb, Official Rep

  • 76,676 Points 50k badge 2x thumb
You could point to all of those individual files in that folder, for example if there are 20 images, you could add 20 individual Image Widgets pointing to those URL's, but the folder functionality only works with Rise Storage.

Thanks!
Photo of Nathan Neuschwander

Nathan Neuschwander

  • 350 Points 250 badge 2x thumb
I use this php to pull random pictures from a web folder using the web page widget.

<?php

/////////////////////////////////////////////////////////////////////
// This is the only portion of the code you may need to change.
// Indicate the location of your images 
$root = '';
// use if specifying path from root
//$root = $_SERVER['DOCUMENT_ROOT'];

$path = 'images/';

// End of user modified section 
/////////////////////////////////////////////////////////////////////
 
function getImagesFromDir($path) {
    $images = array();
    if ( $img_dir = @opendir($path) ) {
        while ( false !== ($img_file = readdir($img_dir)) ) {
            // checks for gif, jpg, png
            if ( preg_match("/(\.gif|\.jpg|\.png)$/", $img_file) ) {
                $images[] = $img_file;
            }
        }
        closedir($img_dir);
    }
    return $images;
}

function getRandomFromArray($ar) {
    mt_srand( (double)microtime() * 1000000 );
    $num = array_rand($ar);
    return $ar[$num];
}


// Obtain list of images from directory 
$imgList = getImagesFromDir($root . $path);

$img = getRandomFromArray($imgList);
?> 
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="utf-8" />
    <title>Landscape</title>
    <style type="text/css">
    </style>
</head>

<body>

    <img src="<?php echo $path . $img ?>" alt="" />

</body>

</html>
Photo of Evan Knowlton

Evan Knowlton

  • 90 Points 75 badge 2x thumb
Thanks for the amazing response. . . I have kind of a dumb question about defining of the root or path.

Is it looking for an absolute root such as:

\\websrv\c$\inetpub\wwwroot\Aztecnmgov\rvimg\Adoptions

or is it looking for a generic html path such as :

http://www.aztecnm.gov/rvimg/adoptions/IMAG0440.jpg

I understand this is probably a very novice question but I just wanted to be sure unless I'm completely wrong on both fronts.

I apologize for the delayed response more pressing issues came up and as a side project this just kind of got shelved.
Photo of Scott Williams

Scott Williams

  • 464 Points 250 badge 2x thumb
Evan,
I believe in order to do this you will need to build a web page on your web server (The server must also be running PHP) that you put the above code into to display a random image from a folder on THAT server. 

Once that is done (you should be able to load that page and see a random image on every page load) you can pull that web page into Rise with the web page widget.

The path or root settings depend on where your images are relative to the web page you build.

If they are in a directory under the same path then you just need the path.
If not then you need to comment that $root= ' ' part and use the $root = $_SERVER['DOCUMENT_ROOT'] part.

Hope that helps