コード例 #1
0
ファイル: Chat.php プロジェクト: renzot23/Los-Pinos-Virtual
 public function init()
 {
     define('DBPATH', 'localhost');
     define('DBUSER', 'root');
     define('DBPASS', 'root');
     define('DBNAME', 'bdpinos');
     // session_start();
     global $dbh;
     $dbh = mysql_connect(DBPATH, DBUSER, DBPASS);
     mysql_selectdb(DBNAME, $dbh);
     if ($_GET['action'] == "chatheartbeat") {
         chatHeartbeat();
     }
     if ($_GET['action'] == "sendchat") {
         sendChat();
     }
     if ($_GET['action'] == "closechat") {
         closeChat();
     }
     if ($_GET['action'] == "startchatsession") {
         startChatSession();
     }
     if (!isset($_SESSION['chatHistory'])) {
         $_SESSION['chatHistory'] = array();
     }
     if (!isset($_SESSION['openChatBoxes'])) {
         $_SESSION['openChatBoxes'] = array();
     }
 }
コード例 #2
0
ファイル: chat.php プロジェクト: eswar544/version-in
define('DBPATH', 'localhost');
define('DBUSER', 'root');
define('DBPASS', 'vertrigo');
define('DBNAME', 'chat');
session_start();
global $dbh;
$dbh = mysql_connect(DBPATH, DBUSER, DBPASS);
mysql_selectdb(DBNAME, $dbh);
if ($_GET['action'] == "chatheartbeat") {
    chatHeartbeat();
}
if ($_GET['action'] == "sendchat") {
    sendChat();
}
if ($_GET['action'] == "closechat") {
    closeChat();
}
if ($_GET['action'] == "startchatsession") {
    startChatSession();
}
if (!isset($_SESSION['chatHistory'])) {
    $_SESSION['chatHistory'] = array();
}
if (!isset($_SESSION['openChatBoxes'])) {
    $_SESSION['openChatBoxes'] = array();
}
function chatHeartbeat()
{
    $sql = "select * from chat where (chat.to = '" . mysql_real_escape_string($_SESSION['username']) . "' AND recd = 0) order by id ASC";
    $query = mysql_query($sql);
    $items = '';
コード例 #3
0
ファイル: chat.php プロジェクト: jncorrea/gop
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.

*/
session_start();

global $dbh;

if ($_GET['action'] == "chatheartbeat") { chatHeartbeat(); } 
if ($_GET['action'] == "sendchat") { sendChat(); } 
if ($_GET['action'] == "closechat") { closeChat(); } 
if ($_GET['action'] == "startchatsession") { startChatSession(); } 

if (!isset($_SESSION['chatHistory'])) {
	$_SESSION['chatHistory'] = array();	
}

if (!isset($_SESSION['openChatBoxes'])) {
	$_SESSION['openChatBoxes'] = array();	
}

function chatHeartbeat() {
	include("../static/site_config.php"); 
	include ("../static/clase_mysql.php");
	$miconexion = new clase_mysql;
	$miconexion->conectar($db_name,$db_host, $db_user,$db_password);
コード例 #4
0
ファイル: chat.php プロジェクト: nrooney/rcs_oma
     break;
 case 'getAllSubInfo':
     //4
     getAllSubInfo($_POST['username'], $authuser, $authpw);
     break;
 case 'createChat':
     //5
     createChat($_POST['username'], $authuser, $authpw, $contactID);
     break;
 case 'sendIM':
     //6
     sendIM($_POST['username'], $authuser, $authpw, $contactID, $sessionID, $text);
     break;
 case 'closeChat':
     //7
     closeChat($_POST['username'], $authuser, $authpw, $contactID, $sessionID);
     break;
 case 'sendComposing':
     //8
     sendComposing($_POST['username'], $authuser, $authpw, $contactID, $sessionID);
     break;
 case 'sendDisplay':
     //9
     sendDisplay($_POST['username'], $authuser, $authpw, $contactID, $sessionID, $messageID);
     break;
 case 'acceptIMSessions':
     //10
     acceptIMSessions($_POST['username'], $authuser, $authpw, $contactID, $sessionID);
     break;
 case 'declineIMSession':
     //11