I'm trying to get a {usersonline} tag to work properly. It only shows 1 user online even when there are multiple users online. This script worked properly as an include on a page before I had CMS. Can someone help me. Here is the script. Thanks!
$timestamp=time();
$timeout=$timestamp-$timeoutseconds;
mysql_connect($server, $db_user, $db_pass) or die ("Useronline Database CONNECT Error");
mysql_db_query($database, "INSERT INTO onlyusers VALUES ('$timestamp','$REMOTE_ADDR','$PHP_SELF')") or die("Useronline Database INSERT Error");
mysql_db_query($database, "DELETE FROM onlyusers WHERE timestamp
$online user online";} else {echo "$online users online";}
Users Online User-defined tag
-
outdoorxtreme1
Re: Users Online User-defined tag
Could this be because its accessing a different MySQL database than CMS is in?
-
outdoorxtreme1
Re: Users Online User-defined tag
Do I need to put these database connection variables in a user defined tag? Or will it do it thru CMSMS?
$server = " ";
$db_user = " ";
$db_pass = " ";
$database = " ";
$server = " ";
$db_user = " ";
$db_pass = " ";
$database = " ";
Re: Users Online User-defined tag
You need to fill that stuff in.
You CAN use the existing database connection, providing that your tables are in the same database.
You CAN use the existing database connection, providing that your tables are in the same database.
-
outdoorxtreme1
Re: Users Online User-defined tag
Any idea why the IP and the FILE fields are blank in my database? If I use this script on a test.php page it works fine and I can see values in all 3 fields. If I use the script as a user-defined tag in CMSMS only the timestamp field has data in it and the IP and FILE fileds are empty in my SQL database.
-
outdoorxtreme1
Re: Users Online User-defined tag
Do I need to create a custom module since this script posts to its self?
-
outdoorxtreme1
Re: Users Online User-defined tag
I am able to get data in all my SQL fields if I use a user-defined tag that has this script in it:
include "http://www.neohoutdoors.com/usersonline.php";
The only problem now is that I get my servers dedicated IP address for everyone that is on my page instead of their own.
Any thoughts?
include "http://www.neohoutdoors.com/usersonline.php";
The only problem now is that I get my servers dedicated IP address for everyone that is on my page instead of their own.
Any thoughts?
-
iNSiPiD
Re: Users Online User-defined tag
Could you paste or attach that script please? PHP files can't be downloaded as raw code from URLs.

