View Full Version : category problem
okapi
20th of June 2004 (Sun), 00:29
i wonder why nobody else reported this problem with snippets yet:
1) include/exclude category seems not to work with latest_photos, only with random_photos.
2) include/exclude category seems not to work if photos are referred to more than one category.
this is how i call the snippets code for one of my archives pages, displaying microthumbs of my images, sorted by category (= month):
<?php
include("http://www.a-visual-notebook.at/photolog/snippets.php?get=random_photos&amount=50&border=1& bordercolor=666666&hspace=3&vspace=3&viewas=image& thumbsize=microthumb&includecategory=16");
?>
and this is what i'd like to have: the latest photos from one category, sorted by their order in the exhibition.
<?php
include("http://www.a-visual-notebook.at/photolog/snippets.php?get=latest_photos&amount=50&border=1& bordercolor=666666&hspace=3&vspace=3&viewas=image& thumbsize=microthumb&includecategory=16");
?>
unfortunately this does not work...
okapi
22nd of June 2004 (Tue), 03:41
pekka...?
maybe i'm doing something wrong?
anybody else who has this problem?
Pekka
22nd of June 2004 (Tue), 03:58
I see the bug(s) now. I'll get you a fix soon.
okapi
22nd of June 2004 (Tue), 09:00
thanks a lot, pekka, i'm looking forward to this!
and to any further improvements!
the snippets system rocks!
okapi
6th of July 2004 (Tue), 06:14
please pekka,
please be so kind to fix that category/snippets bug!
thank you!
michael
Pekka
6th of July 2004 (Tue), 15:50
Sorry for being slow - there is lot of work going on now with EE and I simply forgot to finish this.
There is a fixed version in http://photography-on-the.net/ee/beta/snippets.zip
There are logical issues with excludecategory like when a photo is assigned to several categories (each assigned category must be excluded or photo will show) --- I'll try to think of ways to improve this so that it is easier to undertand what is happening. Also, remember that every photo is always in category 1.
Last and random should work both in same way now.
okapi
7th of July 2004 (Wed), 05:39
hi pekka,
i just installed the fixed snippets.php file you kindly provided. but the output still doesn't behave in the desired way. please take a look at my archives for june 2004:
http://www.a-visual-notebook.at/photolog/archives/archives_2004_06.php
where the following line calls the snippets script to show the (mirco-)thumbs:
<?php
include("http://www.a-visual-notebook.at/photolog/snippets.php?get=latest_photos&amount=50&border=1& bordercolor=666666&hspace=3&vspace=3&viewas=image& thumbsize=microthumb&includecategory=16");
?>
the result is: thumbs are now shown in some strange "alternating" ascending sort order:
728 745 729 746 730 747 731 748 732 749 734 ... and so on, and then unexpectedly, in the last row: 741 742 743 744.
please move the mouse over the thumbs and watch the image id's in the urls shown in the status bar.
what's wrong?
maybe it's because of line 295 to 298 of the snippets code...?
GROUP BY ee_photo.ee_photo_id
ORDER BY
ee_photo.ee_photo_exif_datetime DESC
LIMIT {$amount}
there are no exif data for my photos, because before image postprocessing i usually convert them to bmp, so exif data are lost.
actually i would love to have the thumbs sorted by their ID's or - even better - by their order in the exhibition, but i understand, that this would not suit for everbody, because not everybody is running a photolog.
now, if exif data are absolutely required, can they be additionally added?
Pekka
7th of July 2004 (Wed), 05:57
Because the image id is not the sort parameter, but date, this is "latest photos taken" vs. "latest inserted photos" issue :roll: If dates (photo editor date and time fields) are identical then sorting uses id's and that will create a mixed sort "look".
Change in your snippets.php's line 297
ee_photo.ee_photo_exif_datetime DESC
to
ee_photo.ee_photo_id DESC
and you'll them sorted by id.
I'll add full sort and search parameters to snippets sometime later.
okapi
7th of July 2004 (Wed), 06:30
yes, that's it!
thank you very much for your quick help!
michael
PrimaPhoto
7th of July 2004 (Wed), 13:08
I was so glad to see this topic posted :D
Just started working with the snippets on lunch hour today and had problems but the info posted here was a big help!
okapi, I absolutely love the layout of your site! and not to mention the photographs!
Thanks to you both.
wkitty42
9th of July 2004 (Fri), 16:25
Because the image id is not the sort parameter, but date, this is "latest photos taken" vs. "latest inserted photos" issue :roll: If dates (photo editor date and time fields) are identical then sorting uses id's and that will create a mixed sort "look".
is this sorting on the date why my exhibits go out of my assigned order in the exhibit when i upload new photos, or create new exhibits or groups?
it has been somewhat upsetting to take the time to upload the photos in the order in which they are taken (some tell a story in their sequence) and then have them displayed in reverse order... its been somewhat upsetting to add new photos to an existing exhibit and they are display first before the others... each time i always have to go in and set the order in the exhibit... i guess the part that was upsetting the most was not knowing that this was happening until having it pointed out that the story was backwards or when telling someone to go to the exhibit opening page and click on the second picture (example) and them to tell me that it was the wrong one... not until later would they tell me it was the second from the end instead of the beginning...
vBulletin® v3.6.12, Copyright ©2000-2012, Jelsoft Enterprises Ltd.