RogerB Posted May 3, 2009 Report Share Posted May 3, 2009 I am trying to use a "user online script I found.......Being that I just just spent the last 3 hours searching for an answer, I am posting here. All you have to do is use the "include" function to make it appear, but, it totally jacks up the phhpvms code when you add it(you can't view pages, no other php code will show) things like that.. Here is the code, see if any of you spot a problem. <?php //Script created by janssens.org.uk under the GNU GPL //For help with this please go to: http://janssens.org.uk/repository/php/php-user-online-script/ //Database variables $server = "localhost"; // Your MySQL Server address. This is usually localhost $db_user = "****"; // Your MySQL Username $db_pass = "******"; // Your MySQL Password $database = "******"; // Database Name //Customizations $timeoutseconds = "300"; // How long it it boefore the user is no longer online //Only one person is online $oneperson1 = "There is curently"; //Change the text that will be displayed $oneperson2 = "person online."; //Change the text that will be displayed //Two or more people online $twopeople1 ="There are currently"; //Change the text that will be displayed $twopeople2 ="people online."; //Change the text that will be displayed //The following should only be modified if you know what you are doing if($_SERVER['HTTP_X_FORWARDED_FOR']){ $ip=$_SERVER['HTTP_X_FORWARDED_FOR']; } else{ $ip=$_SERVER['REMOTE_ADDR']; } $scripturl = $_SERVER[’PHP_SELF’]; $timestamp=time(); $timeout=$timestamp-$timeoutseconds; mysql_connect($server, $db_user, $db_pass) or die ("Error: Unable to connect to MySQL"); mysql_db_query($database, "INSERT INTO online VALUES ('$timestamp','$ip','$scripturl')") or die("Error: Can't insert data into database'"); mysql_db_query($database, "DELETE FROM online WHERE timestamp<$timeout") or die("Error: Unable to delete old entries from the database"); $result = mysql_db_query($database, "SELECT DISTINCT ip FROM online WHERE file='$scripturl'") or die("Error: Unable to select entries in the database"); $users = mysql_num_rows($result); mysql_close(); if ($users==1){ echo"<font size=1>$oneperson1 $users $oneperson2</font>"; } else{ echo"<font size=1>$twopeople1 $users $twopeople2"; } ?> Quote Link to comment Share on other sites More sharing options...
RogerB Posted May 3, 2009 Author Report Share Posted May 3, 2009 Stay Thirsty my friends. Quote Link to comment Share on other sites More sharing options...
Wayne Posted May 3, 2009 Report Share Posted May 3, 2009 i dont know if this would help and not sure if you added it in there but maybe take out the font sizeing. I added a users online code on my site that just uses a txt file simple yet effective, and it had divs and all this other crap where the code was to show up i took that out and it works just like its suppose to now. Quote Link to comment Share on other sites More sharing options...
RogerB Posted May 3, 2009 Author Report Share Posted May 3, 2009 I don't see how font sizing would jack the other php........ Quote Link to comment Share on other sites More sharing options...
Administrators Nabeel Posted May 3, 2009 Administrators Report Share Posted May 3, 2009 That won't work because you have to add a table. I can slate that for the next release Quote Link to comment Share on other sites More sharing options...
Wayne Posted May 4, 2009 Report Share Posted May 4, 2009 sweet ill have to remember to take the one i have off once you do that haha Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.