How to change view counts?

timned88

Joined: 2011-08-31
Posts: 88
Posted: Fri, 2012-05-04 14:27

Is there a way to change the view counts on folders (not individual pics, that would take WAY too long)?
For example, I am moving a gallery from a different software package that I had been using for years to Gallery3 but want to be able to keep the folder counts and thus the total views if possible. My old gallery has over 10,000,000 views and I would like to be able to update the counts to keep right on going.

How could I do this? The reset_views module is not the solution I am looking for. Thank you.

 
jnash
jnash's picture

Joined: 2004-08-02
Posts: 607
Posted: Fri, 2012-05-04 14:51

I'm not real clear on the view calculations, but I believe they are derived/accumulated from the individual photo views within the album. I'm not sure if a database edit would 'fix' your counts for you.

Hopefully, someone more knowledgeable will chime in.

 
timned88

Joined: 2011-08-31
Posts: 88
Posted: Fri, 2012-05-04 15:05

even if there was just a counter offset that could be hard-coded in, that would work also.

 
timned88

Joined: 2011-08-31
Posts: 88
Posted: Fri, 2012-05-04 22:08

I found a way to adjust the individual photo counts using phpmyadmin, but that is not the most elegant solution. is there a way to adjust the total views at the folder level?

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 25961
Posted: Sat, 2012-05-05 04:20

There is a reset counts module what does it lack?

Dave
____________________________________________
Blog & G2 || floridave - Gallery Team

 
timned88

Joined: 2011-08-31
Posts: 88
Posted: Sat, 2012-05-05 12:40

It only sets the count to 0 for items/folders, right?
What I want to do is to be able to set the count to whatever it was in my old gallery as I am changing software packages.

 
timned88

Joined: 2011-08-31
Posts: 88
Posted: Sat, 2012-05-05 13:00

dave, i found how to change the counts on the item level. is there a similar way to change the count at the album/folder level?

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 25961
Posted: Sun, 2012-05-06 03:30

Not at this time. It could be expanded to do so.
How should the UI work while still allowing the user to reset the items in the album?
If you can mock something up of how the UI should work (expand the existing UI with some screen-shots & some text of your new ideas/look) I should be able to make this happen.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 25961
Posted: Sun, 2012-05-06 04:40

http://codex.gallery2.org/Gallery3:Modules:reset_counts
updated to version 2 you will be able to reset the album count not with the albums context menu.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
timned88

Joined: 2011-08-31
Posts: 88
Posted: Sun, 2012-05-06 13:15

dave, i think all that would be needed would be to change the "reset the items count in this level" to "set the count for this album" and give an input box at the album level.

alternatively, if you MUST set each individual item in order to have the count working, you could have an option to set individual items in this album which pops up a tiny thumbnail and the current count for the item then have an input box for each item in the album so you could just enter an updated value and tab to the next item, enter the updated value, tab to the next, etc. one "done" button at the bottom would update the entire thing.

make sense?

i am not at my home computer so i can't make any screen mockups at this time.

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 25961
Posted: Sun, 2012-05-06 21:05

What I came up with was:
When browsing an album you can reset the individual items or albums with the context menu (thumbnail menu)
If you want to reset a bunch of items in the album you have to go into the album and use the album menu (above navigation) to reset all the items in that album.

Dave

_____________________________________________
Blog & G2 || floridave - Gallery Team

 
timned88

Joined: 2011-08-31
Posts: 88
Posted: Sun, 2012-05-06 21:21

i understand but maybe we are having issues over the word "reset".
what i want to do is bring an album from my old software into gallery3 and be able to change the view counts to match what was in the old software. its easy enough to get a listing from my old software of the view counts... i want to be able to easily change the counts to match the old software once the photos are brought into gallery3, not reset them to 0.

example...
old software package
photo 1 = 1022 views
photo 2 = 2022 views
photo 3 = 3022 views
total = 6066 views

import photo 1/2/3 into gallery3... all will have 0 views, album will have 0 views.
need quickest and easiest way to update the views in gallery3 to match the old software package. easiest way i have found so far is to go into phpmyadmin and use the "change" command on the items table.

does this make sense?

 
jnash
jnash's picture

Joined: 2004-08-02
Posts: 607
Posted: Sun, 2012-05-06 22:00

you're not going to be able to 'auto' adjust the counts... you'd have to modify each photo, then modify the album count ...

unless you were to write your own import module, you're going to have to do it ^^^ this way

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 25961
Posted: Mon, 2012-05-07 00:10

If by 'old software' you mean G2 then the counts are migrated/imported using the import module. If not, then you would have to adjust items manually or write some script to do the lookup of the views accordingly.

Quote:
old software package
photo 1 = 1022 views
photo 2 = 2022 views
photo 3 = 3022 views
total = 6066 views

Looks to me like you have 4 different items (I consider a album a item) with 4 different view counts. So your import script will have to look at the counts for each item and update the count in G3 accordingly.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
timned88

Joined: 2011-08-31
Posts: 88
Posted: Mon, 2012-05-07 00:24

I am not looking for an import script. I was merely posting an example. I don't care if photo one, photo two, and photo three all have zero views. I just want the folder itself to have 6066 without having to change every single item inside..

 
jnash
jnash's picture

Joined: 2004-08-02
Posts: 607
Posted: Mon, 2012-05-07 00:27

ah, then you should be good with the updated module - it allows album level count changes now.

 
timned88

Joined: 2011-08-31
Posts: 88
Posted: Mon, 2012-05-07 00:45

I must have missed it. Can you tell me how?

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 25961
Posted: Mon, 2012-05-07 02:27

When browsing an album, you can reset the individual items or sub-albums with the context menu (thumbnail menu).

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
timned88

Joined: 2011-08-31
Posts: 88
Posted: Mon, 2012-05-07 05:19

ok, found it. problem is that after updating the new sub-album, it doesn't update the count on the index page for total views, so it appears that each photo has to be updated individually in order to make this work. ARRRGGGGHHH

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 25961
Posted: Mon, 2012-05-07 21:37

Sorry to here that. I still fail to see what you want to do. How is the root album info displayed? We have given you the tool to update albums (individuality) and all items in the albums as well. I have even updated the module to do what I was thinking you wanted it to do.
I will leave it up to you to update the DB manually with the data you want.

Oh well.... Can't please all the people all the time.

Dave

_____________________________________________
Blog & G2 || floridave - Gallery Team

 
timned88

Joined: 2011-08-31
Posts: 88
Posted: Tue, 2012-05-08 12:07

No need to be upset, Dave, as I appreciate your help and what you did. The problem arose because once I changed the view count of a gallery at the sub-folder level, the new count did not appear to recurse upward toward the index level. I see now what the issue was... when I wanted to set the total views of a new folder, changing the views of that folder only changed the views on THAT specific page. The total images viewed on the index did not change because it does not count how many times the folder page was viewed. So in order to achieve what I am trying to achieve, at this point it seems that each individual image needs to be adjusted on its own, unless you can think of a way to do it some other way.

My structure (Disney Photo Gallery) is as follows:
INDEX (which contains PARKS) --> AREAS IN PARKS --> ATTRACTION/SHOW --> GALLERY 1 --> PHOTO 1, PHOTO 2, PHOTO 3, ETC.

I thought that if you changed the value of GALLERY 1 at that level, it would reflect on the INDEX and update the total views. It doesn't... PHOTO 1 needs to the adjusted, along with PHOTO 2, PHOTO 3, etc.

Please head over to http://www.themagicinpixels.com/gallery3 to see how my gallery is set up.

 
jnash
jnash's picture

Joined: 2004-08-02
Posts: 607
Posted: Tue, 2012-05-08 15:04

Dave, maybe allow adjusting the root gallery count then?

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 25961
Posted: Tue, 2012-05-08 18:15
Quote:
it seems that each individual image needs to be adjusted on its own, unless you can think of a way to do it some other way.

I can't think of another way without redoing to the code.

Quote:
I thought that if you changed the value of GALLERY 1 at that level, it would reflect on the INDEX and update the total views. It doesn't...

You are correct. That is the behavior/behaviour: by design.

Quote:
Dave, maybe allow adjusting the root gallery count then?

I could that I guess. should not be that hard to do, remove a if() or 2.

Dave

_____________________________________________
Blog & G2 || floridave - Gallery Team

 
timned88

Joined: 2011-08-31
Posts: 88
Posted: Tue, 2012-05-08 19:17
Quote:
Quote:
Dave, maybe allow adjusting the root gallery count then?

I could that I guess. should not be that hard to do, remove a if() or 2.

Dave

_____________________________________________
Blog & G2 || floridave - Gallery Team

That would be awesome!

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 25961
Posted: Tue, 2012-05-08 22:17

Version 3 attached.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

AttachmentSize
reset_counts.zip6.16 KB
 
timned88

Joined: 2011-08-31
Posts: 88
Posted: Wed, 2012-05-09 00:36

hoping this works perfectly... sounds like it should, but i am getting a validation error max.length. where would i increase the number of allowed digits? my other gallery over 10,000,000 hits. thanks, dave.

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 25961
Posted: Wed, 2012-05-09 01:34

admin_reset_count.php
find:
->rules("valid_numeric|length[1,5]");
change to
->rules("valid_numeric|length[1,9]");

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
timned88

Joined: 2011-08-31
Posts: 88
Posted: Wed, 2012-05-09 04:01

dave, version 3 changed how many times the index page was viewed, but did not change the total photos view counter. if you go to my gallery (themagicinpixels.com/gallery3)... your newest version changed the top line in the right sidebar ("This page has been viewed 5,270 times") but did not change the total images viewed, located 3 lines down in the sidebar ("Total Views: 761,272 "). THAT is what I was trying to change.

i think i may have come up with a solution, however, in the interim. if i create a password protected/hidden album with one image inside of it, i could set the one image to whatever count i want it to be, and that would affect the total images viewed. because it's hidden from the general public, they would never know. does that make sense?

again, I thank you for your help and patience with this.

 
timned88

Joined: 2011-08-31
Posts: 88
Posted: Wed, 2012-05-09 04:05

yup, my proposed solution did the trick, with help from your reset_counts modification. if you can think of a more elegant solution, i would love to hear it but for now the task that i was seeking has been accomplished (and a helluva lot easier than changing 6000 images photo counts in cpanel)...

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 25961
Posted: Wed, 2012-05-09 06:15

I don't know how or where that "located 3 lines down in the sidebar ("Total Views: 761,272 "). " comes from so......
Glad you fond a solution.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
timned88

Joined: 2011-08-31
Posts: 88
Posted: Wed, 2012-05-09 06:24

its actually over 11,000,000 now reflecting the solution that i had implemented. look at the top of the sidebar on the upper right.

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 25961
Posted: Wed, 2012-05-09 06:43

I see it but what module is it?

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
timned88

Joined: 2011-08-31
Posts: 88
Posted: Wed, 2012-05-09 17:47

"about this album" - i believe.

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 25961
Posted: Wed, 2012-05-09 22:13
Quote:
i believe.

Come on! I want to help ... but that is not very helpful.
So I have to install this (or perhaps some other) module and see if it has this functionality, to see if it displays some "total views..." Then figure out how it gt this total and make some other module function in some way to get this total.
I'm putting out a lot of effort here and I get "i believe'.

I hope you know that, by design, items that are viewed are not cascaded in each direction. Only the item (albums are items) get counted on each view, that is by design.

Off to install the "about this album module' to see how it works.

Dave

_____________________________________________
Blog & G2 || floridave - Gallery Team