Thumbnail Trouble

8 posts by 2 authors in: Forums > CMS Builder
Last Post: May 30, 2008   (RSS)

By Mohaukla - May 30, 2008

I am running a list page that will show the thumbs of pictures for each staff. Then a full size on the page view.
The problem is that although it seems to be working the way I want .... the thumbnails are not showing.

<?php
require_once "C:/Webspace/resadmin/mmoyers/efreewillmar.org/www/cmsAdmin/lib/viewer_functions.php";
$staff_biosOptions = array(); // NOTE: see online documentation for more details on these options
$staff_biosOptions['tableName'] = 'staff_bios'; // (REQUIRED) MySQL tablename to list record from. Example: 'article';
$staff_biosOptions['titleField'] = 'title'; // (optional) MySQL fieldname used in viewer url for search engines. Example: 'title' would display: viewer.php/article_title_here-123
$staff_biosOptions['viewerUrl'] = 'staff_biosPage.php'; // (optional) URL of viewer page. Example: '/articles/view.php';
$staff_biosOptions['perPage'] = ''; // (optional) The number of records to display per page. Example: '5'; Defaults to 10.
$staff_biosOptions['orderBy'] = 'dragSortOrder, name'; // (optional) Fieldnames to sort by. Example: 'field1, field2 DESC, field3';
$staff_biosOptions['pageNum'] = ''; // (optional) Page number of results to display. Example: '1'; Defaults to ?page=# value, or 1 if undefined
$staff_biosOptions['where'] = ''; // (ADVANCED) Additional MySQL WHERE conditions. Example: 'fieldname = "value"'
$staff_biosOptions['useSeoUrls'] = ''; // (ADVANCED) Set this to '1' for search engine friendly urls: view.php/123 instead of view.php?123 (not supported on all web servers)
list($staff_biosRecordList, $staff_biosListDetails) = getListRows($staff_biosOptions);
?>
<?php foreach ($staff_biosRecordList as $staff_biosRecord): ?>
</p>
<table width="357" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="89"><?php if ($staff_biosRecord): ?>
<?php foreach (getUploads($staff_biosOptions['tableName'], 'photo', $staff_biosRecord['num']) as $upload): ?>
<?php if ($upload['hasThumbnail']): ?>
<img src="<?php echo $upload['thumbUrlPath'] ?>" width="<?php echo $upload['thumbWidth'] ?>" height="<?php echo $upload['thumbHeight'] ?>" alt="" /><br/>
<?php endif ?>
<?php endforeach ?>
<?php endif ?></td>
<td width="268">
<a href="<?php echo $staff_biosRecord['_link'] ?>"><?php echo $staff_biosRecord['name'] ?></a><br/>
<?php echo $staff_biosRecord['title'] ?><br/>
<br/></td>
</tr>
</table>
<?php endforeach ?>


PHP page:
http://www.efreewillmar.org/faculty.php
Creating from:
http://www.efreewillmar.org/faculty.html

Shouldn't this be working to show the thumbs
I have the uploaded pictures set to create a 75px width thumbnail and to resize anything over 800 px wide or high.
Could the resizing setting be affecting the thumbnail setting?

Thanks in advance,
Michael Moyers



Owner of Just Rite Design Inc. A growing network of professionals in web design, graphic design, flash development, programming, and audio & video productions.



"Due to budget constraints, the Light at the end of the tunnel will be temporarily out!"

Re: [justritedesign] Thumbnail Trouble

By Dave - May 30, 2008

Make sure you have a max width -and- height set for all the thumbnail and upload field settings or it won't create a thumbnail.

Try changing that and then uploading another image. If that still doesn't work feel free to email me CMS and FTP login details to dave@interactivetools.com and I can take a look (email, don't post login details).

The code looks correct.

Hope that helps!
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] Thumbnail Trouble

By Mohaukla - May 30, 2008

OK that is probably the problem. The dimension for the thumbnail is only set to 75px for one value

Now what do the resize values do ... I understood them to say that if a given image is uploaded and are bigger than the stated values then resize the image. Is that resized image a thumbnail or does it resize to the resize values?

What happens if the uploaded image has a different proportion than the values set for the thumbnail?
Say the values are set for 10 X 20 and the image uploaded is 30 X 25 ... if it will maintain the perspective then is something cropped?
Michael Moyers



Owner of Just Rite Design Inc. A growing network of professionals in web design, graphic design, flash development, programming, and audio & video productions.



"Due to budget constraints, the Light at the end of the tunnel will be temporarily out!"

Re: [justritedesign] Thumbnail Trouble

By Dave - May 30, 2008

You can think of the thumbnail size as "maximum size limits". So the image proportion will always be the same and it won't be cropped. It will just be smaller. The thumbnail will always fit inside the max size limit specified.

So if you have an image that is 100w x 500h and your thumbnail max limits are 50w x 50h then the image would be resized to 10w x 50h. Since that's the biggest the thumbnail can be while still keepings it's proportion and fitting in the max size limits.

Hope that helps. Let me know if you need any more details.
Dave Edis - Senior Developer
interactivetools.com

Re: [Mohaukla] Thumbnail Trouble

By Mohaukla - May 30, 2008

Sorry I logged into an old account ... I forgot I had that one [blush]
Michael Moyers



Owner of Just Rite Design Inc. A growing network of professionals in web design, graphic design, flash development, programming, and audio & video productions.



"Due to budget constraints, the Light at the end of the tunnel will be temporarily out!"

Re: [Mohaukla] Thumbnail Trouble

By Dave - May 30, 2008

>Ok great but what exactly does Resize images over ?px do

Say you want full size images on your site to be no larger than 640x480. A user who is not familiar with image size may upload a photo from their camera that is 2048x2048, larger than could be displayed on a regular screen. The "Resize images larger than" option will resize those "oversized" images.

Hope that makes sense. Let me know if you need more details.
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] Thumbnail Trouble

By Mohaukla - May 30, 2008

Thanks Dave

That makes a lot more sense now.

You guys are a big help!
Michael Moyers



Owner of Just Rite Design Inc. A growing network of professionals in web design, graphic design, flash development, programming, and audio & video productions.



"Due to budget constraints, the Light at the end of the tunnel will be temporarily out!"