Hi everyone,

Back to the cfx_image tag process for a bit. I managed to get it figured out
(confusing tag) and now I'm working on the rest of my gallery.

Here's the idea, instead of using frames, I want to load the thumbnails on
the left, a medium sized image on the right and then the medium size (as
well as the icon I have) links to the bigger image.

Here's the problem, I can't quite get the medium sized image to display
properly, well, at all. It keeps defaulting to the first image and that's
it, that's all it'll show. I'm pretty sure there's a better way to write
this code as well.

It's funny how the little things screw you up more than the big problems eh?

Before I forgot, the directory structure is unique. When the images are
uploaded 3 copies are made at 3 specific sizes and go into a directory for
that specific image. For example

Mark's Directory --->large --> large images
                 --->medium --> medium images
                 --->thumb --> thumb images

Bob's Directory --->large --> large images
                 --->medium --> medium images
                 --->thumb --> thumb images

So, there's multiple directories (Hence the gallery_ID key) with multiple
images in each.


<!---Get records from the dbase--->
<cfquery name="getThumbs" datasource="#DSN#">
  SELECT gallery_Pics.ID,
         gallery_Pics.gallery_ID,
         gallery_Pics.Image,
         gallery_Pics.Image_mdn,
         gallery_Pics.Image_thumb,
         gallery_Pics.Caption,
         gallery_Admin.gallery_NickName,
         gallery_Admin.gallery_Name,
         gallery_Admin.gallery_ID
  FROM gallery_Pics, gallery_Admin
  WHERE gallery_Pics.gallery_ID = #gallery_ID# and gallery_Admin.gallery_ID
= #gallery_ID#
</cfquery>

<!---Assign default value for "start"--->
<cfparam name="start" default="1">
<CFSET display="6">

<!---Calculate the "next" value--->
<cfset nextX = #start# + #display#>

<!---Calculate the "previous" value--->
<cfset PrevX = #start# - #display#>
  <cfif PrevX LTE 0>
    <cfset PrevX = 1>
  </cfif>

<!--- Set-Up some constants for the page for now --->
<CFPARAM NAME="Image_mdn" DEFAULT="Blank.gif">

<HTML>
<HEAD>
<TITLE><cfoutput>#SiteTitle#</cfoutput></TITLE>

<BODY leftMargin="0" topMargin="0" rightMargin="0" marginheight="0"
marginwidth="0" bgcolor="5A6286">

<TABLE cellSpacing=0 cellPadding=0 width=100% border=0>
  <TBODY>
  <TR valign="top" bgcolor="000000">
    <TD>
      <img src="images/spacer.gif" width="20" height="20">
        <img src="images/banner_top.gif" width="205" height="19" alt="Page
Banner">
    </TD>
  </TR>
  <TR>
    <TD bgcolor="666666" valign="top">
      <img src="images/spacer.gif" width="20" height="20"><img
src="images/banner_menu.gif" width="527" height="19" alt="Menu">
    </TD>
  </TR>
  <TR>
    <TD valign="top" bgcolor="000000" width="1"><img src="images/spacer.gif"
width="1" height="1"></TD>
  </TR>
  <TR>
    <TD valign="top" bgcolor="454C6F"><img height=71 alt="Flash Banner"
src="images/banner.gif" width=625></TD>
  </TR>
  <TR>
    <TD valign="top" bgcolor="000000"><img src="images/spacer.gif" width="1"
height="1"></TD>
  </TR>
  </TBODY>
</TABLE>

<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
  <!--- DISPLAY THUMBNAILS --->
  <!--- Put link to medium image in here --->
    <td align="center" width="16%" valign="top" rowspan="2"><br>
      <cfoutput query="getThumbs" startrow="#start#" maxrows="#display#">
        <a
href="gallery_view.cfm?gallery_ID=#gallery_ID#&gallery_NickName=#gallery_Nic
kName#&Image_mdn=#Image_thumb#"><img
src="gallery/#gallery_NickName#/thumb/#Image_thumb#" width="66" height="74"
alt="#Caption#" border="0"></a><br>
      </cfoutput>


      <!---Previous (X) (only show this link if there are "previous"
results)--->
      <cfif #start# is not 1>
        <cfoutput>
          <a
href="gallery_view.cfm?gallery_ID=#gallery_ID#&start=#PrevX#&display=#displa
y#">
            <img src="images/nav_reverse.gif" width="17" height="21"
alt="Previous Group" border="0">
          </a>
        </cfoutput>
      </cfif>

      <!---Next (X) (only show this link if there are more results
available)--->
      <cfif nextX LTE getThumbs.RecordCount>
        <cfoutput>
          <a
href="gallery_view.cfm?gallery_ID=#gallery_ID#&start=#nextX#&display=#displa
y#">
            <img src="images/nav_forward.gif" width="17" height="21"
alt="Next Group" border="0">
          </a>
        </cfoutput>
      </cfif>

    </td>
    <!--- Make this a link to the biggest version of the picture: Magnifying
Glass --->
    <td width="57%" valign="bottom" height="47">
      <div align="right">

      <cfoutput query="getThumbs" maxrows="1">
        <a href="" border="0">
          <img src="images/enlarge.gif" width="31" height="47" border="0">
        </a>
      </cfoutput>

      </div>
    </td>
    <td valign="top" height="44" rowspan="2" width="10%">&nbsp;</td>
  </tr>
  <!--- Display medium Picture --->
  <tr>
    <td valign="top" height="20" width="74%">

      <cfoutput query="getThumbs" maxrows="1">
        <img src="gallery/#gallery_NickName#/medium/#Image_mdn#" width="625"
height="378" alt="No Image To Display Yet">
      </cfoutput>

    </td>
  </tr>
</table>

</BODY>
</HTML>

Reply via email to