Problem with Lightbox
3 posts by 2 authors in: Forums > CMS Builder
Last Post: April 19, 2012 (RSS)
By NigelGordijk - April 19, 2012 - edited: April 19, 2012
I've run into a problem with Lightbox on my client's site: http://www.primenutrients.ca/dealersDetails.php?This-is-a-test-1
I've uploaded one picture to the gallery, but the thumbnail is showing up as a broken image. Also, when you click on the broken image icon, the full size picture doesn't show up. Any idea why, please?
Here's my code:
<?php echo "<?xml version='1.0'?>\n"; ?>
<DIV ALIGN="CENTER">
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!-- STEP1: Load Record (Paste this above other step) -->
<?php
require_once "cmsAdmin/lib/viewer_functions.php";
$options = array(); // NOTE: see online documentation for more details on these options
$options['tableName'] = 'dealers'; // (REQUIRED) MySQL tablename to list record from. Example: "article";
$options['recordNum'] = ''; // (optional) Record number to display. Example: "1"; Defaults to number on end of url, then 1
$options['where'] = ''; // (ADVANCED) MySQL WHERE conditions to use INSTEAD of recordNum to look up record. Example: "fieldname = 'value'"
$record = getRecord($options);
?>
<!-- /STEP1: Load Record -->
<!-- STEP2: Display Record (Paste this where you want your record displayed and re-arrange fields) -->
<?php if ($record): ?>
<?php endif ?>
<?php if (empty($record)): ?>
<!-- Display "No Records Found" Message -->
<?php endif ?>
<!-- STEP2: /Display Record -->
<!-- STEP3: Display Uploads from 'content' (Paste this where you want your uploads displayed) -->
<?php foreach (getUploads($options['tableName'], 'images', $record['num']) as $upload): ?>
<?php if ($upload['hasThumbnail']): ?>
<A HREF="<?php echo $upload['urlPath'] ?>" TITLE="<?php echo $upload['info1'] ?>" REL="lightbox[roadtrip]">
<IMG SRC="<?php echo $upload['thumbUrlPath'] ?>" WIDTH="<?php echo $upload['thumbWidth'] ?>" HEIGHT="<?php echo $upload['thumbHeight']?>" BORDER="3" ALIGN="middle" CLASS="imgGalleryThumbnail" /></A>
<?php elseif ($upload['isImage']): ?>
<A HREF="<?php echo $upload['urlPath'] ?>" TITLE="<?php echo $upload['info1'] ?>" REL="lightbox[roadtrip]">
<IMG SRC="<?php echo $upload['urlPath'] ?>" WIDTH="<?php echo $upload['width'] ?>" HEIGHT="<?php echo $upload['height'] ?>" BORDER="3" ALIGN="middle" CLASS="imgGalleryThumbnail" /></span></A>
<?php else: ?><?php endif ?>
<?php endforeach ?>
</DIV>
Thanks!
I've uploaded one picture to the gallery, but the thumbnail is showing up as a broken image. Also, when you click on the broken image icon, the full size picture doesn't show up. Any idea why, please?
Here's my code:
<?php echo "<?xml version='1.0'?>\n"; ?>
<DIV ALIGN="CENTER">
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!-- STEP1: Load Record (Paste this above other step) -->
<?php
require_once "cmsAdmin/lib/viewer_functions.php";
$options = array(); // NOTE: see online documentation for more details on these options
$options['tableName'] = 'dealers'; // (REQUIRED) MySQL tablename to list record from. Example: "article";
$options['recordNum'] = ''; // (optional) Record number to display. Example: "1"; Defaults to number on end of url, then 1
$options['where'] = ''; // (ADVANCED) MySQL WHERE conditions to use INSTEAD of recordNum to look up record. Example: "fieldname = 'value'"
$record = getRecord($options);
?>
<!-- /STEP1: Load Record -->
<!-- STEP2: Display Record (Paste this where you want your record displayed and re-arrange fields) -->
<?php if ($record): ?>
<?php endif ?>
<?php if (empty($record)): ?>
<!-- Display "No Records Found" Message -->
<?php endif ?>
<!-- STEP2: /Display Record -->
<!-- STEP3: Display Uploads from 'content' (Paste this where you want your uploads displayed) -->
<?php foreach (getUploads($options['tableName'], 'images', $record['num']) as $upload): ?>
<?php if ($upload['hasThumbnail']): ?>
<A HREF="<?php echo $upload['urlPath'] ?>" TITLE="<?php echo $upload['info1'] ?>" REL="lightbox[roadtrip]">
<IMG SRC="<?php echo $upload['thumbUrlPath'] ?>" WIDTH="<?php echo $upload['thumbWidth'] ?>" HEIGHT="<?php echo $upload['thumbHeight']?>" BORDER="3" ALIGN="middle" CLASS="imgGalleryThumbnail" /></A>
<?php elseif ($upload['isImage']): ?>
<A HREF="<?php echo $upload['urlPath'] ?>" TITLE="<?php echo $upload['info1'] ?>" REL="lightbox[roadtrip]">
<IMG SRC="<?php echo $upload['urlPath'] ?>" WIDTH="<?php echo $upload['width'] ?>" HEIGHT="<?php echo $upload['height'] ?>" BORDER="3" ALIGN="middle" CLASS="imgGalleryThumbnail" /></span></A>
<?php else: ?><?php endif ?>
<?php endforeach ?>
</DIV>
Thanks!
Nigel Gordijk
Common Sense Design: User-focused Web design
Tel: 001 519 342 5348 | Web: www.commonsensedesign.net
Common Sense Design: User-focused Web design
Tel: 001 519 342 5348 | Web: www.commonsensedesign.net
Re: [NigelGordijk] Problem with Lightbox
By Damon - April 19, 2012
Hi Nigel,
The issue appears to be with the image URL.
The broken images has this code:
What they should have is this:
To fix the issue, check that the Upload Folder URL in the CMS Builder admin is set to:
/cmsAdmin/uploads/
Alternatively, you could add the missing part of the URL to your publish code:
Let me know if that fixes it.
The issue appears to be with the image URL.
The broken images has this code:
<A HREF="bw-products-600_002.png" TITLE="Product shot" REL="lightbox[roadtrip]">
<IMG SRC="thumb/bw-products-600_002.png" WIDTH="200" HEIGHT="152" BORDER="3" ALIGN="middle" CLASS="imgGalleryThumbnail" /></A>
What they should have is this:
<A HREF="/cmsAdmin/uploads/bw-products-600_002.png" TITLE="Product shot" REL="lightbox[roadtrip]">
<IMG SRC="/cmsAdmin/uploads/thumb/bw-products-600_002.png" WIDTH="200" HEIGHT="152" BORDER="3" ALIGN="middle" CLASS="imgGalleryThumbnail" /></A>
To fix the issue, check that the Upload Folder URL in the CMS Builder admin is set to:
/cmsAdmin/uploads/
Alternatively, you could add the missing part of the URL to your publish code:
<?php if ($upload['hasThumbnail']): ?>
<A HREF="/cmsAdmin/uploads/<?php echo $upload['urlPath'] ?>" TITLE="<?php echo $upload['info1'] ?>" REL="lightbox[roadtrip]">
<IMG SRC="/cmsAdmin/uploads/<?php echo $upload['thumbUrlPath'] ?>" WIDTH="<?php echo $upload['thumbWidth'] ?>" HEIGHT="<?php echo $upload['thumbHeight']?>" BORDER="3" ALIGN="middle" CLASS="imgGalleryThumbnail" /></A>
Let me know if that fixes it.
Cheers,
Damon Edis - interactivetools.com
Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/
Damon Edis - interactivetools.com
Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/
Re: [Damon] Problem with Lightbox
Perfect! Thanks so much, Damon.
http://www.primenutrients.ca/dealersDetails.php?This-is-a-test-1
http://www.primenutrients.ca/dealersDetails.php?This-is-a-test-1
Nigel Gordijk
Common Sense Design: User-focused Web design
Tel: 001 519 342 5348 | Web: www.commonsensedesign.net
Common Sense Design: User-focused Web design
Tel: 001 519 342 5348 | Web: www.commonsensedesign.net