本文整理汇总了PHP中chatHeartbeat函数的典型用法代码示例。如果您正苦于以下问题:PHP chatHeartbeat函数的具体用法?PHP chatHeartbeat怎么用?PHP chatHeartbeat使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了chatHeartbeat函数的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: init
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: define
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: session_start
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: time
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();