Jump to content


Display Random Image


  • You cannot reply to this topic
31 replies to this topic

#21 rinty

    Etomite Forum Fan

  • Member
  • Pip
  • 87 posts

Posted 09 May 2006 - 10:20 PM

mikef, on May 9 2006, 08:27 PM, said:

EtoGalThumb 1.1 beta 2 (available from the downloads area) now adds the 'resize' parameter you wanted too. It doesn't actually build a new image to download, but adjusts the width and height in the %%size%% string to scale the image to the size you request on display.
I can't get a result from the size parameter. What is it defining, an actual pixel size aor a percentage? I see in your styles that it sits in the img tag as %%size%%, so does that define width and height?

Sorry if this is a bit dense.

#22 mikef

    Loves Etomite Forums!

  • Member
  • PipPipPipPip
  • 1,551 posts

Posted 09 May 2006 - 11:16 PM

You use the resize (not size) parameter in the snippet call to set the length of the longest side in pixels - example at http://www.efikim.co.uk/etogal/EGT3breakgal.html uses the snippet call
[[EtoGalThumb2?gallerybreak=1&style=3&count=999&gal=55,56,57,58&order_by=gal_id,id&resize=75]]
and so sets the longest side to 75 pixels, which is smaller than my thumbnails. (That page is mainly to check/demonstrate one of the section break options, but I added in the resize option there too.)

what then happens is that the code gets the image dimensions from the file, and finds the largest side and sets that to the number of pixels specified, and then calculates the other side as well. It then puts these into the %%size%% replacement string (as 'width="xxx" height="xxx"' ready to be inserted in the <img ....> element - to make it a bit clearer the image style for that display is
<div style="float:left; width:100px; ">
  <img src='%%file%%' title='%%gtitle%%: %%title%%' alt='%%sdesc%%'  %%size%%/>
</div>
<div><strong>%%title%%</strong><br/>%%sdesc%%</div>
<div style="clear:both"><br /></div>

I built it into the %%size%% string like this since it already existed to do essentially the same job - without the resize snippet parameter it gets filled with the width and height of the actual image for putting into the img element to help the browser layout the page while its waiting for the images to download. (I think its also actually needed for xhtml 1.1 compliance)


If you want, post or PM your snippet call, styles, and what you expect to happen with them (and what doesn't work), and I'll have a look.

Edited by mikef, 09 May 2006 - 11:20 PM.


#23 rinty

    Etomite Forum Fan

  • Member
  • Pip
  • 87 posts

Posted 10 May 2006 - 10:32 PM

OK - I understand that now and it seems clear, but I'm not getting the resizing using the following:
[[EtoGalThumb?gal=23,26,27,28&fullsize=1&style=10&resize=300]]
// style=10 - DM larger image display
$styleStrings[10]['header']=0;
$styleStrings[10]['tail']=0;
$styleStrings[10]['image']=<<<IMG
<h4 align="center">%%gtitle%%</h4><p align="center" class="gallery"><a href='[~%%gal%%~]'><img src='%%file%%' title='%%title%%' alt='%%sdesc%%' %%size%%/></a><br/>%%title%%</p>
IMG;

All I get is a full size image displayed. The result is here if you want to see.

I haven't changed my rough layout in this style yet, so I've not used anything other than crude HTML to do the job for now.

I'm clearly missing something obvious here aren't I?

Edited by rinty, 10 May 2006 - 10:34 PM.


#24 mikef

    Loves Etomite Forums!

  • Member
  • PipPipPipPip
  • 1,551 posts

Posted 10 May 2006 - 10:55 PM

The snippet call and the styles are OK - I've used them on this test page, except for changing the gallery ids to match mine.

Is there any chance that you've used the wrong version of EtoGalThumb? The first few lines should be
// Snippet EtoGalThumb version 1.1 beta 2
// Copyright 2005-2006 Mike Finley http://www.efikim.co.uk
//   available under a GPL licence, or a Creative Commons Attribution licence
// parameters
// only,not - page id where thumbnails should/should not be shown (default is any page)
// link - page id parameter to be used in links (%%link%% parameter)
// gal - gallery this thumbnail is associated with (optional, can be a comma separated list) (%%gal%%)
// img - id of image to be shown (optional, can be a comma separated list) (%%img%%))
//**changed** if neither gal nor img are specified, all images are returned (except for any specifically excluded)
// exclude - id list of images to exclude when selecting by gallery
// addback - increase total images count by this value
// count - number of images to use (defaults to 1, if you want all, specify 9999)
// order_by - maye be set to 'id','gal_id','title','filename','descr','date' and orders by that entry in the EtoGal table
//       - if no order is speified, then the order in which results are returned is random (the list returned from the databseis deliberately shuffled)
//       - 'random' is NOT a valid value
//       - ordering using two valid fields separated by a comma should work, provided order_direction is not set, but is untested
// order_direction - "ASC" (default) or "DESC"
// style - style to be used (see below)
// fullsize - set this to 1 to use fullsize images instead of thumbnails (other values undefined)
//** new ** resize - set to pixel count for longest size - adjusts the values returned in %%size%% accordingly
//** new ** breakat - use the new 'break' functionality to insert break code every ''breakat'' images
//** new ** gallerybreak - set to 1 to use the new break functionality every time the gallery changes.
//

I had left the older version of EtoGalThumb available on the downloads page as well, in case the new one failed. I've now removed the older versions of all the snippets so you can only download the newest!

#25 rinty

    Etomite Forum Fan

  • Member
  • Pip
  • 87 posts

Posted 13 May 2006 - 09:56 PM

Ooops - I'd got the wrong version :blush:

It now works fine (as you knew it did)

Once again, thank you Mike :)

#26 mikef

    Loves Etomite Forums!

  • Member
  • PipPipPipPip
  • 1,551 posts

Posted 13 May 2006 - 10:43 PM

:)

#27 rinty

    Etomite Forum Fan

  • Member
  • Pip
  • 87 posts

Posted 24 May 2006 - 02:50 PM

I've just looked at one of my pages in IE (I normally use Firefox) and IE doesn't like EGThumb. The page is here.

The top image is being stretched vertically and the thumbnail lower down the page has applied a link to all the tet that comes after it.

The html for the page is this:
<div class="bodyleft">[[EtoGalThumb?img=73&style=11&fullsize=1]]In the late 80's, I was in a few small bands which	   culminated in One less Child. Destined to never get anywhere, but fun never	   the less.	  <p>We rehearsed more than we played live (5 gigs in	   18 months). We made a 7&quot; single for a local DJ of 'Gimme Some' which	   was dire, although the live version was rather fun. We eventually made	   a small album, paying for some studio time and tape duplication. It never	   made money but I don't suppose it was ever going to. I left at the end	   of '91. I don't think the band was together for much longer after that. <span class="imageright">[[EtoGalThumb?img=3]]</span></p>	 <p>I recently found a production master DAT of this album that had been floating	   around with me for the last 13 years, so I decided to turn them into digital	   files, and here they are for your pleasure. <p> All audio files are in Windows Media Audio (WMA) format.</p>	 <p><strong>One Less Child were: </strong></p>	 <p><strong>Steve Bark</strong> - Vocals/Guitar<br />		 <strong>Mark 'Marcy' Smith</strong> - Guitar<br />		 <strong>Danny Monaghan</strong> - Bass Guitar<br />		 <strong>Jamie Butler</strong> - Keyboards<br />		 <strong>Glen Hardy</strong> - Drums</p>   </div><div class="sidebar">	 <div class="bluepanel"> 	<div class="sidebarheader">One Less Child - The Album </div> 	<strong><u>Side 1</u></strong> (yes it had sides - it was a tape!)<br /> 	1. <a href="assets/pages/olc/All%20You%20Need.wma">All You need</a><br /> 	  2. <a href="assets/pages/olc/Tides.wma">Tides</a><br /> 	  3. <a href="assets/pages/olc/Pictures.wma">Pictures</a><br /> 	  4. <a href="assets/pages/olc/Gist.wma">Gist</a> 	  <p><strong><u>Side 2<br /> 	</u></strong>5. <a href="assets/pages/olc/Big%20Tears.wma">Big Tears</a><br /> 	  6. <a href="assets/pages/olc/Child%20of%20the%20New%20Age.wma">Child of the New Age</a><br /> 	  7. <a href="assets/pages/olc/Cool%20to%20the%20Touch.wma">Cool to the Touch</a><br /> 	  8. <a href="assets/pages/olc/One%20Less%20Child.wma">One Less Child</a></p> 	<p>All songs written by Bark except:<br /> 	  3. Smith/Bark<br /> 	  6. Monaghan/Bark</p> 	Album recorded July 1991</div>   </div>
Now is this something I'm doing wrong in the code?

#28 mikef

    Loves Etomite Forums!

  • Member
  • PipPipPipPip
  • 1,551 posts

Posted 24 May 2006 - 03:09 PM

welcome to joys of working with IE...

However I think you're using one of your own styles rather than one of mine for the EtoGalThumb call - I've looked at the page source and it has in the IMG element
... width='100%' height='100%' ...
. How ie is interpreting those specifications is anyones guess!

To fix depends on what you're trying to do.

if you just want to have the image at its nomal full size, replace the bit in the style that sets width and height with %%size%% and it'll insert the correct dimensions.

if you want to expand the image to fll the space ... you can't unless its a fixed width design, give that browsers interpret the 100% specification differently. What you can do though is choose a different fixed size using the resize parameter, and again replace the relevant bit in the style with %%size%% (when it should pass the browser an ammended size specification to match)

#29 mikef

    Loves Etomite Forums!

  • Member
  • PipPipPipPip
  • 1,551 posts

Posted 24 May 2006 - 04:21 PM

View Postmikef, on May 24 2006, 04:09 PM, said:

...
if you want to expand the image to fll the space ... you can't unless its a fixed width design, give that browsers interpret the 100% specification differently. ...

on second thoughts, if you want the width to be 100% of the available space what happens if you just specify width='100%' and don't specify height at all?

#30 rinty

    Etomite Forum Fan

  • Member
  • Pip
  • 87 posts

Posted 30 May 2006 - 09:48 AM

:blush: Oops - that was my mistake. I'd left my old style in EGT from when I first requested this feature, and hadn't updated the style ref on the page. Sorry about that :blush:

I'm still getting the text to the left of the thumbnail as a link in IE though. The call to EGT is wrapped in a span class that's set up like this:
.imageright {
float: right;
margin-top: 10px;
margin-left: 10px;
margin-bottom: 10px;}
Any clues on that one? Is it me again? :unsure:

#31 mikef

    Loves Etomite Forums!

  • Member
  • PipPipPipPip
  • 1,551 posts

Posted 30 May 2006 - 10:16 AM

View Postrinty, on May 30 2006, 10:48 AM, said:

...
Any clues on that one? Is it me again? :unsure:
Yes :betterwink:

The display from EtoGalThumb is completely under your control, using the snippet styles and any associated CSS. I've provided a few sample styles, but the idea was for developers (ie you!) to be able to easily produce their own display formats (and hopefully share them) without having to worry about PHP coding issues.

(Of course, 'completely under your control' isn't as easy as it sounds with differences in the way Firefox, IE, Safari and Opera behave, and bugs in the IE box model and handling of floats.) Just the CSS isn't much use in determining what's wrong, but if you can post the styles, CSS, and resultant HTML somebody may be able to help you bludgeon IE into doing what its told! (me, biassed? :o )

#32 rinty

    Etomite Forum Fan

  • Member
  • Pip
  • 87 posts

Posted 30 May 2006 - 01:45 PM

View Postmikef, on May 30 2006, 11:16 AM, said:

Yes :betterwink:

The display from EtoGalThumb is completely under your control, using the snippet styles and any associated CSS. I've provided a few sample styles, but the idea was for developers (ie you!) to be able to easily produce their own display formats (and hopefully share them) without having to worry about PHP coding issues.

(Of course, 'completely under your control' isn't as easy as it sounds with differences in the way Firefox, IE, Safari and Opera behave, and bugs in the IE box model and handling of floats.) Just the CSS isn't much use in determining what's wrong, but if you can post the styles, CSS, and resultant HTML somebody may be able to help you bludgeon IE into doing what its told! (me, biassed? :o )
Bleuh! IE :rolleyes:

Edited by rinty, 30 May 2006 - 01:46 PM.






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users