Enable View counter for admins only? Enable View counter for admins only?
 

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]

Main Menu

Enable View counter for admins only?

Started by beerguzzler, March 05, 2007, 09:20:50 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

beerguzzler

Hi,

I realise you can turn the View counter off/on in the Thumbnail view config, but is it possible to be able to enable it for admins, whilst disabling it for regular users?

Many thanks.

Nibbler

Modify include/init.inc.php

find


// Reference 'site_url' to 'ecards_more_pic_target'
$CONFIG['site_url'] =& $CONFIG['ecards_more_pic_target'];


after it, add


$CONFIG['views_in_thumbview'] = GALLERY_ADMIN_MODE ? '1' : '0';

beerguzzler

Thanks, but all that seems to do is set "Display number of views below the thumbnail" to Yes

Maybe that's my fault. I don't actually have a user base, I've disabled the function for Guests to create accounts.

So my original question should of been, is it possible to disable View counter for Guests but keep active for admins?

Sorry for any mix up. :-[

Nibbler


beerguzzler

On the Thumbnail view. At present when anyone goes to the gallery it doesn't display how many times that image has been viewed. This is exactly what I want. I just wondered if it's then possible to be able to show how many times that image has been viewed once I log in as the administrator?

Nibbler

I see. The code needs to go under here, not where I said before.


// Test if admin mode
$USER['am'] = isset($USER['am']) ? (int)$USER['am'] : 0;
define('GALLERY_ADMIN_MODE', USER_IS_ADMIN && $USER['am']);
define('USER_ADMIN_MODE', USER_ID && USER_CAN_CREATE_ALBUMS && $USER['am'] && !GALLERY_ADMIN_MODE);


I should really have tested it first.

beerguzzler