Advanced search  

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]

Pages: [1] 2   Go Down

Author Topic: Edit thumbnails  (Read 9768 times)

0 Members and 1 Guest are viewing this topic.

NewYorkIslander10

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 28
Edit thumbnails
« on: January 02, 2016, 10:02:24 am »

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
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15760
Re: Edit thumbnails
« Reply #1 on: January 08, 2016, 04:39:09 pm »

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

NewYorkIslander10

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 28
Re: Edit thumbnails
« Reply #2 on: January 09, 2016, 06:03:15 pm »

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

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15760
Re: Edit thumbnails
« Reply #3 on: January 09, 2016, 09:58:00 pm »

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?

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

NewYorkIslander10

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 28
Re: Edit thumbnails
« Reply #4 on: January 12, 2016, 07:16:33 pm »

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

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15760
Re: Edit thumbnails
« Reply #5 on: January 12, 2016, 07:52:05 pm »

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

NewYorkIslander10

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 28
Re: Edit thumbnails
« Reply #6 on: January 13, 2016, 04:02:43 am »

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

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15760
Re: Edit thumbnails
« Reply #7 on: January 13, 2016, 04:32:39 pm »

Set number:
Code: [Select]
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:
Code: [Select]
UPDATE cpg15x_pictures SET hits = hits + 123 WHERE aid = 7
Multiply:
Code: [Select]
UPDATE cpg15x_pictures SET hits = hits * 123 WHERE aid = 7
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15760
Re: Edit thumbnails
« Reply #8 on: January 13, 2016, 04:55:25 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
Code: [Select]
WHERE aid = 7in the above queries.
Logged

NewYorkIslander10

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 28
Re: Edit thumbnails
« Reply #9 on: January 14, 2016, 02:34:29 am »

I edit this in php admin?
Logged

NewYorkIslander10

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 28
Re: Edit thumbnails
« Reply #10 on: January 14, 2016, 03:39:09 am »

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

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15760
Re: Edit thumbnails
« Reply #11 on: January 14, 2016, 11:06:40 am »

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

gmc

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 785
    • GMC Design Photo Gallery
Re: Edit thumbnails
« Reply #12 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.
Logged
Thanks!
Greg
My Coppermine Gallery
Need a web hosting account? See my gallery for an offer for CPG Forum users.
Send me money

NewYorkIslander10

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 28
Re: Re: Edit thumbnails
« Reply #13 on: January 14, 2016, 04:06:08 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 :)
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15760
Re: Edit thumbnails
« Reply #14 on: January 14, 2016, 08:33:11 pm »

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

NewYorkIslander10

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 28
Re: Edit thumbnails
« Reply #15 on: January 15, 2016, 01:45:50 am »

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

Phill Luckhurst

  • Administrator
  • Coppermine addict
  • *****
  • Country: gb
  • Offline Offline
  • Gender: Male
  • Posts: 4822
    • Windsurf.me
Re: Edit thumbnails
« Reply #16 on: January 15, 2016, 12:41:43 pm »

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

NewYorkIslander10

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 28
Re: Edit thumbnails
« Reply #17 on: January 16, 2016, 03:44:43 am »

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

Badegakk

  • Coppermine newbie
  • Offline Offline
  • Posts: 15
Re: Edit thumbnails
« Reply #18 on: January 17, 2016, 02:44:52 pm »

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

Phill Luckhurst

  • Administrator
  • Coppermine addict
  • *****
  • Country: gb
  • Offline Offline
  • Gender: Male
  • Posts: 4822
    • Windsurf.me
Re: Edit thumbnails
« Reply #19 on: January 17, 2016, 09:35:54 pm »

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.
Logged
It is a mistake to think you can solve any major problems just with potatoes.
Pages: [1] 2   Go Up
 

Page created in 0.057 seconds with 21 queries.