This topic is locked

how to integrate chat

8/18/2009 7:01:37 PM
PHPRunner General questions
G
gchable author

Hi,
I wanted to know if I can integrate this code with PHPRunner project

session_start();
function stripSlashesDeep($value) {

$value = is_array($value) ? array_map('stripSlashesDeep', $value) : stripslashes($value);

return $value;

}
if ( get_magic_quotes_gpc() ) {

$_GET = stripSlashesDeep($_GET );

$_POST = stripSlashesDeep($_POST );

$_COOKIE = stripSlashesDeep($_COOKIE);

}
$dbh = mysql_connect($SERVERNAME.':'.$SERVERPORT,$USERNAME,$PASSWORD);

mysql_selectdb($DBNAME,$dbh);

// mysql_set_charset('latin5');
define('TABLE_PREFIX', '');
$userid = 0;
// Please update the following logic below to return the userid of the logged in user

// We assume you will be using some sort of session/cookie to fetch those details

// For example we use a cookie called sessionhash and store it in table called session

//

// Session table

// ---------------------------------

// userid sessionhash

// ---------------------------------

// 1 afgbdsfbsdfklbnlern34

//

// Or you can use something as simple as $userid = $_SESSION['userid'];
$sql = ("select userid from ".TABLE_PREFIX."session where sessionhash = '".mysql_real_escape_string($_COOKIE['sessionhash'])."'");

$query = mysql_query($sql);

$session = mysql_fetch_array($query);

$userid = $session['userid'];


thanks

J
Jane 8/19/2009

Hi,
I'm not sure that I understand your question.

Please clarify what you want to do with this code.

G
gchable author 8/19/2009

Is cometchat_init.php

http://www.cometchat.com/
S
swanside 8/20/2009

It would be a good idea to have some sort of chat window on maybe the list page. Maybe this could be selected as when you choose the pages you want there is a box to tick if you want chat.

The box could then be made to a required size by the user and would sit at the top of the list page. Then users could offer real time ideas and chat between users on the application.