forum.coppermine-gallery.net

No Support => Feature requests => Topic started by: olegario on January 08, 2004, 02:48:30 pm

Title: Reset views in an album
Post by: olegario on January 08, 2004, 02:48:30 pm
I was wondering if anyone's come up with a way to reset the number of views in one album back to zero.

Thanks in advance!
Title: Reset views in an album
Post by: Joachim Müller on January 08, 2004, 02:55:23 pm
you mean another way than clicking on "edit pics" next to the album thumbnail in category view when logged in as admin and enabling the checkbox "Reset view counter" next to each pic? Something like "reset views on the whole album"? Hasn't been done yet, will go into my todo-list.

GauGau
Title: Reset views in an album
Post by: olegario on January 08, 2004, 04:43:48 pm
Yup!  That's it...Having to go through 100 pictures in an album specifically picking out which pictures have views and resetting them can be an eye-strain.

Thanks again.
Title: Reset views in an album
Post by: Spike05 on March 01, 2004, 08:46:16 am
When does that feature Release?
Title: Reset views in an album
Post by: Joachim Müller on March 01, 2004, 09:21:27 am
as soon as someone is actually doing the coding. This request has very low priority for me - if you need it urgently, you'll have to code it for yourself.

GauGau
Title: Re: Reset views in an album
Post by: Nibbler on July 20, 2004, 01:05:19 am
Added into admin tools for version 1.4
Title: Re: [Done]: Reset views in an album
Post by: Tranz on September 13, 2004, 04:20:52 pm
I was looking for this function, too. Since it's not yet available, I figured I'd see if I could make the change directly in the database.

Here is the SQL query to run to reset views/hits for specific albums:
Code: [Select]
UPDATE `cpg11d_pictures` SET `hits` = '0'
WHERE `aid` = AA AND `hits` > 0;

AA = album id, which you can get by looking at the album's URL. cpg11d should match whatever your cpg table name is.

To reset views for all  albums
Code: [Select]
UPDATE `cpg11d_pictures` SET `hits` = '0'
WHERE `hits` > 0;

Use these instructions with care and only after backing up your database. If you don't understand this, please don't try this at home.
Title: Re: Reset views in an album
Post by: Joachim Müller on September 14, 2004, 09:03:52 am
Added into admin tools for version 1.4
Will even be in album properties screen of each album in cpg1.4 (see attached screenshot).

Joachim
Title: Re: Reset views in an album
Post by: cryogenic on September 14, 2004, 09:57:29 am
I noticed that and a few other things added in the new CVS. I like it a lot... just one minor thing... it's "irrevocably" (you missed an R), though I'd think the word "irreversibly" would be more fitting there.  ;)  Either way, good addition. Can't wait to see what's next.
Title: Re: Reset views in an album
Post by: ebonyhunter on April 15, 2005, 05:12:12 am
I was reading this thread trying to figure out if there is a simple way to reset the view counter for ALL the albums at once or by individual albums.  Since this discussion took place over six months ago, I'm wondering if there is an update or new answer.  I'm using CPG 1.3.
Title: Re: Reset views in an album
Post by: Tranz on April 15, 2005, 05:15:40 am
Did you try what I suggested?
Title: Re: Reset views in an album
Post by: ebonyhunter on April 15, 2005, 05:20:00 am
No.  Your warning scared me off.  I dont want to screw anthing up and I dont really understand where you were working.
Title: Re: Reset views in an album
Post by: ebonyhunter on April 15, 2005, 05:24:26 am
"SQL query to run"--I dont know what this means or how to do it.
Title: Re: Reset views in an album
Post by: ebonyhunter on April 15, 2005, 05:38:43 am
I'm guessing you're suggesting editing one of the SQL files, but I dont know which one or where to locate the code you gave.  I've looked at all three of them but cant find anything that resembles what you posted.  If that's all there is to this, then I can easily do that if you could just explain where to find the existing code I need to edit.
Title: Re: Reset views in an album
Post by: kegobeer on April 15, 2005, 05:52:22 am
Use a tool like phpMyAdmin to execute a SQL statement.  There is no editing of files.
Title: Re: Reset views in an album
Post by: ebonyhunter on April 15, 2005, 05:54:32 am
I have no idea what you're talking about.
Title: Re: Reset views in an album
Post by: Tranz on April 15, 2005, 05:57:21 am
Unfortunately, if you don't know what you're doing, you'll have to have someone else do it for you. If no one else will do it for free, you would have to pay them. That's life. I have to pay someone else to do my car oil changes because I don't want to learn how.
Title: Re: Reset views in an album
Post by: ebonyhunter on April 15, 2005, 06:00:45 am
Oh, I want to learn how.  I just need it explained in plain english.  It would help if, instead of telling me to "execute a SQL statement", which I do not understand, you simply said, "go here and do this."  Pretty simple, really.
Title: Re: Reset views in an album
Post by: Tranz on April 15, 2005, 06:08:46 am
kegobeer did tell you where to go... phpmyadmin.
Title: Re: Reset views in an album
Post by: ebonyhunter on April 15, 2005, 06:14:32 am
yes...and do what?  "execute an SQL statement".  What does that mean?  I didnt see anything in phpAdmin that says "execute an SQL statement."
Title: Re: Reset views in an album
Post by: ebonyhunter on April 15, 2005, 06:39:45 am
I guess this is too difficult to be explained simply.  Thanks for your help.  I gotta go change my car oil.
Title: Re: Reset views in an album
Post by: OmegaGOD on April 15, 2005, 06:39:59 am
First back-up your database before attempting this just in case. Using phpMyAdmin, there is an option to execute an SQL statement, ie. the code below.

This will reset the view counter for all the albums in your gallery.
Code: [Select]
UPDATE `cpg11d_pictures` SET `hits` = '0' WHERE `hits` > 0;
This will reset the view counter for a select album. Simply replace *** in the code below with the aid number of the selected album you want to reset. You can get the AID number by looking at the album's URL.
Code: [Select]
UPDATE `cpg11d_pictures` SET `hits` = '0' WHERE `aid` = ***;

I guess this is too difficult to be explained simply. Thanks for your help. I gotta go change my car oil.
Actually, it was explained simply earlier in this thread.

Hope this helps,
--OmegaGOD
Title: Re: Reset views in an album
Post by: ebonyhunter on April 15, 2005, 06:41:47 am
I saw that in the explanation above.  I dont know where this is done.
Title: Re: Reset views in an album
Post by: OmegaGOD on April 15, 2005, 06:53:28 am
I've explained it as clearly as I could. If you are not sure how to utilize phpMyAdmin, then I would suggest finding someone who does.

Launch phpMyAdmin
In the left hand side of the screen, select the CPG database from the drop down menu
Click on the SQL tab from the top menu
Enter the SQL queries I supplied you from my previous post into the box that says "Run SQL query/queries on database"

This is step-by-step and as elementary as it gets. I would highly recommend that you find someone who is familiar with phpMyAdmin and mySQL databases to do this for you since you clearly don't understand what a SQL query is.
Title: Re: Reset views in an album
Post by: ebonyhunter on April 15, 2005, 06:56:33 am
Perhaps you could tell me where "phpMyAdmin" is located?  Is it the Admin Tools link when I'm in Admin Mode? Or somewhere else?  Perhaps that's part of my prolem.  I cant find phpMyAdmin.  Remeber, I'm using CPG 1.3
Title: Re: Reset views in an album
Post by: Joachim Müller on April 15, 2005, 07:00:31 am
phpMyAdmin is not a part of coppermine. It's another server-driven app written in PHP. Either your webhost has installed it for you (many have), or you have to download and install it. Get it from http://www.phpmyadmin.net/ .

Joachim

P.S. Google is your friend
Title: Re: Reset views in an album
Post by: OmegaGOD on April 15, 2005, 07:00:59 am
phpMyAdmin is not part of CPG. It is a set of PHP scripts to modify mySQL databases. Check with your web-host to see if it is included with your hosting plan.
Title: Re: Reset views in an album
Post by: Tranz on April 15, 2005, 07:02:30 am
Funny how similar your replies are. :D
Title: Re: Reset views in an album
Post by: OmegaGOD on April 15, 2005, 07:05:48 am
 ;D Looks like GauGau beat me to the post by 28 seconds.  ;)
Title: Re: Reset views in an album
Post by: ebonyhunter on April 15, 2005, 07:06:03 am
Now you may understand why I'm confused.  Nobody bothered to mention that until now and just assumed I knew that, which I did not.  I've been searching Coppermine for phpmyadmin for 45 minutes.
Title: Re: Reset views in an album
Post by: Joachim Müller on April 15, 2005, 07:13:34 am
Funny how similar your replies are. :D
Yeah, it's amazing. ;D
I think we've been holding ebonyhunter's hand long enough on this thread - if you (E.H.) still can't manage to solve this on your own, I suggest you wait for cpg1.4.x to be released. After all, newbies shouldn't be messing directly with the database, and it's obvious that ebonyhunter is not a mysql expert yet. As a side-note: before running queries on phpMyAdmin, it's strongly recommended to do a backup (dump) of the database. Those little queries (even if the appear to be "innocent") can wreak havoc on your coppermine install if not done properly (especially if you have no idea what you're doing).

You say
Now you may understand why I'm confused. Nobody bothered to mention that until now and just assumed I knew that, which I did not. I've been searching Coppermine for phpmyadmin for 45 minutes.
although just some postings above you said
yes...and do what? "execute an SQL statement". What does that mean? I didnt see anything in phpAdmin that says "execute an SQL statement."
-> this suggested that you already had phpMyAdmin, don't you think.

Joachim
Title: Re: Reset views in an album
Post by: ebonyhunter on April 15, 2005, 07:21:01 am
No. it merely meant that where I was looking...which was in CPG Admin Tools....there wasnt anything about "executing an SQL Statement".  And in my version of phpmyadmin, which I've located now, I dont see that option either.

And you're correct.  I'm not an SQL expert or even an intermediate.  I have no problem admitting that.  If this is an advanced function, I shouldn't be messing around with it, which is what I said with my initial inquiry.
Title: Re: Reset views in an album
Post by: Tranz on April 15, 2005, 07:27:11 am
Yeah, one of the things on the to do list is to enable sql statement execution from within cpg's admin tools. Would make things a lot easier. Though there is the danger in making it easier to do damage. :-\\
Title: Re: Reset views in an album
Post by: ebonyhunter on April 15, 2005, 07:36:16 am
I can suggest something far easier.  Just have a button somewhere that says "Reset All Image Views to 0" and when you click on it, it resets all of them to zero.

Sound easy?

Actually, I found CPG to be an oustanding and very user-friendly tool, even for elementary dunderheads like me.  I have no complaints.  And because its so great, I just ASSUMED there was a simple button to hit to reset everything.  See what happens when you make a great product?  We just assume it MUST do anything we want on demand.

Not always the case, as this example proved.
Title: Re: Reset views in an album
Post by: Tranz on April 15, 2005, 07:40:00 am
Well, yes, we could do that. But we also have to decide how many people will benefit from features we add. I don't think majority of users want to reset their views to 0; they would want to have increasing view counts. If we have too many features, it becomes overwhelming and cluttered. It also increases chances for bugs.
Title: Re: Reset views in an album
Post by: Joachim Müller on April 15, 2005, 08:11:38 am
erm, may I remind you what thread you're in: the request for a "reset all views" button is what this thread is all about, and I posted (although on page 1 of the thread) that the feature will be there in the next version (cpg1.4.x), along with a screenshot. I think it was Nibbler who pointed out that this option exists in the admin tools of version cpg1.4.x as well ("Reset view counters"), and you can choose there what album to apply this for, or even the whole gallery.
So what you're suggesting has already been discussed and even implemented by the dev team, there's no point in further suggesting those features. If you can't wait for cpg1.4.x to be released, you're welcome to get a copy of it right now and play with it (although I have to remind everybody that it's not yet recommended for production sites and comes without support).

Joachim