Pekka
28th of September 2003 (Sun), 17:05
As you may know, you have a new html output system in 1.5, for advanced users this is a way to integrate EE to your site and pick parts of html output from list or photo page to different parts of the site.
The page template is chosen by using parameter "html". I have done one demonstation of "stripped down" template which displays only header and thumbs, it is called "embed". You can do and save and use as many page templates as you need.
So what do the page template files do? Compare output of these links (right-click and open to new window, or jsut drag and drop to another browser window):
link (http://photography-on-the.net/gallery/list.php?exhibition=1&pass=public&lang=fin&select_output=microthumbs&perpage=10)
vs.
link (http://photography-on-the.net/gallery/list.php?exhibition=1&pass=public&lang=fin&select_output=microthumbs&perpage=10&html=embed)
There are two new output styles just for plain thumb display (no table code): 'just_thumbs.php' and 'just_microthumbs.php'. You apply the desired output style using "select_output=plain_thumbs" parameter, like in
link (http://photography-on-the.net/gallery/list.php?exhibition=1&pass=public&lang=fin&select_output=just_thumbs&perpage=10&html=embed)
Then you can also govern per page by "perpage" parameter:
link (http://photography-on-the.net/gallery/list.php?exhibition=1&pass=public&lang=eng&select_output=just_microthumbs&perpage=27&html=embed)
Perpage can be non-even number, not 10 20 50 like in EE interface. EE will correct it automatically to closest one when you click the link and arrive to "real" EE photo page.
Then something for REALLY advanced webmasters :)
As EE works most of the time directly on SQL tables as variables, the sorts and searches uses those table names. This means doing a search using template system and embedding needs some care so that you won't get database errors. There are some single language tables which are safest to use for now:
ee_photo.ee_photo_id
ee_photo.ee_photo_exif_datetime
ee_photo.ee_photo_exif_iso
ee_photo.ee_photo_exif_shutter
ee_photo.ee_photo_exif_aperture
ee_photo.ee_photo_exif_mode
ee_photo.ee_photo_exif_metering
ee_location.ee_location_name
ee_owner.ee_owner_name
ee_photo.ee_photo_orientation
all of which you can use in sorting and search quite easily as in
link (http://photography-on-the.net/gallery/list.php?exhibition=1&pass=public&search_row=ee_photo.ee_photo_exif_iso&keyword=100&lang=eng&select_output=just_microthumbs&perpage=5&html=embed)
Getting data out from EE this way has some advantages you don't get from normal EE photo browser interface. Above search searches _exactly_ keyword 100, and not 1000, too like standard EE. If you need to have wildcards, use % (as *) and _ (as ?).
Want to get five _horizontal_ images?
link (http://photography-on-the.net/gallery/list.php?exhibition=1&pass=public&search_row=ee_photo.ee_photo_orientation&keyword=h&lang=eng&select_output=just_microthumbs&perpage=5&html=embed)
Only photos with evaluative metering:
link (http://photography-on-the.net/gallery/list.php?exhibition=1&pass=public&search_row=ee_photo.ee_photo_exif_metering&keyword=eval&lang=eng&select_output=just_microthumbs&perpage=50&html=embed)
Sort order is done with
order=DESC
and
order=ASC
and sort fields are chosen from
sort_row=custom
sort_row=id
sort_row=header
sort_row=date
sort_row=lens
sort_row=iso
sort_row=shutter
sort_row=f
sort_row=mode
sort_row=metering
sort_row=country
sort_row=location
sort_row=counter
sort_row=photographer
sort_row=exhibition
sort_row=camera
sort_row=flash
sort_row=support
sort_row=light
sort_row=evcorr
sort_row=focal
sort_row=orientation
"custom" order means Author's order and "f" is aperture.
In exhibition "all" means "all exhibitions combined". It still shows only those exhibitions which are under given pass, as EE always does.
As you combine all these parameters you start to have fun with EE embedding. This one fetches 200 photos with
- evaluative metering
- english language
- as plain microthumbs
- sorted by date in descending order
- from all exhibitions under password 'public'
link (http://photography-on-the.net/gallery/list.php?exhibition=all&pass=public&search_row=ee_photo.ee_photo_exif_metering&keyword=eval&lang=eng&select_output=just_microthumbs&perpage=200&sort_row=ee_photo.ee_photo_exif_datetime&order=DES C&html=embed)
To make these URL's display the result right in a page you will need to use some scripting language like PHP or PERL. In PHP command
<?php
include(" http://url.here";);
?>
Embeds the html result of the URL right into a page. This is usually restricted to your own server for safety reasons.
The page template is chosen by using parameter "html". I have done one demonstation of "stripped down" template which displays only header and thumbs, it is called "embed". You can do and save and use as many page templates as you need.
So what do the page template files do? Compare output of these links (right-click and open to new window, or jsut drag and drop to another browser window):
link (http://photography-on-the.net/gallery/list.php?exhibition=1&pass=public&lang=fin&select_output=microthumbs&perpage=10)
vs.
link (http://photography-on-the.net/gallery/list.php?exhibition=1&pass=public&lang=fin&select_output=microthumbs&perpage=10&html=embed)
There are two new output styles just for plain thumb display (no table code): 'just_thumbs.php' and 'just_microthumbs.php'. You apply the desired output style using "select_output=plain_thumbs" parameter, like in
link (http://photography-on-the.net/gallery/list.php?exhibition=1&pass=public&lang=fin&select_output=just_thumbs&perpage=10&html=embed)
Then you can also govern per page by "perpage" parameter:
link (http://photography-on-the.net/gallery/list.php?exhibition=1&pass=public&lang=eng&select_output=just_microthumbs&perpage=27&html=embed)
Perpage can be non-even number, not 10 20 50 like in EE interface. EE will correct it automatically to closest one when you click the link and arrive to "real" EE photo page.
Then something for REALLY advanced webmasters :)
As EE works most of the time directly on SQL tables as variables, the sorts and searches uses those table names. This means doing a search using template system and embedding needs some care so that you won't get database errors. There are some single language tables which are safest to use for now:
ee_photo.ee_photo_id
ee_photo.ee_photo_exif_datetime
ee_photo.ee_photo_exif_iso
ee_photo.ee_photo_exif_shutter
ee_photo.ee_photo_exif_aperture
ee_photo.ee_photo_exif_mode
ee_photo.ee_photo_exif_metering
ee_location.ee_location_name
ee_owner.ee_owner_name
ee_photo.ee_photo_orientation
all of which you can use in sorting and search quite easily as in
link (http://photography-on-the.net/gallery/list.php?exhibition=1&pass=public&search_row=ee_photo.ee_photo_exif_iso&keyword=100&lang=eng&select_output=just_microthumbs&perpage=5&html=embed)
Getting data out from EE this way has some advantages you don't get from normal EE photo browser interface. Above search searches _exactly_ keyword 100, and not 1000, too like standard EE. If you need to have wildcards, use % (as *) and _ (as ?).
Want to get five _horizontal_ images?
link (http://photography-on-the.net/gallery/list.php?exhibition=1&pass=public&search_row=ee_photo.ee_photo_orientation&keyword=h&lang=eng&select_output=just_microthumbs&perpage=5&html=embed)
Only photos with evaluative metering:
link (http://photography-on-the.net/gallery/list.php?exhibition=1&pass=public&search_row=ee_photo.ee_photo_exif_metering&keyword=eval&lang=eng&select_output=just_microthumbs&perpage=50&html=embed)
Sort order is done with
order=DESC
and
order=ASC
and sort fields are chosen from
sort_row=custom
sort_row=id
sort_row=header
sort_row=date
sort_row=lens
sort_row=iso
sort_row=shutter
sort_row=f
sort_row=mode
sort_row=metering
sort_row=country
sort_row=location
sort_row=counter
sort_row=photographer
sort_row=exhibition
sort_row=camera
sort_row=flash
sort_row=support
sort_row=light
sort_row=evcorr
sort_row=focal
sort_row=orientation
"custom" order means Author's order and "f" is aperture.
In exhibition "all" means "all exhibitions combined". It still shows only those exhibitions which are under given pass, as EE always does.
As you combine all these parameters you start to have fun with EE embedding. This one fetches 200 photos with
- evaluative metering
- english language
- as plain microthumbs
- sorted by date in descending order
- from all exhibitions under password 'public'
link (http://photography-on-the.net/gallery/list.php?exhibition=all&pass=public&search_row=ee_photo.ee_photo_exif_metering&keyword=eval&lang=eng&select_output=just_microthumbs&perpage=200&sort_row=ee_photo.ee_photo_exif_datetime&order=DES C&html=embed)
To make these URL's display the result right in a page you will need to use some scripting language like PHP or PERL. In PHP command
<?php
include(" http://url.here";);
?>
Embeds the html result of the URL right into a page. This is usually restricted to your own server for safety reasons.