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]   Go Down

Author Topic: Random Views Below Image?  (Read 2245 times)

0 Members and 1 Guest are viewing this topic.

irene

  • Coppermine newbie
  • Offline Offline
  • Posts: 5
Random Views Below Image?
« on: August 21, 2012, 07:31:06 pm »

Hi,

I need random views below images in my gallery.
How do I do this?

For example each pic will show a number from 100 to 5000

I had it before on an older version and would like it again.

Thanks in advance.
Logged

Jeff Bailey

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 1322
  • Fishing relaxes me.
    • Bailey Family Co.
Re: Random Views Below Image?
« Reply #1 on: August 21, 2012, 10:44:09 pm »

Can you give a little more detail as to what you want to accomplish?

Do you just want any random number under thumbnails? or the view count of the image?

If you had it before do you have a copy of the code you can post here?
« Last Edit: August 21, 2012, 11:05:22 pm by Jeff Bailey »
Logged
Thinking is the hardest work there is, which is probably the reason why so few engage in it. - Henry Ford

irene

  • Coppermine newbie
  • Offline Offline
  • Posts: 5
Re: Random Views Below Image?
« Reply #2 on: August 22, 2012, 02:15:14 pm »

Logged

Jeff Bailey

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 1322
  • Fishing relaxes me.
    • Bailey Family Co.
Re: Random Views Below Image?
« Reply #3 on: August 22, 2012, 07:33:31 pm »

This does not update the database. So it does not show in the file information section. It also does not update the album views. I don't have the time to search though all the files and find the correct places to up date but here is a solution that shows a random number of views under the thumbnails.

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
Thinking is the hardest work there is, which is probably the reason why so few engage in it. - Henry Ford

irene

  • Coppermine newbie
  • Offline Offline
  • Posts: 5
Re: Random Views Below Image?
« Reply #4 on: August 23, 2012, 01:22:52 pm »

Thanks a million. That's all I wanted!
Logged
Pages: [1]   Go Up
 

Page created in 0.017 seconds with 16 queries.