forum.coppermine-gallery.net

Support => cpg1.5.x Support => cpg1.5 miscellaneous => Topic started by: NewYorkIslander10 on January 02, 2016, 10:02:24 am

Title: Edit thumbnails
Post by: NewYorkIslander10 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
Title: Re: Edit thumbnails
Post by: Αndré 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)?
Title: Re: Edit thumbnails
Post by: NewYorkIslander10 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.
Title: Re: Edit thumbnails
Post by: Αndré 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.
Title: Re: Edit thumbnails
Post by: NewYorkIslander10 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?
Title: Re: Edit thumbnails
Post by: Αndré 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?
Title: Re: Edit thumbnails
Post by: NewYorkIslander10 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?
Title: Re: Edit thumbnails
Post by: Αndré 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
Title: Re: Edit thumbnails
Post by: Αndré 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.
Title: Re: Edit thumbnails
Post by: NewYorkIslander10 on January 14, 2016, 02:34:29 am
I edit this in php admin?
Title: Re: Edit thumbnails
Post by: NewYorkIslander10 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.
Title: Re: Edit thumbnails
Post by: Αndré on January 14, 2016, 11:06:40 am
Yes, you need to run that query with e.g. phpMyAdmin.
Title: Re: Edit thumbnails
Post by: 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.
Title: Re: Re: Edit thumbnails
Post by: NewYorkIslander10 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 :)
Title: Re: Edit thumbnails
Post by: Αndré 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.
Title: Re: Edit thumbnails
Post by: NewYorkIslander10 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.
Title: Re: Edit thumbnails
Post by: phill104 on January 15, 2016, 12:41:43 pm
So you want a false representation of how many visitors are visiting your site?
Title: Re: Edit thumbnails
Post by: NewYorkIslander10 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.
Title: Re: Edit thumbnails
Post by: Badegakk 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.
Title: Re: Edit thumbnails
Post by: phill104 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.
Title: Re: Edit thumbnails
Post by: NewYorkIslander10 on January 19, 2016, 06:48:19 pm
Will anyone be able to help with this? The script? I tried being clear as possible.
Title: Re: Edit thumbnails
Post by: Αndré on January 19, 2016, 10:10:54 pm
I've already told you in two threads how to manipulate the views in your gallery. You asked for a script, but still haven't told us what exactly it should do.
Title: Re: Edit thumbnails
Post by: NewYorkIslander10 on January 20, 2016, 01:04:01 am
I'd want the script to help double or multiply thumbnail views and of possible album views. Also what you told me to do I wasn't sure how to do it. I went to php admin and I wasn't sure where to go to put the code you had given me I'm a newbie.
Title: Re: Edit thumbnails
Post by: phill104 on January 20, 2016, 11:48:11 am
The method Andre outlined in one of your two other threads about the same task is not done in PHPmyadmin, but using a normal text editor and your ftp package. You download your index.php file, make the modifications then re-upload it.

It won't change with the current mod. If you want to add or multiply the actual views, undo the last mod. Instead, find
Code: [Select]
            $hit_count = (int)$nbEnr[0];and replace with
Code: [Select]
            $hit_count = (int)$nbEnr[0];
            $hit_count = $hit_count + 1234;
The above will add 1234 to whatever the hit count currently is, you can change the 1234 to whatever value you wish.

or us this code to multiply the hit count by your selected value, in this case *2 which you can change to whatever you wish
Code: [Select]
            $hit_count = (int)$nbEnr[0];
            $hit_count = $hit_count * 2;
Title: Re: Re: Edit thumbnails
Post by: NewYorkIslander10 on January 21, 2016, 09:51:37 am
The method Andre outlined in one of your two other threads about the same task is not done in PHPmyadmin, but using a normal text editor and your ftp package. You download your index.php file, make the modifications then re-upload it.

I did just that and nothing happened :(
Title: Re: Edit thumbnails
Post by: NewYorkIslander10 on January 21, 2016, 09:54:31 am
If this helps I was referring to having something done like this --> http://forum.coppermine-gallery.net/index.php?topic=51863.0

I tried that it didn't work then I noticed it was for cpg14x
Title: Re: Edit thumbnails
Post by: Αndré on January 21, 2016, 09:58:49 am
I'll have a look at that script and make if compatible with cpg1.5.x (if needed), if that's what you're actually looking for.
Title: Re: Re: Edit thumbnails
Post by: NewYorkIslander10 on January 22, 2016, 03:32:52 am
I'll have a look at that script and make if compatible with cpg1.5.x (if needed), if that's what you're actually looking for.

Thanks I will appreciate it.
Title: Re: Edit thumbnails
Post by: Αndré on January 22, 2016, 02:19:50 pm
http://forum.coppermine-gallery.net/index.php/topic,51863.msg380719.html#msg380719
Title: Re: Edit thumbnails
Post by: NewYorkIslander10 on January 28, 2016, 06:38:09 am
Thank you. Solved