コード例 #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
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.
*/
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();
コード例 #3
0
ファイル: chat.php プロジェクト: jncorrea/gop
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
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");
コード例 #4
0
ファイル: chat.php プロジェクト: malimu/Pipeline
    exit;
}
//*JAG - Page id is a unique id assigned to each page that loads a chatbox. Currently, only one chat box will load per page.
//        this allows us to track which records have been loaded if multiple tabs for the same chat room are open.
$pageId = Filter::text($_GET['pageId']);
$isValidPageId = Filter::isValidTimestamp($pageId);
if (empty($isValidPageId)) {
    $pageId = time();
}
$slug = Filter::text($_GET['slug']);
$project = Project::getProjectFromSlug($slug);
if ($_GET['action'] == "getonlineusers") {
    getOnlineUsers($slug);
}
if ($_GET['action'] == "chatheartbeat") {
    chatHeartbeat($slug, $pageId);
}
if ($_GET['action'] == "sendchat") {
    sendChat($pageId);
}
if ($_GET['action'] == "closechat") {
    closeChat();
}
if ($_GET['action'] == "startchatsession") {
    startChatSession($pageId);
}
if (!isset($_SESSION['chatHistory'])) {
    $_SESSION['chatHistory'] = array();
}
if (!isset($_SESSION['openChatBoxes'])) {
    $_SESSION['openChatBoxes'] = array();