| Code: : |
| <? // script by Bob Dickow for displaying number of phpMyChat users// in a web page display./* This script may be run as an include (place a php include();) or included in your php script or php enabled html web pages. Place it at the location youwant the message displayed.*//* Change the data for your login, and double check that the 'c_users', 'c_messages' table names are the ones you are really using. (To find out,look in config/config.lib.php3 on your running system and match the tablenames. *//* This does not use the dbase abstraction libraries in phpMyChat, justso you can have more flexibility with how and where you use this. */ $mysql = mysql_connect ("db1.xxxx.et","dXXXXX",".eXXXXX4"); $dbase = mysql_select_db("dXXXXXX0"); $query = "SELECT DISTINCT u.username FROM ooc_c_users u, ooc_c_messages m WHERE u.room = m.room AND m.type = 1"; $result = mysql_query($query); $num_of_rows = mysql_num_rows($result); mysql_close($mysql); echo ("<BR>Currently $num_of_rows user in the chat room<BR>");?> |
| Code: : |
| Currently user in the chat room ");?> |
| Code: : |
| <?php #### Generated by Block Creator by Disipal Site (www.disipal.net) ### if (eregi("block-Block_Creator.php",$PHP_SELF)) { Header("Location: index.php"); die(); } $content = " <? // script by Bob Dickow for displaying number of phpMyChat users// in a web page display./* This script may be run as an include (place a php include();) or included in your php script or php enabled html web pages. Place it at the location youwant the message displayed.*//* Change the data for your login, and double check that the 'c_users', 'c_messages' table names are the ones you are really using. (To find out,look in config/config.lib.php3 on your running system and match the tablenames. *//* This does not use the dbase abstraction libraries in phpMyChat, justso you can have more flexibility with how and where you use this. */"; $content .= "$mysql = mysql_connect (\"dbXXXXXXet\",\"dXXXXXXX0\",\".eXXXXXX4\"); "; $content .= "dbase = mysql_select_db(\"dXXXXXXX0\"); "; $content .= "query = \"SELECT DISTINCT u.username FROM ooc_c_users u, ooc_c_messages m WHERE u.room = m.room AND m.type = 1\"; "; $content .= "result = mysql_query($query); "; $content .= "num_of_rows = mysql_num_rows($result); mysql_close($mysql); "; $content .= "cho (\"<BR>Currently $num_of_rows user in the chat room<BR>\");?>"; ?> |