Support > cpg1.5 plugins

Who Is Online Plugin

(1/1)

abbyleesprinkles:
Is there any cpg1.5.x Who Is Online plugin?

allvip:
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

Ludger:
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...

ron4mac:

--- Quote from: Ludger on January 03, 2018, 12:12:13 am ---Is there a good reason for setting the constant PLUGINMGR_PHP to true all the times in codebase.php, line 20?

--- End quote ---
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: ---// note whether we are being called from the plugin manager
$h5ss_ipm = function_exists('display_plugin_list');

--- End code ---
Alternatively:

--- Code: ---global $CPG_PHP_SELF;
$in_pm = (pathinfo($CPG_PHP_SELF, PATHINFO_BASENAME) == 'pluginmgr.php');

--- End code ---

Ludger:
Thank you, Ron.
Option 2 helped...

Navigation

[0] Message Index

Go to full version