[Solved]: Onlinestats only for admins [Solved]: Onlinestats only for admins
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

[Solved]: Onlinestats only for admins

Started by paquets, May 17, 2010, 04:11:53 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

paquets

Hi,

I was wondering if it is possible to have the Onlinestats black only visible to admins. I managed to do it on CPG 1.4.x but for some reason in CPG 1.5 it leaves registered users and guests with an empty block with the mention "No image to display"

Code changed in CPG 1.5:

From:

function online_mainpage()
{
       global $CONFIG, $cpg_udb, $matches, $lang_plugin_php, $lang_date, $LINEBREAK;
       if($matches[1] != 'onlinestats') {
         return $matches;
       }


To:
function online_mainpage()
{
       global $CONFIG, $cpg_udb, $matches, $lang_plugin_php, $lang_date, $LINEBREAK;
       if($matches[1] != 'onlinestats' || !GALLERY_ADMIN_MODE) {
         return $matches;
       }


URL for my testbed: adpharm.net/cpg15

Thank you and great job with 1.5!

paquets

Forgot to mention that the code changed is in the file codebase.php

Αndré

Works for me as expected. Can you please perform an svn checkout of Coppermine's core files and try again? I assume it's related to that issue.

paquets

It worked. Just has to download the latest functions.inc.php.
Thanks André!