Welcome, Guest
Username Password: Remember me

When is the "large" teacher image used?
(1 viewing) (1) Guest
  • Page:
  • 1

TOPIC: When is the "large" teacher image used?

When is the "large" teacher image used? 23 Jan 2010 11:01 #1701

On my test server I have added large and thumbnail teacher images - as far as I can see only the thumbnail is ever used. Is this correct? Can I make the thumbnail click theough to the large image (e.g. in a slimbox)?

I have found though that if the large image is empty the thumbnail does not display on the teacher list page! So if you have a thumbnail but no large image, no image displays on the teacher page. If you have both images, only the thumbnail displays. Suspect there is a bug somewhere here.
Last Edit: 23 Jan 2010 11:07 by Jonathan West.

Re:When is the "large" teacher image used? 25 Jan 2010 09:23 #1705

  • Tom
  • OFFLINE
  • Administrator
  • Posts: 860
Hi Jonathan,

This is the code for the teacher list image display:

<?php if ($item->thumb || $item->teacher_thumbnail){?>
<img src="<?php echo $image->path;?>" border="1" title="<?php echo $item->teachername;?>" alt="<?php echo $item->teachername;?>" width="<?php echo $image->width;?>" height="<?php echo $image->height;?>" /><?php } ?>

The $image array is the result of a small helper file that gives us the dimensions of the image, if it is not specified. In prior version, the images were referenced by full urls + height and width. With version 6.1 we allow users to pick from a drop down box in a folder they have chosen in the Administration settings tab. This presents some problems in that we must find the right folder, see which method the user has chosen to use (dropdown vs full url).

The teacher_thumbnail is a result from the teacher record in the db. $item->thumb is if they put in the full url.

Then on the display page here is the code:

if ($teacher->image || $teacher->teacher_image)
{ ?>
<img src="<?php echo $image->path;?>" width="<?php echo $image->width;?>" height="<?php echo $image->height;?>" border="1" alt="<?php echo $teacher->teachername.' - '.$teacher->title;?>" />
<?php
}?>

So here $teacher->image is the full url of the large image, and $teacher->teacher_image is the drop down.

In my tests I see both images used where they should be - but if we've got a bug I'd love to find and fix it!

Tom
"You shall know the truth and the truth shall set you free." JC
Last Edit: 25 Jan 2010 09:24 by Tom. Reason: removed [code]

Re:When is the "large" teacher image used? 25 Jan 2010 11:11 #1709

So the large image should be displayed on the teacher details view? And the thumbnail on the teacher list page?

I have set up a teacher (Spencer Shaw) with nehemiah.jpg as thumbnail and spencer-shaw.jpg as the full image. But nehemiah.jpg appears on both pages ...

www.emmanuelecc.org/index.php/resources/...amp;templatemenuid=1
www.emmanuelecc.org/index.php/resources/...amp;templatemenuid=1

Data from the teacher table:

Full Texts id teacher_image teacher_thumbnail teachername title phone email website information image imageh imagew thumb thumbw thumbh short ordering catid list_show published
Edit Delete 2 spencer-shaw.jpg nehemiah.jpg Spencer Shaw Pastor <p>Spencer has been the pastor of Emmanuel Chippen... Spencer has been the pastor of Emmanuel Chippenham... 2 1 1 1

And I have set the folder to be com-biblestudy (under images).

If I blank the large image, nothing appears on teacher details page and the thumbnail appears on list page.

[Using 6.1.0]]

Re:When is the "large" teacher image used? 25 Jan 2010 13:08 #1710

  • Tom
  • OFFLINE
  • Administrator
  • Posts: 860
OK so I have found one bug. In the file /components/com_biblestudy/views/teacherdisplay/tmpl/default.php at line 32

if (!$teacher->teacher_image) { $image->path = $teacher->image; $image->height = $teacher->imageh; $image->width = $teacher->imagew; }
else
{
if ($teacher->teacher_image && !$admin_params->get('teachers_imagefolder')) { $i_path = 'images/stories/'.$teacher->teacher_image; }
if ($teacher->teacher_image && $admin_params->get('teachers_imagefolder')) { $i_path = 'images/'.$admin_params->get('teachers_imagefolder/').$teacher->teacher_thumbnail;}
$image = getImage($i_path);
}

Change the last second to last line to:

if (!$teacher->teacher_image) { $image->path = $teacher->image; $image->height = $teacher->imageh; $image->width = $teacher->imagew; }
else
{
if ($teacher->teacher_image && !$admin_params->get('teachers_imagefolder')) { $i_path = 'images/stories/'.$teacher->teacher_image; }
if ($teacher->teacher_image && $admin_params->get('teachers_imagefolder')) { $i_path = 'images/'.$admin_params->get('teachers_imagefolder/').$teacher->teacher_image;}
$image = getImage($i_path);
}

This affects versions 6.1.0 through 6.1.2
"You shall know the truth and the truth shall set you free." JC
Last Edit: 25 Jan 2010 13:09 by Tom.

Re:When is the "large" teacher image used? 25 Jan 2010 15:05 #1712

Thanks Tom - that's fixed!
  • Page:
  • 1
Time to create page: 0.75 seconds