Online stats that work? Online stats that work?
 

News:

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

Main Menu

Online stats that work?

Started by turbozutek, January 14, 2006, 12:51:42 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

turbozutek

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

Paver

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.

turbozutek

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

turbozutek

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


Paver

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: $thisplugin->add_filter('plugin_content','online_mainpage');
to be this: $thisplugin->add_filter('plugin_block','online_mainpage');

Then modify this line: function online_mainpage()
to be this: function online_mainpage($matches)

Then just below this line in the function online_mainpage: global $CONFIG, $cpg_udb, $comment_date_fmt ;
add this line: 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.)

turbozutek

Now that WORKS reallll well!!

Thank you very much! :-D

Chris...

Joachim Müller

what plugin are you refering to? Please post a link.

Paver

The one I modified was on page 8 of the thread linked above:
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.

Joachim Müller

I started a separate thread 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.

Paver

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:

  • Rename credits.php to configuration.php
  • Change the filter name 'plugin_content' to 'plugin_block'
  • Add the parameter $matches to the function online_mainpage
  • Add the line "if($matches[1] != 'onlinestats') { return $matches; }" to the beginning of online_mainpage

Gary B

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

Paver

Did you read this message above?  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.

Gary B

Quote from: Paver on January 16, 2006, 04:40:54 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

Paver

Oops, I meant 'Album List View' for the config section.  In this section, set the setting 'Content of the main page'.

turbozutek

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

Gary B

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.

Paver

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).

Gary B

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

Paver

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.

Gary B

#19
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.