Buy Now !
 

 
 
Forex Manual Trader
 
The best expert advisor
for manual traders
( Metatrader 4 EA )
 
How to use the script
 

Setting up the script on your site is not difficult, it's done in a few minutes! A detailed documentation is included in the download so here's the how-to in a nutshell:

Insert CSS styling, jQuery and Chat libraries in the head section of your HTML document.

 

<head>
   <link href="css/reset.css" rel="stylesheet" type="text/css" />
   <link href="css/chat.css" rel="stylesheet" type="text/css" />

   <script type="text/javascript" src="js/jquery.min.js"></script>
   <script type="text/javascript" src="js/jquery.ajax_chat.js"></script>

   <script type="text/javascript" src="own_id.inc.php"></script>
</head>

 

Create a MySQL database for the chat (or use existing one) and create two tables, one for the users and one for the chat. (SQL dump is also included in download)

 

CREATE TABLE chat (
'id' INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
'from_id' VARCHAR(255) NOT NULL DEFAULT '',
'to_id' VARCHAR(255) NOT NULL DEFAULT '',
'message' TEXT NOT NULL,
'sent' BIGINT(19) NOT NULL,
'recd' INT(10) UNSIGNED NOT NULL DEFAULT '0',
'system_message' VARCHAR(3) DEFAULT 'no',
PRIMARY KEY ('id')
) ENGINE=INNODB DEFAULT CHARSET=utf8

CREATE TABLE users (
'id' INT(10) NOT NULL AUTO_INCREMENT,
'username' VARCHAR(255) DEFAULT NULL,
'chat_status' VARCHAR(255) DEFAULT 'offline',
'is_typing_to' INT(10) DEFAULT '0',
PRIMARY KEY ('id')
) ENGINE=INNODB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8

INSERT INTO users (id,username) VALUES('1','John')
INSERT INTO users (id,username) VALUES('2','Elizabeth')
INSERT INTO users (id,username) VALUES('3','Joseph')
 

Set MySQL settings in config.inc.php:

<?php
$sql_username = 'your_mysql_username';
$sql_password = 'your_mysql_password';
$database = 'chat';
$sql_table_chat = 'chat';
$sql_table_users = 'users';
...

 

Finally set current user's variable in PHP SESSION and list available users:

 

<?php
session_start();

// Load MySQL DB settings
include_once('config.inc.php');

// Set current user
$_SESSION['username'] = 'Currently logged in users's username from database';
$_SESSION['user_id'] = 'Currently logged in user's id';
?>
<html>
...

<body>
...
<a href="#" alt="1|Elizabeth" class="chat_user">John</a>
<a href="#" alt="2|Elizabeth" class="chat_user">Elizabeth</a>
<a href="#" alt="3|Elizabeth" class="chat_user">Joseph</a>
...

 

 

 

 

And that's it, you're done!