"Who is online" plugin (onlinestats) - Page 9 "Who is online" plugin (onlinestats) - Page 9
 

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

"Who is online" plugin (onlinestats)

Started by Joachim Müller, January 16, 2006, 02:34:00 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Nibbler

Looks like there is missing code in the uninstall function. Change it to this


// Unnstall (drop?)

function online_uninstall()
{
    global $CONFIG;

    if (!isset($_POST['drop'])) return 1;

    if ($_POST['drop']) {
        cpg_db_query("DROP TABLE IF EXISTS {$CONFIG['TABLE_ONLINE']}");
        cpg_db_query("DELETE FROM {$CONFIG['TABLE_CONFIG']} WHERE name = 'mod_updates_duration'");
        cpg_db_query("DELETE FROM {$CONFIG['TABLE_CONFIG']} WHERE name = 'record_online_users'");
        cpg_db_query("DELETE FROM {$CONFIG['TABLE_CONFIG']} WHERE name = 'record_online_date'");
    }

    return true;
}

Fabrian

I found the mod_updates_duration setting in the config table and deleted it.  I now get a critical error when accessing the site.... I guess this is because I didn't disable the plugin before removing that setting....what now?

Fabrian

I had to restore the db from a backup and I updated the code, which seems to uninstall properly, except now it doesn't seem to capture the the time or display who's been on in the last 10 mins.  I do apologize if I'm in error here..

Fabrian

Ok, I think everything is good now aside from one minor issue.  My time zone atm is -5 for EST, which right now shows 12:20AM.  Despite this, the plugin is showing 1:20AM.

Nibbler

That's a known bug, the timezone offset is applied twice. I will update the plugin when I get time.

Charity


Invalid ID

Thanks a lot. It was something I wanted for months :)

I have one problem, my timing is 5+ and I have mentioned that in the Config. But the time shown in this plugin is way ahead than that.

How can I modify the time?

Nibbler

Quote from: Nibbler on January 25, 2007, 12:28:32 PM
That's a known bug, the timezone offset is applied twice. I will update the plugin when I get time.

Master of Disaster

Is it possible to code an extension of the plugin which shows where in the gallery the uses are?
In phpBB there is a link on the headline "Where is online" and the extension should perhaps be similar to this feature in phpBB.
I am very interested in such an extension!

Could anyone create this extension if it is possible?

René

SAAS

i have a little problem with the language file

when i modified the english file and made a new one for my language i had a problem.

the problem is the language im using is a right to left languge when i installed the plug in it turned out left to right when i uninstalled it it went back to normal .

could you check it plz ^^

puku

 :)  ;D perfect plugin
but I need to change it to display just these info:
"In total there is 1 user online
Most users ever online: 1 on St, Únor.14.2007 at 21:09"
nothing else
what should I change to erase the rest of info
please help
thx a lot

Nibbler

Look through codebase.php and comment out/delete anything you don't want.

puku

Quote from: Nibbler on February 14, 2007, 10:59:06 PM
Look through codebase.php and comment out/delete anything you don't want.
thanx, I did it ... :) work perfect

natrlhy

In the 1.7 version of this wonderful plugin I found some misspellings (Registred) and I have modified them in the lang/english.php file.
I also changed the date format for my taste to look like this:  Most users ever online: 4 on Sun, Feb 25 2007 at 7:10 pm

//language variables
$lang_plugin_onlinestats = array(
'name'                =>'Online Today',
'submit_button'        =>'Submit',
'cancel_button' =>'Cancel',
'reg_member'        =>' Registered member',
'reg_members'        =>' Registered members',
'have'                =>'We have ',
'most_recent'        =>'The newest registered user is: ',
'is'                =>'In total there is ',
'are'                =>'In total there are ',
'user'                =>' user online',
'users'                =>' users online',
'and'                =>' and ',
'guest'                =>' Guest',
'guests'        =>' Guests',
'record'        =>'Most users ever online: ',
'on'                =>' on ',
'since'                =>' online during the last ',
);
//for config
$lang_plugin_onlinestats_config = array(
'config_text'        =>'How long do you want to keep users listed as online for before they are assumed to have gone ?
',
'minute'        =>' Minutes',
'remove'        =>'Remove the table that was used to store online data ?',
'yes'                =>'Yes',
'no'                =>'No',
);
// changed date format
$lang_plugin_onlinestats_date_fmt='%A, %B %d %Y at %l:%M %P';


I also wanted the "Online Today" table to be bold and I made the following modification to the codebase.php file. This took me a while! ;)

look for this code:

       starttable("100%", $lang_plugin_onlinestats['name']);

And change it to this:

       starttable("100%", "<b>".$lang_plugin_onlinestats['name']."</b>");

I also love having the usernames based on the group to have different colors and the following post still worked great for the 1.7 release:

http://forum.coppermine-gallery.net/index.php?topic=26532.msg154487#msg154487

I hope this is helpful for others  :)

natrlhy

I'm trying to figure out how to add some color to the section where this plugin displays the "Most users ever online:" section.

Here is the line I need to modify in the codebase.php file:

        echo $lang_plugin_onlinestats['record']."<b>". $CONFIG['record_online_users']."</b>" .$lang_plugin_onlinestats['on']."<b>".
localised_date($CONFIG['record_online_date'], $lang_plugin_onlinestats_date_fmt ) ."</b><br />"."</td></tr>";


I've tried several things but I just keep getting parsing errors.

Thanks!

François Keller

Avez vous lu la DOC ? la FAQ ? et cherché sur le forum avant de poster ?
Did you read the DOC ? the FAQ ? and search the board before posting ?
Mon Blog

natrlhy

I've tried entering in code like:

        echo $lang_plugin_onlinestats['record']."<b>". $CONFIG['record_online_users']."</b>" .$lang_plugin_onlinestats['on']."<b>"."<span style="color:red;font-weight:bold;">".localised_date($CONFIG['record_online_date'], $lang_plugin_onlinestats_date_fmt ) ."</b><br /></span>"."</td></tr>";

With no luck... I'm not very savvy with PHP code, so with that said, I'm struggling with what goes where or if this can be done. Tis the price of a little pizazz :)

Nibbler

Use single quotes around this bit instead of double quotes


"<span style="color:red;font-weight:bold;">"



'<span style="color:red;font-weight:bold;">'

natrlhy

#178
I tried so many different quote types and probably had them in the wrong spot.

Thanks!  This is working:

        echo $lang_plugin_onlinestats['record']."<b>".'<span style="color:#5EE548;font-weight:bold;">'.$CONFIG['record_online_users
']."</b></span>" .$lang_plugin_onlinestats['on']."<b>".'<span style="color:#5EE548;font-weight:bold;">'.localised_date($CONFIG['reco
rd_online_date'], $lang_plugin_onlinestats_date_fmt ) ."</b><br /></span>"."</td></tr>";


Syntax and placement is so key ;)  I just need to understand where all the . and " or ' go :)

lonely24

When i enable the plugin ,

I got message like this ,

Critical Error
There was an error while processing a database query 

MY CPG verision is the 1.4 latest version and integration with phpbb.

Is it coz of phpbb ?