Edit thumbnails Edit thumbnails
 

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

Edit thumbnails

Started by NewYorkIslander10, January 02, 2016, 10:02:24 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

NewYorkIslander10

Is there a code to just change the thumbnail views only and not the entire albums hits? Any help is appreciated thanks! ;D


I followed Jeff Baileys instructions here:

Find in include/functions.inc.php
Code: [Select]
            $views = ($mode == 'albums') ? $row['alb_hits'] : $row['hits'];
and replace with
Code: [Select]
            //$views = ($mode == 'albums') ? $row['alb_hits'] : $row['hits'];
            $views = mt_rand(300,1000);

It should be located in the function build_caption()
Logged

Αndré

Am I correct, that you want to display a random number (random on each page refresh) as picture views below each picture? If so, where exactly should it be changed (thumbnail view, intermediate-sized view)? Should the meta album "Most viewed" consider the random views and order be pictures accordingly (which will be exactly the same as the "Random" meta album)?

NewYorkIslander10

I meant just the thumbnail view I know you can change the album hits in php admin but I'd like to change the thumbnail with number from 1-30 when I used Jeff code it didn't do that.

Αndré

The code from Jeff actually doesn't change the view counter itself, but just displays a random number as view counter. What exactly do you try to accomplish?

Quote from: NewYorkIslander10 on January 09, 2016, 06:03:15 PM
I know you can change the album hits in php admin but I'd like to change the thumbnail with number
This can also be done with a tool like phpMyAdmin. Just have a look at the "pictures" table.

NewYorkIslander10

Thank you I did that is there a way I can edit all the photos in the entire album instead of searching each picture file name one by one?

Αndré

The answer is probably yes, with an appropriate SQL query. But as you still haven't told us what exactly you want to do, I cannot post a more detailed answer. Do you want to set/update the view counter of each picture with a specific number? Or do you want to add/multiply the current views?

NewYorkIslander10

I'd like to set up the view counter with a specific number, but can you tell me how to do it both ways? If I choose to add/multiply views?

Αndré

Set number:
UPDATE cpg15x_pictures SET hits = 123 WHERE aid = 7
(don't forget to adjust the table prefix "cpg15x_" and the values for hits and aid).

Add number:
UPDATE cpg15x_pictures SET hits = hits + 123 WHERE aid = 7

Multiply:
UPDATE cpg15x_pictures SET hits = hits * 123 WHERE aid = 7

Αndré

Quote from: NewYorkIslander10 on January 12, 2016, 07:16:33 PM
is there a way I can edit all the photos in the entire album

If you want to edit all pictures in the entire gallery, just omit
WHERE aid = 7
in the above queries.

NewYorkIslander10

I edit this in php admin?

NewYorkIslander10

I'm a newbie so could you try explain a bit more detailed I have been reading the Coppermine manual to get a better understanding of everything.

Αndré

Yes, you need to run that query with e.g. phpMyAdmin.

gmc

phpMyAdmin is a common tool webhosting providers make available as part of their hosting accounts. It allows (among other things) issuing SQL against your tables like what Andre provided.

Alternately you could write a php script to do the same...

As I still can't determine what you are trying to do - or if this will be a 'one time change' or used ongoing - hard to recommend a specific solution.
Thanks!
Greg
My Coppermine Gallery
Need a web hosting account? See my gallery for an offer for CPG Forum users.
Send me money

NewYorkIslander10

Quote from: gmc on January 14, 2016, 02:22:23 PM
phpMyAdmin is a common tool webhosting providers make available as part of their hosting accounts. It allows (among other things) issuing SQL against your tables like what Andre provided.

Alternately you could write a php script to do the same...

As I still can't determine what you are trying to do - or if this will be a 'one time change' or used ongoing - hard to recommend a specific solution.

Ongoing :)

Αndré

If you want to manipulate the view counters continuously (for whatever reason), a script might be the better solution. Unfortunately you still haven't told us what exactly you want to accomplish, so it's impossible to create that script for you.

NewYorkIslander10

I thought I stated what i wanted to accomplish? For example like the plugin edit pic views I'd like to do that to my thumbnails where it would automatically double or multiply the views on it's own.

phill104

So you want a false representation of how many visitors are visiting your site?
It is a mistake to think you can solve any major problems just with potatoes.

NewYorkIslander10

I believe I stated what I'd like to accomplish. I tried being clear sorry if you don't get what I meant.

Badegakk

Many fansites want to fake views. Don't be hard on her / him. When you have a new fansite it doesn't look good to have 203 views in the gallery with 0 views on thousands of pictures.

phill104

Not trying to be hard on anyone here, just trying to understand the reasons and what is needed. Whenever I have started a new gallery as long as people realise it is new I see no issue with having low hit counts. It is always part of the joy to see people's appreciation of a site as the hit count increases. A tiny bit of promotion in the right way and suddenly a busy site exists with no need for such manipulation.
It is a mistake to think you can solve any major problems just with potatoes.