forum.coppermine-gallery.net
Support => cpg1.3.x Support => Older/other versions => cpg1.3 Miscellaneous => Topic started by: lamama on October 04, 2004, 02:13:47 pm
-
when I add uploaded pictures via the batch add-function, the new pics appear all at once in the lasthits-view.
bug or feature?
-
Do you mean they all have the same uploaded time? That's correct, since all the pictures were processed at the same time.
-
no, I mean the fact that they are shown in the lasthits-view.
I would expect that only the last views from "real" users (or spiders or whatever...) appear there, not the "internal hits" of coppermine itself.
-
It would be whenever the info for that file was altered in the database, it is an automatic thing.
-
ok, that explains a lot :-)
but then it's no real "lasthits", right?
-
how is any software to "know" if the hit comes from a "real" surfer or a spider? I'm sorry, I don't get the point...
Joachim
-
Its not real users vs. spiders but users/spiders vs. coppermine itself.
The point is, that the name "lasthits view" suggests that I get a list of what pictures users/spiders or any visitor from across the net has decided to watch.
I was surprised that also such pics that are added to the gallery via batch add appear in the "lasthits" view. It's something I had not expected - that's why I asked:
bug or feature?
I would suggest: bug. :-)
-
lamama, you must be more careful with your use of the word 'bug.'
Can you suggest a better way to calculate last hits?
-
@lamama
This is by design, but you can easily modify the code. Open up functions.inc.php and find
case 'lasthits': // Last viewed pictures
A few lines down you'll see this
$query = "SELECT $select_columns FROM {$CONFIG['TABLE_PICTURES']} WHERE approved = 'YES' $ALBUM_SET ORDER BY mtime DESC $limit";
Change it to
$query = "SELECT $select_columns FROM {$CONFIG['TABLE_PICTURES']} WHERE approved = 'YES' and hits > 0 $ALBUM_SET ORDER BY mtime DESC $limit";
Now you'll only get pictures that have been hit at least once.
@The Dev team:
Should this be added to devel?
-
The drawback to using the alternative is that if you have albums that haven't been viewed, the last viewed meta album will show up saying no images to display.
It's for the same reason I can't use "most viewed" because some albums are new and have no or not enough hits.
-
The drawback to using the alternative is that if you have albums that haven't been viewed, the last viewed meta album will show up saying no images to display.
If you have a new site with lasthits on the main page, it's correct to get No images to display. If you upload a batch of images but haven't looked at them yet, it's also correct to get that message. Or maybe I'm not on the same page with you, Tranz?
-
With the way things are now, if the images haven't been viewed, the 'last hit' time is the same as the uploaded time, so the last viewed meta album doesn't show "No images to display"
-
lamama, you must be more careful with your use of the word 'bug.'
Can you suggest a better way to calculate last hits?
;D Sorry, it's of course not a real "bug" ;-) It just didn't behaved the way I expected.
If I watch the "last view" meta album I just want to know what other users have recently watched, but not if the upload script worked fine :-)
@TranzNDance: I don't understand why Images that never have been viewed need a "last hit" time?
-
I don't think there's any sense in having images that haven't been viewed yet showing up in the lasthits meta album - that's what the lastup meta album is for.
-
How about this... instead of having a box saying "No images to display" if there are no photos that match a meta album's criteria, just don't make it show the box. Then, if we use the last hit meta album and there's an album with no hits, that box doesn't show up.
-
I'd have no problem with a "no images to display" box. If noone has visited a album and clicked some pics then it is so.
I just had a "problem" ;-) with pics that appear in that lasthits meta album but noone except coppermine itself ever "clicked" on them. ::)
-
Have you applied my fix? That takes care of images appearing in lasthits if they haven't been looked at yet.
-
Have you applied my fix? That takes care of images appearing in lasthits if they haven't been looked at yet.
Yes, I finally applied it today.
Works fine! Many thanks!!
The actual code differs a bit from the line you posted:
original code (cpg 1.3.2.):
$result = db_query("SELECT $select_columns FROM {$CONFIG['TABLE_PICTURES']} WHERE approved = 'YES' $ALBUM_SET ORDER BY mtime DESC $limit");
modified code:
$result = db_query("SELECT $select_columns FROM {$CONFIG['TABLE_PICTURES']} WHERE approved = 'YES' and hits > 0 $ALBUM_SET ORDER BY mtime DESC $limit");
(to be made in the "lasthits" section of functions.inc.php as posted above.)