Display Random Image
#1
Posted 20 April 2006 - 02:00 PM
The end result would look like the mockup I've done on my homepage here. On that page, I've linked directly to the full size gallery image, but it has a size setting of 75%.
Would this be easy to do?
#2
Posted 20 April 2006 - 02:50 PM
rinty, on Apr 20 2006, 03:00 PM, said:
The end result would look like the mockup I've done on my homepage here. On that page, I've linked directly to the full size gallery image, but it has a size setting of 75%.
Would this be easy to do?
There was originally going to be an EtoGalImage to go with EtoGalThumbs, so that users could build their own gallery pages, but this would have meant a lot of duplication in the code used, including duplicating all the database code, so i gave up on it. (I've only written code I want, in general, because there hasn't been much in the way of requests for extra features. Now that I've got my gallery display snippet working correctly (eg Efikim floral gallery) I'll be tidying up that code (and removing the bit for sales) and releasing it too.)
If its going to be useful for others (ie you), I'll do an EtoGalImages - in your case EGThumbs won't be there so there won't be any duplication of code. Its easy for me to do (in principle) but I've got to get some images cleaned up, colour adjusted, cropped and printed by this evening so might not have time to do it today.
#3
Posted 20 April 2006 - 03:11 PM
I do have EGThumb on my site (I wrongly called it EtoThumb on my first post, have a look at the One Less Child page on my site link above), if that makes a difference to your plans.
I suppose the random image idea would also be nice for EGThumb as well at times.
Edited by rinty, 20 April 2006 - 03:12 PM.
#4
Posted 20 April 2006 - 03:42 PM
I don't see there being much of a gain bandwidth-wise from saving an intermediate sized image, so I'm no going to spend time on it , at least initally. Each user will only download the file once (then it goes into their cache), so you only save the overhead on not having a slightly smaller file on one access - and if they then go on to look at the larger image, then they download the full size one anyway, losing more than you gained the first time round.
rinty, on Apr 20 2006, 04:11 PM, said:
After that, you can do what you want by writing your own styles. Part of the reason for it being designed the way it is is to make it easy to change the display even if you don't know PHP well. (I had hoped others might share styles too, but that hasn't happened.) If there's something specific you wanted to do, and can't see how to, let me know and I'll try.
The next version of EGThumbs will add some new features too.
#5
Posted 20 April 2006 - 03:54 PM
mikef, on Apr 20 2006, 05:42 PM, said:
You may safely ignore that comment from me then
#6
Posted 21 April 2006 - 02:02 PM
Its a temporary fix only, because I've decided to change the next version of EtoGalThumb to allow the use of either the thumbnail or the full size image for display (based on a snippet parameter).
I've put two styles in the snippet as examples, and put together a page at http://www.efikim.co.uk/EtoGalImage.shtml to demonstrate, though they don't look that good on my site because my full size images are relatively small, and so are being enlarged - should work better with larger images that are being shrunk!
EDIT
note that the new beta version of EtoGalThumb should render this snippet unnecessary, and offer more flexibility. EtoGalImage has now been removed as a result.
Edited by mikef, 02 May 2006 - 12:16 PM.
#7
Posted 24 April 2006 - 02:50 PM
mikef, on Apr 21 2006, 04:02 PM, said:
Its a temporary fix only, because I've decided to change the next version of EtoGalThumb to allow the use of either the thumbnail or the full size image for display (based on a snippet parameter).
I've put two styles in the snippet as examples, and put together a page at http://www.efikim.co.uk/EtoGalImage.shtml to demonstrate, though they don't look that good on my site because my full size images are relatively small, and so are being enlarged - should work better with larger images that are being shrunk!
I've dropped the snippet in on my homepage (linked above) and created this style in the snippet:
// style=0 - a very basic banner $styleStrings[0]['header']=0; $styleStrings[0]['tail']=0; $styleStrings[0]['image']=<<<IMG <p align="center">><a href='[~%%gal%%~]'><img src='%%file%%' title='%%title%%' alt='%%sdesc%%' width=\"75%\" height=\"75%\"/></a></p><p align="center">%%title%%</p> IMG;I haven't set up a css style yet because it's only a temporary snippet so I just crudely set up a layout style in html (and called it 0 so I didn't have to call it - how lazy is that
What would be nice is if you could pull the gallery page title in as well so if you specified multiple galleries, you could also have a header. If you look at my homepage you'll see what I mean.
It would also be nice if rather than using a % on the size you could define a maximum display size. As it stands now, you sometimes get vary large portrait images and much smaller landscape on my page. It's obvious why, but it would have more consistancy if you could define a maximum size like EtoGal does on upload.
Edited by rinty, 24 April 2006 - 02:55 PM.
#8
Posted 24 April 2006 - 08:56 PM
rinty, on Apr 24 2006, 03:50 PM, said:
What would be nice is if you could pull the gallery page title in as well so if you specified multiple galleries, you could also have a header. If you look at my homepage you'll see what I mean.
It would also be nice if rather than using a % on the size you could define a maximum display size. As it stands now, you sometimes get vary large portrait images and much smaller landscape on my page. It's obvious why, but it would have more consistancy if you could define a maximum size like EtoGal does on upload.
I'll think about adding in the gallery page title to the replaceable parameters - though the code for the next version already includes longtitle and description as well as the alias. Do you really want the title rather than longtitle?
You could try specifying the pixel width/height in the style rather than a percentage, but I suspect some or all browsers would distort the image to fit the pixel dimensions. I'll think about adding a 'resize' parameter to the next version, but it breaks the principle of simple text substitutions into the style, and needs conditional handling to decide whether to specifiy a resized height or width.
PS - checking the code here, you already have the page longtitle and description available (%%ptitle%% and %%pdesc%%); example of use in style2 in etogalthumb, and shown on http://www.lowermosswood.org.uk/72.html .
Edited by mikef, 24 April 2006 - 09:34 PM.
#9
Posted 24 April 2006 - 09:49 PM
mikef, on Apr 24 2006, 10:56 PM, said:
You could try specifying the pixel width/height in the style rather than a percentage, but I suspect some or all browsers would distort the image to fit the pixel dimensions. I'll think about adding a 'resize' parameter to the next version, but it breaks the principle of simple text substitutions into the style, and needs conditional handling to decide whether to specifiy a resized height or width.
PS - checking the code here, you already have the page longtitle and description available (%%ptitle%% and %%pdesc%%); example of use in style2 in etogalthumb, and shown on http://www.lowermosswood.org.uk/72.html .
// style=0 - a very basic banner $styleStrings[0]['header']=0; $styleStrings[0]['tail']=0; $styleStrings[0]['image']=<<<IMG <h4 align="center">- %%ptitle%% -</h4><p align="center"><a href='[~%%gal%%~]'><img src='%%file%%' title='%%title%%' alt='%%sdesc%%' width=\"75%\" height=\"75%\"/></a></p><p align="center">%%title%%</p> IMG;If you look on my homepage, all you get displayed is the - - bit. Have I got that wrong?
#10
Posted 24 April 2006 - 10:05 PM
rinty, on Apr 24 2006, 10:49 PM, said:
// style=0 - a very basic banner $styleStrings[0]['header']=0; $styleStrings[0]['tail']=0; $styleStrings[0]['image']=<<<IMG <h4 align="center">- %%ptitle%% -</h4><p align="center"><a href='[~%%gal%%~]'><img src='%%file%%' title='%%title%%' alt='%%sdesc%%' width=\"75%\" height=\"75%\"/></a></p><p align="center">%%title%%</p> IMG;If you look on my homepage, all you get displayed is the - - bit. Have I got that wrong?
the snippet doesn't assume that the gallery id is the target page (because it isn't, on my sites!).
if you set the link parameter to the same value as gal, then the internal page based parameters (pdesc and ptitle) get set to the description and long title to those of the page that link is set to.
This snippet needs better documentation too, sometime! I didn't feel tpushed to do so, as no-one said they were using it, and no-one followed the request to share their styles.
#11
Posted 25 April 2006 - 08:30 PM
mikef, on Apr 25 2006, 12:05 AM, said:
the snippet doesn't assume that the gallery id is the target page (because it isn't, on my sites!).
if you set the link parameter to the same value as gal, then the internal page based parameters (pdesc and ptitle) get set to the description and long title to those of the page that link is set to.
This snippet needs better documentation too, sometime! I didn't feel tpushed to do so, as no-one said they were using it, and no-one followed the request to share their styles.
I did this because it seemed a waste of time to call the gallery and then have to call the link to the same gallery as a seperate variable. If you define multiple galleries for the random display, how does the the link variable tally up then?
Edited by rinty, 25 April 2006 - 08:31 PM.
#12
Posted 26 April 2006 - 08:50 AM
rinty, on Apr 25 2006, 09:30 PM, said:
It doesn't. EGThumb and EGimage assume that each call of the snippet relates to a single target page. They don't assume that there is a one gallery per page mapping. My Galleries page calls the EGthumb snippet once for each page (which at present represents one gallery per page, but wouldn't if I wanted to split the landscape gallery by county.
Edited by mikef, 26 April 2006 - 09:08 AM.
#13
Posted 26 April 2006 - 11:19 AM
mikef, on Apr 26 2006, 10:50 AM, said:
Thanks Mike
#14
Posted 26 April 2006 - 11:24 AM
rinty, on Apr 26 2006, 12:19 PM, said:
Thanks Mike
#15
Posted 29 April 2006 - 04:27 PM
The EtoGalImage attachment previously in this thread has been removed.
Edited by mikef, 02 May 2006 - 12:18 PM.
#16
Posted 02 May 2006 - 10:31 AM
mikef, on Apr 29 2006, 06:27 PM, said:
I've left EtoGalImage attachment in this thread for now, in case the EtoGalThumb beta proves problematic, but the latter is recommended.
#17
Posted 02 May 2006 - 10:49 AM
[[EtoGalThumb?gal=23,27&fullsize=1&style=10]] generates an error because it's looking for a directory named 23,27.
Am I using that incorrectly?
#18
Posted 02 May 2006 - 11:12 AM
rinty, on May 2 2006, 11:49 AM, said:
Can you test the attached please?
Edit: attachment removed - the fix is included in the latest version availble from the Etogal downlioads section
Edited by mikef, 03 May 2006 - 03:00 PM.
#19
Posted 03 May 2006 - 11:35 AM
mikef, on May 2 2006, 01:12 PM, said:
Can you test the attached please?
#20
Posted 09 May 2006 - 06:27 PM
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users










