forum.coppermine-gallery.net

Support => cpg1.4 plugins => cpg1.4.x Support => Older/other versions => cpg1.4 plugin contributions => Topic started by: Sami on August 22, 2006, 06:51:26 am

Title: Users Online Today
Post by: Sami on August 22, 2006, 06:51:26 am
Users Online Today (Like SMF add-on package) ver 1.0
   Main mod: http://forum.coppermine-gallery.net/index.php?topic=17308.0
   Main idea: probinson77 (http://forum.coppermine-gallery.net/index.php?action=profile;u=16029)

   Special thanks to razorbiker (http://forum.coppermine-gallery.net/index.php?action=profile;u=33051) , who ordered ;) this plugin

Install:
- unzip package to plugins folder and use plugin manager to install it
- after installation add onlinetoday to :
    config => Album list view => The content of the main page

config:
- if you want to show this stat to admin only , open up plugins/online_oday/codebase.php and replace (around line 63)
this
Code: [Select]
if($matches[1] != 'onlinetoday') {
with this
Code: [Select]
if($matches[1] != 'onlinetoday' || !GALLERY_ADMIN_MODE) {

- if you want to show this stat to Registered user only , open up plugins/online_oday/codebase.php and replace (around line 63)
this
Code: [Select]
if($matches[1] != 'onlinetoday') {
with this
Code: [Select]
if($matches[1] != 'onlinetoday' || !USER_ID) {

There isn't any configuration page for this plugin , yet !
Title: Re: Users Online Today
Post by: terrorhawk on August 26, 2006, 12:21:05 pm
Very cool.
It looks likes it works
Only one strange thing.
it not alway's shows if the user was online.
It looks likes it doesnt show a user if u use the remember me function
Title: Re: Users Online Today
Post by: Sami on August 28, 2006, 07:20:51 am
yes this plugin use xxx_users table as a reference and that table doesn't change the user-last-visit value for those who select remember me option there is two solution:
- changing the core files of CPG to change that value
- use custom table to store this plugin data
Title: Re: Users Online Today
Post by: Farnsi on September 21, 2006, 05:43:40 pm
yes this plugin use xxx_users table as a reference and that table doesn't change the user-last-visit value for those who select remember me option there is two solution:
- changing the core files of CPG to change that value
- use custom table to store this plugin data
Nice Mod, thank you!
Could you help me a little and explain how to use a custom table to store the plugin data? I guess it would be the most elegant way to solve the "problem" mentioned above, right?

I´m running version 1.4.9 with the modpack and the "Who is online"-plugin.

Greetings!
Title: Re: Users Online Today
Post by: Pascal YAP on September 22, 2006, 10:59:02 am
Morning Sami  ;)
All,

CODEBASE.PHP in French here (http://forum.coppermine-gallery.net/index.php?topic=36474.msg171596#msg171596)  ;D

  Thanx

PYAP
Title: Re: Users Online Today
Post by: Gephri on December 17, 2006, 06:47:50 am
Nice Mod!

Could you help me a little and explain how to use a custom table to store the plugin data? I guess it would be the most elegant way to solve the "problem" mentioned above, right?

I´m running version 1.4.9 with the modpack and the "Who is online"-plugin.
Title: Re: Users Online Today
Post by: Sami on December 17, 2006, 06:59:08 am
- Create a custom table like xxx_uotlog
- Run custom Mysql query at authentication to add some user info to xxx_uotlog
Title: Re: Users Online Today
Post by: Gephri on December 17, 2006, 06:05:05 pm
thanks Sami - got it.
Title: Re: Users Online Today
Post by: m@rk on December 29, 2006, 04:03:39 pm
I made a modification and permit to name it v1.1.

Modifications:

Title: Re: Users Online Today
Post by: François Keller on December 29, 2006, 06:04:43 pm
French.php lang file attached  ;)
Title: Re: Users Online Today
Post by: orTubes on January 26, 2007, 10:57:33 pm
This plugin only shows the registered users, has as to also show how many guests they are connected?

http://www.orTubes.com
Http://orGames.ortubes.com
Title: Re: Users Online Today
Post by: Nibbler on January 26, 2007, 11:41:20 pm
You probably want the who's online plugin.

http://forum.coppermine-gallery.net/index.php?topic=26532.0
Title: Re: Users Online Today
Post by: Invalid ID on January 30, 2007, 03:46:07 am
I am new to this, so kindly tell me what file(s) will be uploaded.

I first unzipped cpg1.4.x_plugin_pack_v3, found online_today, so wanted to install it. So I used Plugin Manager to install it, but uploading configuration.php and codebase.php gives a message "The file uploaded is not a plugin package."

What should I do?

Thanks
Title: Re: Users Online Today
Post by: Sami on January 30, 2007, 07:11:17 am
You should upload "online_today" folder to plugins folder
Title: Re: Users Online Today
Post by: fotovagu on March 09, 2007, 11:37:35 am
very nice plugin. thanx :)

is it possible to change this to show Users online in  last 24 Hours ?


thanx
fotovagu
Title: Re: Users Online Today
Post by: Darth Unrivaled on April 19, 2007, 02:15:20 pm
I install this plugin, yet it doesn't work. It always shows 0 users online. I made the change to show to only register users. Does this mod work if you have turn on the bridge between CPG and BBS? Being that it doesn't use the user table anymore and if so is there a work around for this?
Title: Re: Users Online Today
Post by: Nibbler on April 19, 2007, 02:43:02 pm
No, this plugin is not bridge compatible.
Title: Re: Users Online Today
Post by: Hein Traag on April 19, 2007, 02:53:36 pm
dutch.php attached
Title: Re: Users Online Today
Post by: will on November 19, 2007, 01:27:40 pm
Had this plugin a while but I haven't used it until now, I get this database query error and this mysql error:

While executing query "SELECT user_id,user_lastvisit FROM `newgallery2007`.ibf_members WHERE user_lastvisit LIKE '2007-11-19%'" on 0

mySQL error: Unknown column 'user_id' in 'field list'

My gallery is bridged, is this why? If so is there a way of making it work with my bridged gallery ;)
Title: Re: Users Online Today
Post by: Nibbler on November 19, 2007, 02:03:03 pm
No, this plugin is not bridge compatible.
Title: Re: Users Online Today
Post by: dke on January 05, 2008, 01:58:29 am
I have some questions.

1. Is it possible to hide the admin user in the online list?
2. Is it possible to remove the online stats on the other "index" pages like if i click a category it will go to index.php?cat=XX i will still see the users online table.

Thank you for the good modification :)
Title: Re: Users Online Today
Post by: Sami on January 05, 2008, 06:27:26 am
1. Is it possible to hide the admin user in the online list?
Yes , edit codebase.php around line #66
change this
Code: [Select]
$result = cpg_db_query("SELECT user_id,user_lastvisit FROM {$CONFIG['TABLE_USERS']} WHERE user_lastvisit LIKE '".date("Y-m-d", mktime())
."%'");
With this
Code: [Select]
$result = cpg_db_query("SELECT user_id,user_lastvisit FROM {$CONFIG['TABLE_USERS']} WHERE user_lastvisit LIKE '".date("Y-m-d", mktime())
."%' AND user_group <> 1");

2. Is it possible to remove the online stats on the other "index" pages like if i click a category it will go to index.php?cat=XX i will still see the users online table.
Yes you can check $_SERVER['QUERY_STRING'] and if it was null then show the online users table
something like this
Code: [Select]
$qs = $_SERVER['QUERY_STRING']
if(!$qs){
starttable("100%", "Users Online Today ($total users)");

echo '<tr><td class="tableb">';
echo "{$online_today}</td></tr>";

endtable();
}
Title: Re: Users Online Today
Post by: dke on January 05, 2008, 01:10:30 pm
Yes , edit codebase.php around line #66
change this
Code: [Select]
$result = cpg_db_query("SELECT user_id,user_lastvisit FROM {$CONFIG['TABLE_USERS']} WHERE user_lastvisit LIKE '".date("Y-m-d", mktime())
."%'");
With this
Code: [Select]
$result = cpg_db_query("SELECT user_id,user_lastvisit FROM {$CONFIG['TABLE_USERS']} WHERE user_lastvisit LIKE '".date("Y-m-d", mktime())
."%' AND user_group <> 1");

Thank you, this worked perfectly!

Quote
Yes you can check $_SERVER['QUERY_STRING'] and if it was null then show the online users table
something like this
Code: [Select]
$qs = $_SERVER['QUERY_STRING']
if(!$qs){
starttable("100%", "Users Online Today ($total users)");

echo '<tr><td class="tableb">';
echo "{$online_today}</td></tr>";

endtable();
}

I don't fully understand how to find the correct query to replace "SERVER_STRING" or am i doing it wrong?

I get a error message when i use your code "untouched" :
Code: [Select]
Parse error: syntax error, unexpected T_IF in plugins\online_today\codebase.php on line 90
I'm no coder as you might understand :)

Thank you for support!


Title: Re: Users Online Today
Post by: Nibbler on January 05, 2008, 03:45:16 pm
You need a semi-colon at the end of each statement in PHP, so

Code: [Select]
$qs = $_SERVER['QUERY_STRING'];
Title: Re: Users Online Today
Post by: dke on January 05, 2008, 04:29:59 pm
You need a semi-colon at the end of each statement in PHP, so

Code: [Select]
$qs = $_SERVER['QUERY_STRING'];

Thanks, now i get another message:
Code: [Select]
Parse error: syntax error, unexpected $end in plugins\online_today\codebase.php on line 102
Any idea?
Title: Re: Users Online Today
Post by: just_some_guy on January 05, 2008, 04:31:53 pm
You might be missing a curly brace, just add one of these at the end - that might fix it. }
Title: Re: Users Online Today
Post by: dke on January 05, 2008, 04:42:37 pm
You might be missing a curly brace, just add one of these at the end - that might fix it. }

I have one of those, i'm not sure if its correctly placed.

This is the code that generates error:

Code: [Select]
$qs = $_SERVER['QUERY_STRING'];
if(!$qs){

starttable("100%");

echo '<tr><td class="tableh2"><b><b>Users online today</b></td></tr>';
echo '<td class="tableb">';
echo "{$online_today}</td>";

endtable();

}
?>

Anything wrong with it?

EDIT:

Managed to solve this my self, apparently i needed 2 curly braces? This code worked for me:

Code: [Select]
$qs = $_SERVER['QUERY_STRING'];
if(!$qs){

starttable("100%");

echo '<tr><td class="tableh2"><b><b>Users online today</b></td></tr>';
echo '<td class="tableb">';
echo "{$online_today}</td>";

endtable();
}
}
?>

Thank you guys for all the help!
Title: Re: Users Online Today
Post by: Sami on January 06, 2008, 06:13:07 am
Sorry for missed semi-colon I didn't test that !
Title: Re: Users Online Today
Post by: haosev on May 21, 2008, 06:06:24 am
Verry good and thanks
Title: Re: Users Online Today
Post by: Fabricio Ferrero on May 23, 2008, 12:50:45 am
Spanish file attached...
Title: Re: Users Online Today
Post by: fran86 on October 18, 2008, 01:17:30 am
Sorry, im probably not allowed to post here now but i have no clue where the new version is! Searched but i kept getting leading to this 2006 one, and its not even a zip so i cant install it.

Can anyone help me?!

Thankyou.
Title: Re: Users Online Today
Post by: Fabricio Ferrero on October 18, 2008, 05:59:34 am
This is the newest and oldest version. ;D There is not another version of this plugin.

Quote
and its not even a zip so i cant install it.
Login and go to the first post. Just below you will find the file zipped. Download it and installed as any plugin.

Regards,
Title: Re: Users Online Today
Post by: fran86 on October 18, 2008, 06:35:02 am
This is the newest and oldest version. ;D There is not another version of this plugin.
Login and go to the first post. Just below you will find the file zipped. Download it and installed as any plugin.

Regards,

Thanks hun, must of missed that! Lol! Installed and works  ;D
Title: Re: Users Online Today
Post by: Deus on January 10, 2009, 02:39:09 pm
I made a modification and permit to name it v1.1.

Modifications:

  • Internationalisation (languages English, German included)
  • Layout modification
  • Links to user profiles only for members
  • Display Your IP and ISP

Nice additions M@rk, I'd just like to know, is there a way of displaying all Ip's but to the admin only?
Title: Re: Users Online Today
Post by: Criss on February 15, 2009, 05:09:42 pm
Nice additions M@rk, I'd just like to know, is there a way of displaying all Ip's but to the admin only?


Yes, I'd like to know it too, please.
Title: Re: Users Online Today
Post by: Joachim Müller on February 17, 2009, 12:07:46 pm
The plugin does what it does. If you need additional features, you'll have to code them in. There's no point in repeating the request of others that went unanswered in the first place.
Title: Re: Users Online Today
Post by: Criss on February 17, 2009, 02:27:28 pm
Whatever. You bitch more than help.
Title: Re: Users Online Today
Post by: Exal on May 20, 2009, 09:37:30 pm
Hereby attached the spanish.php
Title: Re: Users Online Today
Post by: Toaster!77 on December 07, 2009, 09:00:38 am
- Create a custom table like xxx_uotlog
- Run custom Mysql query at authentication to add some user info to xxx_uotlog

hi guys,

can anyone give me an detail manual how to change that?
i'm bot realy a programmer so i dont understand what todo :)

thanks in advance

Markus
Title: Re: Users Online Today
Post by: Joachim Müller on December 07, 2009, 09:35:43 am
That piece of advice was aimed at a programmer. If you can't come up with the code to create a table, you won't be able to come up the rest of the code needed neither. If you need documentation how to create database tables using the programming language PHP, you could look at the PHP documentation itself at http://www.php.net/manual/en/ref.mysql.php, but that won't help if you're not a coder.
I'm sorry, but it's beyond the scope of this forum to teach you how to code. To use this plugin, you don't need any particular coding skills nor do you have to perform the actions you quoted - just use the plugin as it is, as suggested in the initial posting. If you need actual help, do as suggested per board rules (http://forum.coppermine-gallery.net/index.php/topic,55415.msg270616.html#msg270616).