forum.coppermine-gallery.net

Support => cpg1.4.x Support => Older/other versions => cpg1.4 plugins => Topic started by: turbozutek on January 14, 2006, 12:51:42 pm

Title: Online stats that work?
Post by: turbozutek on January 14, 2006, 12:51:42 pm
Hello all!!

I've been reading this thread:

http://forum.coppermine-gallery.net/index.php?topic=5373.0

And there was some mention of this being released as a plugin. Now, I downloaded the 'plugin' which includes a folder called 'online' - I uploaded this to my plugin dir and set the permissions and... Nothing... CPG doesn't recognise it as a plugin.

Fine, I tried to 'upload' it using the plugin manager: again, doesn't work. No error except 'this is not a plugin'.

My question is this - is there a final, working version of this plugin available somewhere that doesn't involve reading 17 pages of thread, to end up with a non working plugin?

Many, many thanks!

Chris...
Title: Re: Online stats that work?
Post by: Paver on January 14, 2006, 05:39:13 pm
What, so you don't want to read 17 pages of a thread?  If you use the print option, it's pretty easy to scroll through one page of posts.

It's pretty selfish to post a new thread regarding an existing one just because it's difficult to read it.  What's next: anarchy?

I'm assuming an admin will merge this thread into the existing one, so I might as well give a simple response which might fix your problem.  I don't know this mod/plugin very well, but I do see that the configuration.php is missing from the plugin version.  Copy the sample plugin configuration.php into the online plugin folder and modify it as appropriate (giving Nibbler all due credit of course).  Then the plugin manager should be happy when you install.

Oh, and I realize that you think it would be useful to have a thread here in the plugin forum, but glancing through the existing thread I'm guessing this plugin is not ready for prime time and I'm sure Nibbler will add it here once it is.

Please don't take my comments as being belligerent.  I only mean to be factual in a critical way, with an added spice of cheekiness.
Title: Re: Online stats that work?
Post by: turbozutek on January 15, 2006, 04:01:47 pm
I'll be frank, 17 pages of thread didn't appeal, however I did read them ALL from start to finish - and the end product did not work.

Now that the mod has graduated to becoming a plugin, posting here seemed logical.

I'll try your suggestions and see what happens, thanks!

Chris...
Title: Re: Online stats that work?
Post by: turbozutek on January 15, 2006, 04:39:54 pm
Did that, also copying credits.php to configuration.php seems to have the same result.

Now it installs and shows up as an active plugin !! yay!!!

Next issue ?? Can't get it to display on the front page. I've tried putting 'plugin onlinestats', 'onlinestats' and 'online' and 'stats1' into the config for the front page, each to no avail, as suggested by the thread.

Hmmmm... I'll keep looking at it, but anyone any ideas?

Chris...

Title: Re: Online stats that work?
Post by: Paver on January 15, 2006, 09:11:20 pm
Well, it looks like this plugin is definitely not ready for prime time.  I'm guessing it was written for a previous version of the plugin system before the stable releases of 1.4.2 and 1.4.3; I mostly think this because there is no 'plugin_content' filter in the current core scripts.  I don't have time myself to read that other thread but since you did maybe you can give more information about that.

I modified the plugin to work as I thought it should but I don't know if this was the original intent (since I didn't read that other thread).  I'm sure Nibbler will weigh in sometime.  I'm not about to post the modified files without his OK; I'm sure he would post them here if he thought they were ready.

In codebase.php, modify this line:
Code: [Select]
$thisplugin->add_filter('plugin_content','online_mainpage');to be this:
Code: [Select]
$thisplugin->add_filter('plugin_block','online_mainpage');
Then modify this line:
Code: [Select]
function online_mainpage()to be this:
Code: [Select]
function online_mainpage($matches)
Then just below this line in the function online_mainpage:
Code: [Select]
global $CONFIG, $cpg_udb, $comment_date_fmt ;add this line:
Code: [Select]
if($matches[1] != 'onlinestats') { return $matches; }
Then put 'onlinestats' in your config option for the "content of the main page" wherever you want it.

I think that should do it.  I haven't tested out this plugin thoroughly since I don't plan to use it anytime soon.  (Although I probably will in the future; I just don't have the traffic now to warrant it.)
Title: Re: Online stats that work?
Post by: turbozutek on January 16, 2006, 12:40:41 am
Now that WORKS reallll well!!

Thank you very much! :-D

Chris...
Title: Re: Online stats that work?
Post by: Joachim Müller on January 16, 2006, 07:47:31 am
what plugin are you refering to? Please post a link.
Title: Re: Online stats that work?
Post by: Paver on January 16, 2006, 02:04:13 pm
The one I modified was on page 8 of the thread linked above:
http://forum.coppermine-gallery.net/index.php?topic=5373.msg61641#msg61641 (http://forum.coppermine-gallery.net/index.php?topic=5373.msg61641#msg61641).

As I said, I am not able to test if out fully to see if it works completely.  If someone else does this and says 'yes', we can post the modified version here as a working plugin.  It's Nibbler's of course.  I assumed it would have been discussed and modified in the next 9 pages, but maybe not.  I just don't know.
Title: Re: Online stats that work?
Post by: Joachim Müller on January 16, 2006, 02:39:27 pm
I started a separate thread (http://forum.coppermine-gallery.net/index.php?topic=26532.0) for the online plugin version for cpg1.4.x (which is still experimental, your feedback would be appreciated).
Please post stuff related to the plugin version there, but make sure to read the existing replies to this thread as well.
Title: Re: Online stats that work?
Post by: Paver on January 16, 2006, 03:26:41 pm
The one you posted doesn't work for the current version 1.4.3 as I mentioned above.  It won't install and it has the wrong plugin filter.  Ideally you should make the 4 changes I listed above, summarized here:
Title: Re: Online stats that work?
Post by: Gary B on January 16, 2006, 04:08:55 pm
Ok I have the plugin installed and it asked me how many minutes to leave the user showing...which seems to mean it is installed and working.

Now HOW do I add the online stats to the footer of my gallery?

www.themeparks.com/library
Title: Re: Online stats that work?
Post by: Paver on January 16, 2006, 04:40:54 pm
Did you read this message above?  http://forum.coppermine-gallery.net/index.php?topic=26447.msg122096#msg122096 (http://forum.coppermine-gallery.net/index.php?topic=26447.msg122096#msg122096)

You need to make the changes I listed to codebase.php, then the plugin is ready to use.  To use it, go to your config page under themes settings, then "content of the main page".  Put the text 'onlinestats' somewhere in that string, wherever you want the stats to appear.  If you want it near the bottom, put it at the end.
Title: Re: Online stats that work?
Post by: Gary B on January 16, 2006, 05:32:21 pm
To use it, go to your config page under themes settings, then "content of the main page".  Put the text 'onlinestats' somewhere in that string, wherever you want the stats to appear.  If you want it near the bottom, put it at the end.

This is the part I don't understand...I did make all the changes and it appears to install ok....but when I go to the config page under themes I see

Custom menu link name
Custom menu link URL
Path to custom header include
Path to custom footer include

None of which seem to be what you are talking about...I must be in the wrong place. Could you pont me in the right direction?

Thank you VERY much.

Most Appreciated
Gary
Title: Re: Online stats that work?
Post by: Paver on January 16, 2006, 05:36:25 pm
Oops, I meant 'Album List View' for the config section.  In this section, set the setting 'Content of the main page'.
Title: Re: Online stats that work?
Post by: turbozutek on January 16, 2006, 09:37:48 pm
Well, I can confirm it's worked like a good 'un for the last few days now!

You can have a look over here:

www.turbozutek.f2s.com

:-)

Chris...
Title: Re: Online stats that work?
Post by: Gary B on January 16, 2006, 10:30:41 pm
Well I did figure out where to add the stuff in the config page...but then when I tried it I got a

Critical Error:
There was an error while processing a database query

So I took the /onlinestats back out of that field so my photo albums would work again.
Title: Re: Online stats that work?
Post by: Paver on January 16, 2006, 10:39:28 pm
Weird.  How about some more information?  Does it tell you which query gave the error?  If not, please post the queries section of the debug info (only - keep it simple for now and don't post the whole debug info).
Title: Re: Online stats that work?
Post by: Gary B on January 16, 2006, 10:47:45 pm
Here is some debug info....is this what you needed?


While executing query "SELECT COUNT(*) FROM `parkho2_xmb1`.phpbb_users" on 0

mySQL error:

File: /home/parkho2/public_html/library/include/functions.inc.php - Line: 248
Title: Re: Online stats that work?
Post by: Paver on January 16, 2006, 11:02:39 pm
Maybe.  So it has to do with your bridge.  I'm not bridged so I don't know too much more.  Looking at the plugin's code and the bridge code, I don't see anything glaring that's wrong.

That query is pretty simple to give an error.  Is your database named 'parkho2_xmb1' and your phpBB users table named 'phpbb_users'?  If one of those is wrong, then there's the problem and we need to figure out where the error is.  If neither is wrong, I don't know what to say.  It's a simple "count the number of users" query.
Title: Re: Online stats that work?
Post by: Gary B on January 16, 2006, 11:13:44 pm
Yes both those names are correct and while looking in the database I see I do have a table with valid data called: cpg_mod_online so it is polling data ....


Hmmmm just noticed I have a karma score of -2....wonder who I ticked off. Sorry if I did.
Title: Re: Online stats that work?
Post by: Paver on January 16, 2006, 11:18:57 pm
Turn on debug info in your config and see if there's any more information in the debug info when you include 'onlinestats' and get this error, something related to what exactly causes this error.  If you use phpMyAdmin, you could try this query there just to make absolutely sure something is not typed incorrectly.
Title: Re: Online stats that work?
Post by: Gary B on January 16, 2006, 11:29:11 pm
Ok I turned the plugin back on and go the error message here is the only part of the debug file that was different with it turned on:
Code: [Select]
LIMIT 0 ,12 (0s)
    [55] => SELECT count(*) from cpg_comments where pid=3280 and msg_id!=0 (0s)
    [56] => SELECT count(*) from cpg_comments where pid=3279 and msg_id!=0 (0s)
    [57] => SELECT count(*) from cpg_comments where pid=3278 and msg_id!=0 (0.001s)
    [58] => SELECT count(*) from cpg_comments where pid=3277 and msg_id!=0 (0s)
    [59] => SELECT count(*) from cpg_comments where pid=3276 and msg_id!=0 (0s)
    [60] => SELECT count(*) from cpg_comments where pid=3275 and msg_id!=0 (0s)
    [61] => SELECT count(*) from cpg_comments where pid=3274 and msg_id!=0 (0s)
    [62] => SELECT count(*) from cpg_comments where pid=3273 and msg_id!=0 (0s)
    [63] => SELECT count(*) from cpg_comments where pid=3272 and msg_id!=0 (0s)
    [64] => SELECT count(*) from cpg_comments where pid=3271 and msg_id!=0 (0s)
    [65] => SELECT count(*) from cpg_comments where pid=3270 and msg_id!=0 (0s)
    [66] => SELECT count(*) from cpg_comments where pid=3269 and msg_id!=0 (0s)
    [67] => SELECT COUNT(*) FROM `parkho2_xmb1`.phpbb_users (0.001s)
)


Here is what it looks like with the plugin disabled

Code: [Select]
LIMIT 0 ,12 (0s)
    [55] => SELECT count(*) from cpg_comments where pid=3280 and msg_id!=0 (0s)
    [56] => SELECT count(*) from cpg_comments where pid=3279 and msg_id!=0 (0s)
    [57] => SELECT count(*) from cpg_comments where pid=3278 and msg_id!=0 (0s)
    [58] => SELECT count(*) from cpg_comments where pid=3277 and msg_id!=0 (0s)
    [59] => SELECT count(*) from cpg_comments where pid=3276 and msg_id!=0 (0s)
    [60] => SELECT count(*) from cpg_comments where pid=3275 and msg_id!=0 (0s)
    [61] => SELECT count(*) from cpg_comments where pid=3274 and msg_id!=0 (0s)
    [62] => SELECT count(*) from cpg_comments where pid=3273 and msg_id!=0 (0s)
    [63] => SELECT count(*) from cpg_comments where pid=3272 and msg_id!=0 (0s)
    [64] => SELECT count(*) from cpg_comments where pid=3271 and msg_id!=0 (0s)
    [65] => SELECT count(*) from cpg_comments where pid=3270 and msg_id!=0 (0s)
    [66] => SELECT count(*) from cpg_comments where pid=3269 and msg_id!=0 (0s)
)
Title: Re: Online stats that work?
Post by: Paver on January 16, 2006, 11:47:14 pm
Well, that confirms that the last query is causing the problem.  But it doesn't tell us anything more.  I have the same query (but with my unbridged users table), and it works fine.  I'm using Coppermine 1.4.3 and MySQL 4.1.15.  I don't know if there were be any MySQL 5 issues involved (if you're using version 5).  It's such a simple query.
Title: Re: Online stats that work?
Post by: Gary B on January 17, 2006, 12:05:23 am
MySQL version is 4.0.25-standard
Title: Re: Online stats that work?
Post by: Joachim Müller on January 17, 2006, 08:10:04 am
I updated the plugin thread http://forum.coppermine-gallery.net/index.php?topic=26532.0 as Paver suggested.
There should be only one thread that discusses the plugin, please end the discussion on this thread (try resolving existing issues, but don't start new ones), I will lock this thread soon. Discuss all new issues with the plugin on the thread I refered to above. Thanks to Paver for his contributions and support.
Title: Re: Online stats that work?
Post by: Paver on January 17, 2006, 06:00:03 pm
Gary B: GauGau is right.  Let me sum up what I would suggest for your problem, and then it's up to you.  If you discover more troubleshoting info, please post in the plugin thread (with a quick summary and link to this thread if it's related).

That query is so simple as I said.  There's a COUNT() function and a table and that's it.  If you copy that query to phpMyAdmin and it executes fine, then I don't know why Coppermine cannot execute it.  I assume your bridge with phpBB is working correctly otherwise.  Do you have any other plugins or mods installed?  Are there any issues with your bridge?  I assume Coppermine uses a similar query in the user manager or groups manager.  You could try gonig to those pages and checking the debug info looking for queries that reference the same table as the one having issues here.  I don't know enough about bridges but could it be this table you mentioned is in a different database with different connection info and this plugin doesn't initiate this connection before running this query?  All the previous queries to this problematic one are with Coppermine core tables so that's one difference with this query: it uses an explicit database name and a non-Coppermine table.

The original mod thread that Nibbler posted (linked in the first post of this thread) mentions you have to change things for your bridge, but I doubt that that's necessary in the current plugin version but I really don't know.

So those are my suggestions for things to consider.  Please try out what you can - troubleshoot the problem.  Then, when you have more information, summarize what you did & what you found and post in the plugin thread.

Over and out.
Title: Re: Online stats that work?
Post by: DarKPLuS on May 07, 2009, 06:24:27 pm
hi i installed this. its really good thank you very much)
i want to place it in the sidebar. how can i do this ?
Title: Re: Online stats that work?
Post by: Joachim Müller on May 08, 2009, 04:59:29 pm
Board rules!. Locking.