function bc_userSignOff() { $db =& JFactory::getDBO(); $myss = bc_getSessionData(); $query = "UPDATE #__session " . " SET bc_lastUpdate='' " . " WHERE session_id='{$myss->session_id}' "; $db->setQuery($query); $db->query(); if ($myss->userid) { $query = "UPDATE #__blastchatc_users " . " SET bc_rid=0, bc_rsid=0, bc_rname='', bc_idle=''" . " WHERE bc_userid={$myss->userid} "; $db->setQuery($query); $db->query(); } }
require_once JPATH_ROOT . DS . 'components' . DS . 'com_blastchatc' . DS . 'api.blastchatc.php'; $mosConfig_live_site = bc_getLiveSite(); //strip http or https from this website URL //if you need this to be something else, adjust bc_getLiveSite function in api.blastchatc.php file $bc_site = $mosConfig_live_site; $bc_site = strtolower($bc_site); $bc_site = str_replace("http://", "", $bc_site); $bc_site = str_replace("https://", "", $bc_site); $bc_site_other = ""; if (strpos($bc_site, "www.") === false) { $bc_site_other = "www." . $bc_site; } else { $bc_site_other = str_replace("www.", "", $bc_site); } $bc_version = bc_getVersion(); $myss = bc_getSessionData(); $detached = JRequest::getInt('d', 2); //overwrite admin backend configuration to open chat as detached or undetached $bc_task = JRequest::getString('bc_task', null); $rid = JRequest::getInt('rid', 0); $rsid = JRequest::getInt('rsid', 0); $bc_Itemid = JRequest::getString('Itemid', null); $db =& JFactory::getDBO(); //getBlastChat data of your website from blastchatc table $website = null; $website = new josBC_website($db); $website->loadByURL($bc_site); if (!$website->url) { $website->loadByURL($bc_site_other); if ($website->url) { $bc_site = $bc_site_other;