batch added pics appear all in lasthits ? batch added pics appear all in lasthits ?
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

batch added pics appear all in lasthits ?

Started by lamama, October 04, 2004, 02:13:47 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

lamama

when I add uploaded pictures via the batch add-function, the new pics appear all at once in the lasthits-view.

bug or feature?

kegobeer

Do you mean they all have the same uploaded time?  That's correct, since all the pictures were processed at the same time.
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

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.

Nibbler

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

lamama

ok, that explains a lot :-)

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

Joachim Müller

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

lamama

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

Tranz

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

Can you suggest a better way to calculate last hits?

kegobeer

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

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.

kegobeer

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

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

Quote from: TranzNDance 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?

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

kegobeer

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

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.

lamama

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

kegobeer

Have you applied my fix?  That takes care of images appearing in lasthits if they haven't been looked at yet.
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


Quote from: kegobeer 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.

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