Author Topic: Random images displayed remotely  (Read 18473 times)

0 Members and 1 Guest are viewing this topic.

Offline TGreene

  • album.pl Donor
  • album.pl User
  • *
  • Posts: 16
  • Karma: +0/-0
  • I forgot to change the default text
Random images displayed remotely
« on: July 07, 2004, 08:10:24 »
I'm trying to figure out how to display a random image on the sidebar of my home page, but can't figure it out...  I've searched hiigh and low, and read just about everything here, but can't seem to figure it out.   ???

The following snippit of code is what I'm using to no avail:
[img width= height=]http://gallery.gr-outdoors.com/cgi-bin/album.pl?random=1;ssi=2;photo_width=120[/img]

I also want to get rid of the blue border and use #786035, so it matches my site.

Any help would be greatly appreciated.

-Tim
« Last Edit: July 07, 2004, 08:14:05 by TGreene »

Offline adwiseman

  • album.pl Contributor
  • ***
  • Posts: 53
  • Karma: +3/-0
    • akwiseman
Re: Random images displayed remotely
« Reply #1 on: July 07, 2004, 09:29:52 »
I know what you mean, it's frustrating.  I never did get a good responce and snippets of code for how to use this feature.

Here's what I have been doing.

Use a IFRAME

Code: [Select]
<IFRAME src="http://www.akwiseman.com/cgi-bin/album.pl?random=1;ssi=1&slideshow=5" body width="150" height="103" scrolling="no" marginwidth="0" marginheight="0" frameborder="0">
    <BR>
Your browser does not support frames.<BR></IFRAME>

And for the background color, I couldn't figure out how to change without adding to the album.pl script.

Find in the SUB ShowObject

Code: [Select]
# Add slide show randomizer
if ($::randompic && $::slide_timer)
{
$object_html="<html><head>\n";
$object_html.="<meta http-equiv=\"Refresh\" content=\"$::slide_timer; url=$::albumprog?random=1&ssi=$::ssi&slideshow=$::slide_timer\">\n";
$object_html.="</head><body>\n";
}
$object_html.="<div class=\"ssirecentuploads\">\n";

And add a body color to it the body script   <body bgcolor="#786035">

Code: [Select]
# Add slide show randomizer
if ($::randompic && $::slide_timer)
{
$object_html="<html><head>\n";
$object_html.="<meta http-equiv=\"Refresh\" content=\"$::slide_timer; url=$::albumprog?random=1&ssi=$::ssi&slideshow=$::slide_timer\">\n";
$object_html.="</head><body bgcolor="#786035">\n";
}
$object_html.="<div class=\"ssirecentuploads\">\n";

Any one else out there have examples if getting a simple random image from album.pl, or slide show random image embedded into a web page?

Adam
www.akwiseman.com

Offline TGreene

  • album.pl Donor
  • album.pl User
  • *
  • Posts: 16
  • Karma: +0/-0
  • I forgot to change the default text
Re: Random images displayed remotely
« Reply #2 on: July 07, 2004, 13:03:14 »
The <IFRAME> tags worked, but I now have a couple more issues to work through, but I haven't a clue as to where to be...  ???

1) My images are sized for the <IFRAME>, but then when clicked on, they remain small, rather than showing full sized in the TARGET window.

2) In order to layout properly, I need to be able to order up a specific URL, not just a TARGET tag. The reason for this, is that scrolling is disabled on the {HOME} page, due to the layout of the images that are displayed. Also, for the navigational bars to coincide w/ the Photo Gallery, I need to call up a specific index page that loads the frames as ordered, then dumps the proper image into place. (probably not possible)

3) I'm not able to change either the border color or background colors of the <IFRAME>.

My URL is www.gr-outdoors.com, so you can see what's happening here...

« Last Edit: July 07, 2004, 13:10:46 by TGreene »

Offline adwiseman

  • album.pl Contributor
  • ***
  • Posts: 53
  • Karma: +3/-0
    • akwiseman
Re: Random images displayed remotely
« Reply #3 on: July 07, 2004, 14:44:42 »
As for Question 1)
Your default image size in the album.cfg file is small.  If you change this to be full size you will get full size, or use auto size, it will fit the frame size of the main page.

Code: [Select]
# The "default" size used to display photos. If left blank (or set to zero), photos are displayed at their normal size.
# default_size=0 --> Do not set a default size
# default_size=1 --> Show all photos using small_width and small_height as the default
# default_size=2 --> Show all photos using medium_width and medium_height as the default
# default_size=3 --> Show all photos using large_width and large_height as the default
# default_size=4 --> Show all photos using automatic sizing as the default
default_size=4


As to question 3)
The only way I could figure out how to change the background color of the iframe, is to add it to the album.pl script.  I added it to the script that album generates when requesting random image output in SSI=? format.  See my previous post

As for #2)  For not being a Web developer, I'm quite impressed I figured out questions 1 and 2.  You've lost me on this one.

Offline TGreene

  • album.pl Donor
  • album.pl User
  • *
  • Posts: 16
  • Karma: +0/-0
  • I forgot to change the default text
Re: Random images displayed remotely
« Reply #4 on: July 07, 2004, 15:48:03 »
As for Question 1)
Your default image size in the album.cfg file is small.  If you change this to be full size you will get full size, or use auto size, it will fit the frame size of the main page.

NOPE -- It's set for full sized viewing.
Also, I tried the code you suggested, but it did nothing for the colors.

FWIW:  I am using ver 6.5 that Mike installed and setup for me.

Offline Mike Bobbitt

  • album.pl Author
  • Administrator
  • I Spend Too Much Time Here
  • *****
  • Posts: 3381
  • Karma: +35/-2
    • Mike's Development Archive
Re: Random images displayed remotely
« Reply #5 on: July 07, 2004, 16:44:34 »
Ok, this may help... Just added into the 6.5 beta, you can now use a URL like the folliwing:

Code: [Select]
<IMG SRC="http://gallery.gr-outdoors.com/cgi-bin/album.pl?image=random">
or

Code: [Select]
<IMG SRC="http://gallery.gr-outdoors.com/cgi-bin/album.pl?image=randthumb">
This will show a randomly selected image or thumbnail from your album. This means you no longer have to worry about using iframes or diddling with background colours.

NOTE: The thumbnail routine assumes that every image has a thumbnail. If that's not true, you may occasionally get broken links.

Offline TGreene

  • album.pl Donor
  • album.pl User
  • *
  • Posts: 16
  • Karma: +0/-0
  • I forgot to change the default text
Re: Random images displayed remotely
« Reply #6 on: July 07, 2004, 17:11:23 »
Mike, can you go into my server and add in the proper code as well..?  remember, you rewrote some sopecial stuff for me, so i can't simply download a new copy of Album.pl   :'(

PS:  I do have the string updated in my regular HTML pages, so whenever the new updates are added into my files, they should work.

Offline Mike Bobbitt

  • album.pl Author
  • Administrator
  • I Spend Too Much Time Here
  • *****
  • Posts: 3381
  • Karma: +35/-2
    • Mike's Development Archive
Re: Random images displayed remotely
« Reply #7 on: July 07, 2004, 17:22:29 »
Hi Tim,

You're up to date. I also added a few of the other updates as well.


Cheers

Offline TGreene

  • album.pl Donor
  • album.pl User
  • *
  • Posts: 16
  • Karma: +0/-0
  • I forgot to change the default text
Re: Random images displayed remotely
« Reply #8 on: July 07, 2004, 17:34:46 »
Outstanding, thanks a million. 

More GOOD KARMA points to you!  ;D

Offline TGreene

  • album.pl Donor
  • album.pl User
  • *
  • Posts: 16
  • Karma: +0/-0
  • I forgot to change the default text
Re: Random images displayed remotely
« Reply #9 on: July 07, 2004, 18:10:25 »
*IF* there is a way to add something to the new IMG tag that would allow me to click on it and send the same imnage elsewhere, to a fullsized BLANK screen, then that would be killer, and would essentially get me around all of the issues I was running into.

The problem is, the way I have developed my site, you are loading 5 nested frames from 3 various domain subdirectories, every time you view a singlre page, so it's beginning to get really interesting on my end...  ;D


BTW:  I did try pulling and then resizing the thumbnails (for the smaller file size), but they wouldn't load and only gave me a RED-X.
« Last Edit: July 07, 2004, 18:13:04 by TGreene »

Offline TGreene

  • album.pl Donor
  • album.pl User
  • *
  • Posts: 16
  • Karma: +0/-0
  • I forgot to change the default text
Re: Random images displayed remotely
« Reply #10 on: July 07, 2004, 18:21:47 »
Wooohoooooo...  I got it working!  ;D ;D ;D ;D ;D

Offline Mike Bobbitt

  • album.pl Author
  • Administrator
  • I Spend Too Much Time Here
  • *****
  • Posts: 3381
  • Karma: +35/-2
    • Mike's Development Archive
Re: Random images displayed remotely
« Reply #11 on: July 07, 2004, 19:16:18 »
Sounds like you got it, but it'd be something like this:

Code: [Select]
<a href="http://gallery.gr-outdoors.com" target="_blank"><IMG SRC="http://gallery.gr-outdoors.com/cgi-bin/album.pl?image=randthumb"></a>

Offline TGreene

  • album.pl Donor
  • album.pl User
  • *
  • Posts: 16
  • Karma: +0/-0
  • I forgot to change the default text
Re: Random images displayed remotely
« Reply #12 on: July 07, 2004, 19:33:06 »
This is what I did, but calling the thumbnails still doesn't work for me, so I'm resigned to the full sized images...

<A HREF="http://www.gr-outdoors.com/index-gallery-random.htm" TARGET="_parent"><IMG SRC="http://gallery.gr-outdoors.com/cgi-bin/album.pl?image=random" WIDTH=120 HEIGHT=96 BORDER=2>[/url][/size]

The "index-gallery-random.htm" file looks like this:


<HTML>
<HEAD>
<TITLE>Great River Outdoors</TITLE>

<FRAMESET ROWS="110,*" SCROLLING=NO BORDER=0>
   <FRAME SRC="header.htm" SCROLLING=NO>
      <FRAMESET COLS="130,1, *" BORDER="0" SCROLLING=NO>
                 <FRAME SRC="navbar-gallery.htm" NAME="navbar" SCROLLING=NO>
                      <FRAME SRC="spacer-b.htm">
            <FRAMESET ROWS="1,890,*" BORDER="0" SCROLLING=NO>
                            <FRAME SRC="spacer-b.htm" SCROLLING=NO>

                            <FRAME SRC="gallery-random.htm" NAME="main">
                            <FRAME SRC="spacer-b.htm" SCROLLING=NO>
                    </FRAMESET>
              </FRAMESET>
</FRAMESET>

</HEAD>

<BODY BGCOLOR="FDF7EA" TEXT="#786035" LINK="#786035" VLINK="#786035" ALINK="#786035" TOPMARGIN="0" MARGINHEIGHT="0" LEFTMARGIN="0" MARGINWIDTH="0">

</BODY>
</HTML>


and "gallery-random-htm" is below:

<HTML>
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">

<script language="JavaScript" type="text/javascript">
<!-- Hide script from older browsers
//Set redirect page
var url = "http://www.gr-outdoors.com"; //Should this page be in frames?
// y for yes and n for no
   frameEnforcer("y");
   function frameEnforcer(frames) {
   if (frames == 'y'){
      if (self.parent.frames.length == 0){
         self.parent.location = url;
      }
   }
   else if (frames == 'n'){
   if (self.parent.frames.length != 0){            self.parent.location=url;
      }
   }
}
// end hiding contents -->
</script>

<STYLE type="text/css">
<!--BODY {
scrollbar-face-color: E9E9CA;
scrollbar-highlight-color: FDF7EB;
scrollbar-3dlight-color: F1F1DB;
scrollbar-darkshadow-color: 000000;
scrollbar-shadow-color: 786035;
scrollbar-arrow-color: 786035;
scrollbar-track-color: FDF7EB;
}-->
</STYLE>

<BODY BGCOLOR="#FDF7EA" BORDER-COLOR="#786035" TEXT="#786035" LINK="#786035" ALINK="#786035" VLINK="#786035">

<CENTER>
<IMG SRC="http://gallery.gr-outdoors.com/cgi-bin/album.pl?image=random" border=2>
</CENTER>

</body>
</html>

Offline Mike Bobbitt

  • album.pl Author
  • Administrator
  • I Spend Too Much Time Here
  • *****
  • Posts: 3381
  • Karma: +35/-2
    • Mike's Development Archive
Re: Random images displayed remotely
« Reply #13 on: July 08, 2004, 10:11:44 »
Hmmm, that's because your images are .jpgs, but your thumbnails are gifs. The randthumb function isn't smart enough to sense that...

I'll see if I can figure somehting out.

Offline frister

  • album.pl Donor
  • album.pl Hacker
  • ****
  • Posts: 230
  • Karma: +42/-0
  • half baked ideas are better than none
    • fristersoft travelogue
Re: Random images displayed remotely
« Reply #14 on: July 08, 2004, 12:05:54 »
BTW, the new image=random & image=randthumb seem to work only when the images a photo types (jpg, bmp, gif, png) and the thumbs are of the same type as the photo. They don't work with movie types, nor with JPEG 2000. I'll have to look into the latter.

Image=random asks me to save or open album.pl (as if it were downloading). When I save the resulting binary file to my PC and then open it with Irfanview, I see it's actually and image file.
Image=randthumb gives me "Internal Server Error - premature end of headers" (my thumbs are all png's)

I can get the "regular" SSI options to work  if I include the "http://myweb/cgi-bin/album.pl?.....;ssi=1" as part of a dynamic html statement in an shtml file or in an iframe, ssi=2 brings up a frame, but only displays the regular photo types correctly. I'll have to work on the jp2.