Onlinestats and CPGOcat together: doubled output Onlinestats and CPGOcat together: doubled output
 

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

Onlinestats and CPGOcat together: doubled output

Started by ralfs, August 29, 2006, 03:41:59 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

ralfs

Hi,

If you are using both, Nibbler's statistics plugin and Paver's Orderable Category List plugin together, Coppermine could mess up the output page:

If the index page shows the category list twice and the online stats twice (underneath eachother), you have to change the position of the plugins in the plugin manager: the online stats have to be placed above the CPGOcat plugin. That's all :-)

Regards,
Ralf

Paver

Are you sure?  I just tested it on my testbed gallery with only those two plugins, and I don't see doubled output, no matter which plugin is on top.

It is true in general that if a plugin is not written correctly, the order of the plugin with respect to other plugins might be important.  So if you do have this issue, it would be useful to fix the offending plugin.

Please post information about your Coppermine version, plugin versions (for both), and any other plugins you might have installed (along with any mods/hacks you have applied).

ralfs

#2
Hi Paver,

Here are my plugins. Normally I have more activated, but in my configuration it is definitely these two causing the mess:

[edit GauGau]replaced hotlinked pic with attachment "plugs.gif"[/edit]

The output is funny:

[edit GauGau]replaced hotlinked pic with attachment "out.gif"[/edit]

My main page content is "breadcrumb/catlist/alblist/onlinestats"

On a first, rough look, I thought, the first is the patched catlist with the summary and below is the 'original table'. But this is not true because both tables show the right summary numbers.

And believe me: if I change the sort order and put the stats on top, it works.

I have 1.4.8 installed - together with some really small mods (prev/next tab, changed login.php, included 'Add to favorites' to the icon bar in displayimage.php), but nothing in index.php

I'll try to install a naked 1.4.9 together with the two plugins and then restore my mods one after the other.

Regards,
Ralfs

ralfs

Hello again,

I duplicated my /cpg directory and replaced everything but my theme and the config.inc.php with original v1.4.9 files. Result: the same.
Then I tried theme 'Classic' and 'iGames'. Result: the same.

Then I made some tests on the plugin sort order and I got interesting results:
1. If OCat is above Stats, the category list gets doubled. It doesn't matter if there is another plugin between the two.
2. If Stats is the last plugin in the list, the statistics gets doubled. But only, if OCat is active.

I have tested that behaviour with three and with four activated plugins ('Search albums' and 'Special Edit')

Regards,
Ralf

Paver

Thanks for the detailed report.  It turns out that I was using a version of onlinestats called "1.2 (working with mods by Paver)".  I thought my mods were just simple display-type mods (that I did when assisting users in the plugin support thead).

Well, something is very strange indeed.  My modded plugin has a different folder name, and is missing certain header and comments that makes me think somehow I didn't start with the 1.2 version that is publicly available here.  I must have created my own 1.2 version and didn't download the 1.2 version released thinking it was the same as mine.

In any case, here's the relevant code you need to change.

Look for the following three lines:
function online_mainpage()
{
        global $CONFIG, $cpg_udb, $comment_date_fmt, $matches ;

Replace them with these three lines:
function online_mainpage($matches)
{
        global $CONFIG, $cpg_udb, $comment_date_fmt ;


Let me know if this works for you.  I reproduced your issue on my testbed, then made the change, and it fixed the issue, so it should work.

I've been rather hands-off about the onlinestats plugin, just adding comments here & there, and not really looking at it carefully.  I'll check it out and make sure there aren't any other issues before helping to release version 1.3 of that plugin.

ralfs

Yeah, that was it!

Many thanks for the fast help - it's great fun to be part of such an active and motivated community.

Regards,
Ralf

natrlhy

I had a similar issue where only 1 registered user was logged in but the onlinestats (v1.7) displayed 2 logged in. Making the changes listed below worked for my situation as well:

old code:

function online_mainpage()
{
        global $CONFIG, $cpg_udb, $matches, $lang_plugin_onlinestats, $lang_plugin_onlinestats_date_fmt ;


new code:

function online_mainpage($matches)
{
        global $CONFIG, $cpg_udb, $lang_plugin_onlinestats, $lang_plugin_onlinestats_date_fmt ;