forum.coppermine-gallery.net
Support => cpg1.5.x Support => cpg1.5 miscellaneous => Topic started 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
-
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)?
-
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.
-
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.
-
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?
-
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?
-
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?
-
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
-
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.
-
I edit this in php admin?
-
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.
-
Yes, you need to run that query with e.g. phpMyAdmin.
-
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.
-
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 :)
-
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.
-
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.
-
So you want a false representation of how many visitors are visiting your site?
-
I believe I stated what I'd like to accomplish. I tried being clear sorry if you don't get what I meant.
-
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.
-
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.
-
Will anyone be able to help with this? The script? I tried being clear as possible.
-
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.
-
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.
-
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
$hit_count = (int)$nbEnr[0];
and replace with
$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
$hit_count = (int)$nbEnr[0];
$hit_count = $hit_count * 2;
-
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 :(
-
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
-
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.
-
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.
-
http://forum.coppermine-gallery.net/index.php/topic,51863.msg380719.html#msg380719
-
Thank you. Solved