Random image on home page created in HTML?

LEVSwebmaster

Joined: 2005-05-02
Posts: 7
Posted: Sat, 2009-09-19 13:53

Gallery version = 2.2 core 1.2.0
PHP version = 4.4.7 cgi
Webserver = Apache
Database = mysqlt 5.0.45-log, lock.system=flock
Toolkits = Exif, ImageMagick
Acceleration = none, none
Operating system = Linux cgi1504.int.bizland.net 2.6.29.4 #1 SMP Mon Jun 1 13:08:14 EDT 2009 i686
Default theme = siriux
gettext = enabled
Locale = en_US
Browser = Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.10) Gecko/2009042316 Firefox/3.0.10 (.NET CLR 3.5.30729)
Rows in GalleryAccessMap table = 77
Rows in GalleryAccessSubscriberMap table = 280
Rows in GalleryUser table = 5
Rows in GalleryItem table = 279
Rows in GalleryAlbumItem table = 3
Rows in GalleryCacheMap table = 0

I know my HTML probably stinks, but it's been a while since I've updated our website (www.vikingship.org)... On my home page, which is in HTML, I'd like to have a random image from our gallery appear, but for some reason, it's ignoring the "gallery2" part of the path when I put it in, so it shows a broken link to an image (showing the image number), but the title came through (I've since removed the title). The "All photos..." link works correctly (ignore the gallery itself - that was another posting).

Here is the code for that portion of the page:

Quote:
<table width="100%" border="1" bordercolor="#ff0000">
<tr><td bgcolor="ff0000" align="center"><h2>Upcoming Events</td>
<tr><td align="center"><!--#include virtual="calendar/list.php" --><a href="calendar/index.php">All Events...</a></td>
<tr><td bgcolor="ff0000" align="center"><h2>Random Picture</td>
<tr height="150"><td align="center"><!--#include virtual="/gallery2/main.php?g2_view=imageblock.External&g2_blocks=randomImage&g2_show=none" --> <a href="/gallery2/main.php">All Photos...</a></td>
<tr><td bgcolor="ff0000" align="center"><h2>Quick Links</td>
<tr><td align="center">
<a href="About_Us/Files.html">Forms</a></br>
<a href="About_Us/Files.html">Newsletter</a></br>
<a href="Members_Only/index.html">Members Only</a></td>
</tr>
</table>

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 22892
Posted: Sat, 2009-09-19 18:33
Quote:
Gallery version = 2.2 core 1.2.0

You should upgrade do to security and other issues.

Quote:
<!--#include virtual

is that ASP? You could use php and change the file extension of your home page to .php. Then use the image block code that is supplied in the admin page of the image block module.
Another way:
http://www.flashyourweb.com/staticpages/index.php?page=mediaBlock as well as other solutions from that site.

Dave

_____________________________________________
Blog & G2 || floridave - Gallery Team

 
LEVSwebmaster

Joined: 2005-05-02
Posts: 7
Posted: Thu, 2009-09-24 02:24

Thanks floridave -
I can't change the file extension to php, because then my calendar won't work. (Sadly, I don't know if it's ASP, but it seemed to work better than other things I've tried...)

I'll keep trying.

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16503
Posted: Thu, 2009-09-24 02:46

Shouldn't be ASP on a Linux server. That looks like SSI (server side include) to me which won't work. So you're probably using SSI to include your calendar into your home page. It's not going to work to bring that php page in. I restructured one of my sites entirely from using SSI to using PHP includes strictly to get random images on my home page :) I could have just done my home page, but then I'd have had to maintain multiple sets of header/footer files.
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here