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: don't increment view counter from admin user  (Read 6208 times)

0 Members and 1 Guest are viewing this topic.

claxxical

  • Coppermine newbie
  • Offline Offline
  • Posts: 3
don't increment view counter from admin user
« on: July 06, 2004, 06:10:00 pm »

I've checked but I haven't seen an option to ignore picture views when logged into the admin account...I don't want to increment my counters when I'm doing admin stuff.....Thanks!
« Last Edit: September 16, 2004, 05:41:53 am by GauGau »
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: don't increment view counter from admin user
« Reply #1 on: July 06, 2004, 06:29:00 pm »

this option hasn't been implemented yet. Will be considered for future versions.

GauGau
Logged

cryogenic

  • Tester
  • Coppermine regular visitor
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 79
    • the cynic says...
Re: don't increment view counter from admin user
« Reply #2 on: July 15, 2004, 04:40:06 am »

I second that one... I'm constantly toying around with my gallery and hate that it increments the view counter when I view a pic. I'd like to see that make it into 1.4. 
Logged

RatKing

  • Contributor
  • Coppermine regular visitor
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 85
    • Personal website
Re: don't increment view counter from admin user
« Reply #3 on: July 16, 2004, 01:07:34 pm »

A very quick and dirty solution to this would be to do the following.

In file: displayimage.php

Replace
   
Code: [Select]
if ($album != "lasthits" && !in_array($pid, $USER['liv']) && isset($HTTP_COOKIE_VARS[$CONFIG['cookie_name'] . '_data'])) {
   
Code: [Select]
if (!USER_IS_ADMIN && $album != "lasthits" && !in_array($pid, $USER['liv']) && isset($HTTP_COOKIE_VARS[$CONFIG['cookie_name'] . '_data'])) {
And all should be fine (haven't tested it but I am pretty sure it works) as I said it is a diry little trick but the simplest way of doing it.
Logged

Tarique Sani

  • VIP
  • Coppermine addict
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 2712
    • http://tariquesani.net
Re: don't increment view counter from admin user
« Reply #4 on: July 16, 2004, 01:17:56 pm »

I second RatKing's solution - simplest way to do it
Logged
SANIsoft PHP applications for E Biz

cryogenic

  • Tester
  • Coppermine regular visitor
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 79
    • the cynic says...
Re: don't increment view counter from admin user
« Reply #5 on: September 13, 2004, 10:13:27 am »

Tested it... works great. Thanks!
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: don't increment view counter from admin user
« Reply #6 on: September 13, 2004, 10:23:59 am »

@devs: Should we add this to the devel code?

Joachim
Logged

Tranz

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Female
  • Posts: 6149
Re: don't increment view counter from admin user
« Reply #7 on: September 13, 2004, 10:27:05 am »

This was a great suggestion and solution! :) I also minimized viewing my images because I didn't want to inflate the view counter.
Logged

cryogenic

  • Tester
  • Coppermine regular visitor
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 79
    • the cynic says...
Re: don't increment view counter from admin user
« Reply #8 on: September 13, 2004, 10:27:38 am »

oh, by the way... I tested it on the 1.4 CVS I downloaded about a week or so ago. I've not bothered to download the latest CVS which appears to be about 4 days old. But I can verify that it does work as expected on 1.4. No idea about 1.3 though.
Logged

kegobeer

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 4637
  • Beer - it does a body good!
    • The Kazebeer Family Website
Re: don't increment view counter from admin user
« Reply #9 on: September 13, 2004, 04:45:12 pm »

@Joachim: Yes, add it to devel.
Logged
Do not send me a private message unless I ask for one.  Make your post public so everyone can benefit.

There are no stupid questions
But there are a LOT of inquisitive idiots

Nibbler

  • Guest
Re: don't increment view counter from admin user
« Reply #10 on: September 16, 2004, 01:39:07 am »

committed @ devel displayimage.php v.1.61
Logged

cryogenic

  • Tester
  • Coppermine regular visitor
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 79
    • the cynic says...
Re: don't increment view counter from admin user
« Reply #11 on: September 22, 2004, 02:55:14 am »

*heads over to CVS* :P
Logged
Pages: [1]   Go Up
 

Page created in 0.025 seconds with 21 queries.