Advanced search  

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Pages: [1]   Go Down

Author Topic: batch added pics appear all in lasthits ?  (Read 8316 times)

0 Members and 1 Guest are viewing this topic.

lamama

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 404
batch added pics appear all in lasthits ?
« 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?
« Last Edit: November 10, 2004, 05:40:30 pm by GauGau »
Logged

kegobeer

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 4637
  • Beer - it does a body good!
    • The Kazebeer Family Website
Re: batch added pics appear all in lasthits ?
« Reply #1 on: October 04, 2004, 04:21:08 pm »

Do you mean they all have the same uploaded time?  That's correct, since all the pictures were processed at the same time.
Logged
Do not send me a private message unless I ask for one.  Make your post public so everyone can benefit.

There are no stupid questions
But there are a LOT of inquisitive idiots

lamama

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 404
Re: batch added pics appear all in lasthits ?
« Reply #2 on: October 05, 2004, 12:40:10 pm »

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.
Logged

Nibbler

  • Guest
Re: batch added pics appear all in lasthits ?
« Reply #3 on: October 05, 2004, 12:45:10 pm »

It would be whenever the info for that file was altered in the database, it is an automatic thing.
Logged

lamama

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 404
Re: batch added pics appear all in lasthits ?
« Reply #4 on: October 05, 2004, 10:55:46 pm »

ok, that explains a lot :-)

but then it's no real "lasthits", right?
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: batch added pics appear all in lasthits ?
« Reply #5 on: October 05, 2004, 11:55:00 pm »

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
Logged

lamama

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 404
Re: batch added pics appear all in lasthits ?
« Reply #6 on: October 06, 2004, 12:51:16 am »

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. :-)
Logged

Tranz

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Female
  • Posts: 6149
Re: batch added pics appear all in lasthits ?
« Reply #7 on: October 06, 2004, 01:00:20 am »

lamama, you must be more careful with your use of the word 'bug.'

Can you suggest a better way to calculate last hits?
Logged

kegobeer

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 4637
  • Beer - it does a body good!
    • The Kazebeer Family Website
Re: batch added pics appear all in lasthits ?
« Reply #8 on: October 06, 2004, 01:46:52 am »

@lamama

This is by design, but you can easily modify the code.  Open up functions.inc.php and find

Code: [Select]
case 'lasthits': // Last viewed pictures
A few lines down you'll see this

Code: [Select]
$query = "SELECT $select_columns FROM {$CONFIG['TABLE_PICTURES']} WHERE approved = 'YES' $ALBUM_SET ORDER BY mtime DESC $limit";
Change it to

Code: [Select]
$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?
Logged
Do not send me a private message unless I ask for one.  Make your post public so everyone can benefit.

There are no stupid questions
But there are a LOT of inquisitive idiots

Tranz

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Female
  • Posts: 6149
Re: batch added pics appear all in lasthits ?
« Reply #9 on: October 06, 2004, 01:49:57 am »

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.
Logged

kegobeer

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 4637
  • Beer - it does a body good!
    • The Kazebeer Family Website
Re: batch added pics appear all in lasthits ?
« Reply #10 on: October 06, 2004, 01:55:13 am »

Quote
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?
Logged
Do not send me a private message unless I ask for one.  Make your post public so everyone can benefit.

There are no stupid questions
But there are a LOT of inquisitive idiots

Tranz

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Female
  • Posts: 6149
Re: batch added pics appear all in lasthits ?
« Reply #11 on: October 06, 2004, 02:54:41 am »

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"
Logged

lamama

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 404
Re: batch added pics appear all in lasthits ?
« Reply #12 on: October 06, 2004, 04:08:19 am »

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?
Logged

kegobeer

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 4637
  • Beer - it does a body good!
    • The Kazebeer Family Website
Re: batch added pics appear all in lasthits ?
« Reply #13 on: October 06, 2004, 03:48:48 pm »

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.
Logged
Do not send me a private message unless I ask for one.  Make your post public so everyone can benefit.

There are no stupid questions
But there are a LOT of inquisitive idiots

Tranz

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Female
  • Posts: 6149
Re: batch added pics appear all in lasthits ?
« Reply #14 on: October 06, 2004, 03:55:25 pm »

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.
Logged

lamama

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 404
Re: batch added pics appear all in lasthits ?
« Reply #15 on: October 06, 2004, 06:49:44 pm »

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.  ::)
Logged

kegobeer

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 4637
  • Beer - it does a body good!
    • The Kazebeer Family Website
Re: batch added pics appear all in lasthits ?
« Reply #16 on: October 06, 2004, 07:18:14 pm »

Have you applied my fix?  That takes care of images appearing in lasthits if they haven't been looked at yet.
Logged
Do not send me a private message unless I ask for one.  Make your post public so everyone can benefit.

There are no stupid questions
But there are a LOT of inquisitive idiots

lamama

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 404
Re: batch added pics appear all in lasthits ?
« Reply #17 on: November 10, 2004, 04:32:22 pm »


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.):
Code: [Select]
$result = db_query("SELECT $select_columns FROM {$CONFIG['TABLE_PICTURES']} WHERE approved = 'YES' $ALBUM_SET ORDER BY mtime DESC $limit");
modified code:
Code: [Select]
$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.)

Logged
Pages: [1]   Go Up
 

Page created in 0.023 seconds with 20 queries.