Advanced search  

News:

cpg1.5.46 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter recently discovered vulnerabilities. It is important that all users who run version cpg1.5.44 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: Who Is Online Plugin  (Read 3216 times)

0 Members and 1 Guest are viewing this topic.

abbyleesprinkles

  • Coppermine newbie
  • Offline Offline
  • Posts: 1
Who Is Online Plugin
« on: May 10, 2015, 12:38:59 am »

Is there any cpg1.5.x Who Is Online plugin?
Logged

allvip

  • Global Moderator
  • Coppermine addict
  • *****
  • Country: 00
  • Offline Offline
  • Posts: 1290
Re: Who Is Online Plugin
« Reply #1 on: May 10, 2015, 06:11:58 pm »

It already comes with coppermine (is in the plugins folder of your coppermine).
Go to Config - Plugin manager and enable it then go to Config expand Album list view - the content of the main page and add onlinestats like this "breadcrumb/catlist/alblist/onlinestats" or similar.

Default plugins, how to enable, install etc http://documentation.coppermine-gallery.net/en/plugins.htm
The content of the main page http://documentation.coppermine-gallery.net/en/configuration.htm#admin_album_list_content

BTW the sample plugin from the plugins folder of your coppermine is just a sample in case you want to create a plugin for coppermine. It is just meant to demonstrate what plugins can do and how to code them http://documentation.coppermine-gallery.net/en/plugins.htm#plugin_bundled_sample
« Last Edit: May 10, 2015, 06:30:20 pm by allvip »
Logged

Ludger

  • Contributor
  • Coppermine novice
  • ***
  • Offline Offline
  • Posts: 23
Re: Who Is Online Plugin
« Reply #2 on: January 03, 2018, 12:12:13 am »

I have a technical question concerning this plugin: Is there a good reason for setting the constant PLUGINMGR_PHP to true all the times in codebase.php, line 20?

if (!defined('PLUGINMGR_PHP')) {
    define('PLUGINMGR_PHP', true);

If I am not totally wrong, this defies the purpose of that constant. Other plugins cannot detect anymore if they are in Pluginmanager-Screen. The constant is always on. I cannot see the constant PLUGINMGR_PHP being used anywhere in that plugin except the language files...
Logged

ron4mac

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Posts: 924
Re: Who Is Online Plugin
« Reply #3 on: January 03, 2018, 01:06:30 am »

Is there a good reason for setting the constant PLUGINMGR_PHP to true all the times in codebase.php, line 20?
It is just for the language file(s) to be loaded. I had the same problem thinking I could use that to determine if I was being called by the plugin manager.
http://forum.coppermine-gallery.net/index.php/topic,75994.msg382158.html#msg382158
The truth is, that define (and others like it) was not designed to declare that a certain PHP script is loaded ... only that the language files need to be loaded.

I got around the issue by setting a flag for myself if some specific function from that manager is present:
Code: [Select]
// note whether we are being called from the plugin manager
$h5ss_ipm = function_exists('display_plugin_list');
Alternatively:
Code: [Select]
global $CPG_PHP_SELF;
$in_pm = (pathinfo($CPG_PHP_SELF, PATHINFO_BASENAME) == 'pluginmgr.php');
« Last Edit: January 03, 2018, 03:30:18 pm by ron4mac »
Logged

Ludger

  • Contributor
  • Coppermine novice
  • ***
  • Offline Offline
  • Posts: 23
Re: Who Is Online Plugin
« Reply #4 on: January 04, 2018, 05:15:11 pm »

Thank you, Ron.
Option 2 helped...
Logged
Pages: [1]   Go Up
 

Page created in 0.017 seconds with 21 queries.