Ejemplo n.º 1
0
to revoke the Software license at any time. 
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
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.
*/
if (!defined('CCADMIN')) {
    echo "NO DICE";
    exit;
}
$online = onlineusers();
$navigation = <<<EOD
\t<div id="leftnav">
\t\t<h1 style="font-size:70px;font-weight:bold">{$online}</h1>
\t\t<span style="font-size:10px">USERS ONLINE</span>
\t</div>
EOD;
function index()
{
    global $body;
    global $navigation;
    $body = <<<EOD
\t{$navigation}
\t<div id="rightcontent" style="float:left;width:720px;border-left:1px dotted #ccc;padding-left:20px;">
\t\t<h2>Monitor</h2>
\t\t<h3>See what users are typing in real-time on your site</h3>
Ejemplo n.º 2
0
function index()
{
    global $body;
    global $currentversion;
    $stats = '';
    if (USE_COMET == 1 && SAVE_LOGS == 0) {
        $stats = <<<EOD

\t\t <div style="float: left; padding-right: 20px; border-right: 1px dotted rgb(204, 204, 204); margin-right: 20px; width: 400px;">
\t\t\t<h1 style="font-size: 50px; font-weight: bold;"></h1>
\t\t</div>

EOD;
    } else {
        $onlineusers = onlineusers();
        $sql = "select count(id) totalmessages from cometchat";
        $query = mysqli_query($GLOBALS['dbh'], $sql);
        $r = mysqli_fetch_assoc($query);
        $totalmessages = $r['totalmessages'];
        if (empty($totalmessages)) {
            $totalmessages = '0';
        }
        $now = getTimeStamp() - 60 * 60 * 24;
        $sql = "select count(id) totalmessages from cometchat where sent >= {$now}";
        $query = mysqli_query($GLOBALS['dbh'], $sql);
        $r = mysqli_fetch_assoc($query);
        $totalmessagest = $r['totalmessages'];
        $stats = <<<EOD

\t\t<div style="float:left;padding-right:20px;border-right:1px dotted #cccccc;margin-right:20px;">
\t\t\t<h1 style="font-size: 50px; font-weight: bold;">{$onlineusers}</h1>
\t\t\t<span style="font-size: 10px;">USERS CHATTING</span>
\t\t</div>

\t\t<div style="float:left;padding-right:20px;border-right:1px dotted #cccccc;margin-right:20px;">
\t\t\t<h1 style="font-size: 50px; font-weight: bold;">{$totalmessages}</h1>
\t\t\t<span style="font-size: 10px;">TOTAL MESSAGES</span>
\t\t</div>

\t\t<div style="float:left;padding-right:20px;border-right:1px dotted #cccccc;margin-right:20px;width:100px;">
\t\t\t<h1 style="font-size: 50px; font-weight: bold;">{$totalmessagest}</h1>
\t\t\t<span style="font-size: 10px;">MESSAGES SENT IN THE LAST 24 HOURS</span>
\t\t</div>

EOD;
    }
    $detectchangepass = '******';
    if (ADMIN_USER == 'cometchat' && ADMIN_PASS == 'cometchat') {
        $detectchangepass = '******';
    }
    if (empty($totalmessages)) {
        $totalmessages = 0;
    }
    $body = <<<EOD
<h2>Welcome</h2>
<h3>{$detectchangepass}</h3>


\t<div style="float:left">

\t\t{$stats}
\t\t<div style="clear:both;padding:10px;"></div>

\t\t<div style="float:left;padding-right:20px;border-right:1px dotted #cccccc;margin-right:20px;">
\t\t\t<h1 style="font-size: 70px; font-weight: bold;">{$currentversion}</h1>
\t\t\t<span style="font-size: 10px;">YOUR COMETCHAT VERSION</span>
\t\t</div>

\t\t<div style="clear:both;padding:20px;"></div>

\t\t<div style="width:450px;font-family:helvetica;line-height:1.4em;font-size:14px;">
\t\t\t<span style="font-weight:bold;">Love CometChat?</span><br/>Take a minute to <a href="http://bit.ly/9cgHKS" target="_blank">write us a testimonial</a> :)
\t\t</div>


\t</div>
\t<div style="float:right">
\t\t<iframe width="100%" height="100%" frameborder="0" style="border:1px solid #ccc;width:400px;height:500px;" scrolling="no" src="//www.facebook.com/plugins/likebox.php?href=http://www.facebook.com/CometChat&amp;width=800&amp;height=500&amp;show_faces=true&amp;colorscheme=light&amp;stream=true&amp;border_color=%23ffffff&amp;header=false"></iframe>
\t</div>


<div style="clear:both"></div>

EOD;
    template();
}
Ejemplo n.º 3
0
function index()
{
    global $body;
    global $currentversion;
    $stats = '';
    $onlineusers = onlineusers();
    $sql = "select count(id) totalmessages from cometchat";
    $query = mysqli_query($GLOBALS['dbh'], $sql);
    $r = mysqli_fetch_assoc($query);
    $totalmessages = $r['totalmessages'];
    if (empty($totalmessages)) {
        $totalmessages = '0';
    }
    $now = getTimeStamp() - 60 * 60 * 24;
    $sql = "select count(id) totalmessages from cometchat where sent >= '" . mysqli_real_escape_string($GLOBALS['dbh'], $now) . "'";
    $query = mysqli_query($GLOBALS['dbh'], $sql);
    $r = mysqli_fetch_assoc($query);
    $totalmessagest = $r['totalmessages'];
    $stats = <<<EOD

\t<div style="float:left;padding-right:20px;border-right:1px dotted #cccccc;margin-right:20px;">
\t\t<h1 style="font-size: 50px; font-weight: bold;">{$onlineusers}</h1>
\t\t<span style="font-size: 10px;">USERS CHATTING</span>
\t</div>

\t<div style="float:left;padding-right:20px;border-right:1px dotted #cccccc;margin-right:20px;">
\t\t<h1 style="font-size: 50px; font-weight: bold;">{$totalmessages}</h1>
\t\t<span style="font-size: 10px;">TOTAL MESSAGES</span>
\t</div>

\t<div style="float:left;padding-right:20px;border-right:1px dotted #cccccc;margin-right:20px;width:100px;">
\t\t<h1 style="font-size: 50px; font-weight: bold;">{$totalmessagest}</h1>
\t\t<span style="font-size: 10px;">MESSAGES SENT IN THE LAST 24 HOURS</span>
\t</div>

EOD;
    $detectchangepass = '******';
    if (ADMIN_USER == 'cometchat' && ADMIN_PASS == 'cometchat') {
        $detectchangepass = '******';
    }
    if (empty($totalmessages)) {
        $totalmessages = 0;
    }
    $body = <<<EOD
<h2>Welcome</h2>
<h3>{$detectchangepass}</h3>


\t<div style="float:left">

\t\t{$stats}
\t\t<div style="clear:both;padding:10px;"></div>

\t\t<div style="float:left;padding-right:20px;border-right:1px dotted #cccccc;margin-right:20px;">
\t\t\t<h1 style="font-size: 70px; font-weight: bold;">{$currentversion}</h1>
\t\t\t<span style="font-size: 10px;">YOUR COMETCHAT VERSION</span>
\t\t</div>

\t\t<div style="clear:both;padding:20px;"></div>

\t\t<div style="width:450px;font-family:helvetica;line-height:1.4em;font-size:14px;">
\t\t\t<span style="font-weight:bold;">Love CometChat?</span><br/>Take a minute to <a href="https://www.cometchat.com/reviews/write/" target="_blank">write us a testimonial</a> :)
\t\t</div>


\t</div>
\t<div style="float:right">
\t\t<iframe src="https://www.facebook.com/plugins/page.php?href=https%3A%2F%2Fwww.facebook.com%2FCometChat%2F&tabs=timeline&width=500&height=300&small_header=true&adapt_container_width=true&hide_cover=true&show_facepile=false&appId=143961562477205" width="500" height="300" style="border:none;overflow:hidden" scrolling="no" frameborder="0" allowTransparency="true"></iframe>
\t</div>


<div style="clear:both"></div>

EOD;
    template();
}
Ejemplo n.º 4
0
function index()
{
    global $body;
    global $currentversion;
    $onlineusers = onlineusers();
    $sql = "select max(id) totalmessages from cometchat";
    $query = mysql_query($sql);
    $r = mysql_fetch_array($query);
    $totalmessages = $r['totalmessages'];
    $now = getTimeStamp() - 60 * 60 * 24;
    $sql = "select count(id) totalmessages from cometchat where sent >= {$now}";
    $query = mysql_query($sql);
    $r = mysql_fetch_array($query);
    $totalmessagest = $r['totalmessages'];
    $detectchangepass = '******';
    if ($_SESSION['cometchat']['cometchat_admin_user'] == 'cometchat' && $_SESSION['cometchat']['cometchat_admin_pass'] == 'cometchat') {
        $detectchangepass = '******';
    }
    if (empty($totalmessages)) {
        $totalmessages = 0;
    }
    $body = <<<EOD
<h2>Welcome</h2>
<h3>{$detectchangepass}</h3>


\t<div style="float:left">
\t\t<div style="float:left;padding-right:20px;border-right:1px dotted #cccccc;margin-right:20px;">
\t\t\t<h1 style="font-size: 50px; font-weight: bold;">{$onlineusers}</h1>
\t\t\t<span style="font-size: 10px;">USERS CHATTING</span>
\t\t</div>

\t\t<div style="float:left;padding-right:20px;border-right:1px dotted #cccccc;margin-right:20px;">
\t\t\t<h1 style="font-size: 50px; font-weight: bold;">{$totalmessages}</h1>
\t\t\t<span style="font-size: 10px;">TOTAL MESSAGES</span>
\t\t</div>

\t\t<div style="float:left;padding-right:20px;border-right:1px dotted #cccccc;margin-right:20px;width:100px;">
\t\t\t<h1 style="font-size: 50px; font-weight: bold;">{$totalmessagest}</h1>
\t\t\t<span style="font-size: 10px;">MESSAGES SENT IN THE LAST 24 HOURS</span>
\t\t</div>
\t\t
\t\t<div style="clear:both;padding:10px;"></div>

\t\t<div style="float:left;padding-right:20px;border-right:1px dotted #cccccc;margin-right:20px;">
\t\t\t<h1 style="font-size: 70px; font-weight: bold;">{$currentversion}</h1>
\t\t\t<span style="font-size: 10px;">YOUR COMETCHAT VERSION</span>
\t\t</div>

\t\t<div style="clear:both;padding:20px;"></div>

\t\t<div style="width:450px;font-family:helvetica;line-height:1.4em;font-size:14px;">
\t\t\t<span style="font-weight:bold;">Love CometChat?</span><br/>Take a minute to <a href="http://bit.ly/9cgHKS" target="_blank">write us a testimonial</a> :)
\t\t</div>
\t\t

\t</div>
\t<div style="float:right">
\t\t<iframe width="100%" height="100%" frameborder="0" style="border:1px solid #ccc;width:380px;height:300px;" scrolling="no"\tsrc="http://www.facebook.com/connect/connect.php?id=&amp;name=cometchat&amp;connections=7&amp;stream=1&amp;css=http://www.cometchat.com/facebook2.css?v3"></iframe>
\t</div>


<div style="clear:both"></div>
\t
EOD;
    template();
}
Ejemplo n.º 5
0
function data()
{
    if (USE_COMET == 1 && SAVE_LOGS == 0) {
        echo 0;
    } else {
        global $guestsMode;
        global $guestnamePrefix;
        if (!empty($guestnamePrefix)) {
            $guestnamePrefix .= '-';
        }
        $usertable = TABLE_PREFIX . DB_USERTABLE;
        $usertable_username = DB_USERTABLE_NAME;
        $usertable_userid = DB_USERTABLE_USERID;
        $guestpart = "";
        $criteria = "cometchat.id > '" . mysqli_real_escape_string($GLOBALS['dbh'], $_POST['timestamp']) . "' and ";
        $criteria2 = 'desc';
        if ($guestsMode) {
            $guestpart = "UNION (select cometchat.id id, cometchat.from, cometchat.to, cometchat.message, cometchat.sent, cometchat.read,CONCAT('{$guestnamePrefix}',f.name) fromu, CONCAT('{$guestnamePrefix}',t.name) tou from cometchat, cometchat_guests f, cometchat_guests t where {$criteria} f.id = cometchat.from and t.id = cometchat.to) UNION (select cometchat.id id, cometchat.from, cometchat.to, cometchat.message, cometchat.sent, cometchat.read, f." . $usertable_username . " fromu, CONCAT('{$guestnamePrefix}',t.name) tou from cometchat, " . $usertable . " f, cometchat_guests t where {$criteria} f." . $usertable_userid . " = cometchat.from and t.id = cometchat.to) UNION (select cometchat.id id, cometchat.from, cometchat.to, cometchat.message, cometchat.sent, cometchat.read, CONCAT('{$guestnamePrefix}',f.name) fromu, t." . $usertable_username . " tou from cometchat, cometchat_guests f, " . $usertable . " t where {$criteria} f.id = cometchat.from and t." . $usertable_userid . " = cometchat.to) ";
        }
        $response = array();
        $messages = array();
        if (empty($_POST['timestamp'])) {
            $criteria = '';
            $criteria2 = 'desc limit 20';
        }
        $sql = "(select cometchat.id id, cometchat.from, cometchat.to, cometchat.message, cometchat.sent, cometchat.read, f.{$usertable_username} fromu, t.{$usertable_username} tou from cometchat, {$usertable} f, {$usertable} t where {$criteria} f.{$usertable_userid} = cometchat.from and t.{$usertable_userid} = cometchat.to ) " . $guestpart . " order by id {$criteria2}";
        $query = mysqli_query($GLOBALS['dbh'], $sql);
        $timestamp = $_POST['timestamp'];
        while ($chat = mysqli_fetch_assoc($query)) {
            if (function_exists('processName')) {
                $chat['fromu'] = processName($chat['fromu']);
                $chat['tou'] = processName($chat['tou']);
            }
            $time = $chat['sent'] * 1000;
            if (strpos($chat['message'], 'CC^CONTROL_') === false) {
                array_unshift($messages, array('id' => $chat['id'], 'from' => $chat['from'], 'to' => $chat['to'], 'fromu' => $chat['fromu'], 'tou' => $chat['tou'], 'message' => $chat['message'], 'time' => $time));
            }
            if ($chat['id'] > $timestamp) {
                $timestamp = $chat['id'];
            }
        }
        $response['timestamp'] = $timestamp;
        $response['online'] = onlineusers();
        if (!empty($messages)) {
            $response['messages'] = $messages;
        }
        header('Content-type: application/json; charset=utf-8');
        echo json_encode($response);
    }
    exit;
}
Ejemplo n.º 6
0
function data()
{
    global $guestsMode;
    global $guestnamePrefix;
    $usertable = TABLE_PREFIX . DB_USERTABLE;
    $usertable_username = DB_USERTABLE_NAME;
    $usertable_userid = DB_USERTABLE_USERID;
    $guestpart = "";
    $criteria = "cometchat.id > '" . mysqli_real_escape_string($GLOBALS['dbh'], $_POST['timestamp']) . "' and ";
    $criteria2 = 'desc';
    if ($guestsMode) {
        $guestpart = "UNION (select cometchat.id id, cometchat.from, cometchat.to, cometchat.message, cometchat.sent, cometchat.read,CONCAT('{$guestnamePrefix}',f.name) fromu, CONCAT('{$guestnamePrefix}',t.name) tou from cometchat, cometchat_guests f, cometchat_guests t where {$criteria} f.id = cometchat.from and t.id = cometchat.to) UNION (select cometchat.id id, cometchat.from, cometchat.to, cometchat.message, cometchat.sent, cometchat.read, f." . $usertable_username . " fromu, CONCAT('{$guestnamePrefix}',t.name) tou from cometchat, " . $usertable . " f, cometchat_guests t where {$criteria} f." . $usertable_userid . " = cometchat.from and t.id = cometchat.to) UNION (select cometchat.id id, cometchat.from, cometchat.to, cometchat.message, cometchat.sent, cometchat.read, CONCAT('{$guestnamePrefix}',f.name) fromu, t." . $usertable_username . " tou from cometchat, cometchat_guests f, " . $usertable . " t where {$criteria} f.id = cometchat.from and t." . $usertable_userid . " = cometchat.to) ";
    }
    $response = array();
    $messages = array();
    if (empty($_POST['timestamp'])) {
        $criteria = '';
        $criteria2 = 'desc limit 20';
    }
    $sql = "(select cometchat.id id, cometchat.from, cometchat.to, cometchat.message, cometchat.sent, cometchat.read, f.{$usertable_username} fromu, t.{$usertable_username} tou from cometchat, {$usertable} f, {$usertable} t where {$criteria} f.{$usertable_userid} = cometchat.from and t.{$usertable_userid} = cometchat.to ) " . $guestpart . " order by id {$criteria2}";
    $query = mysqli_query($GLOBALS['dbh'], $sql);
    $timestamp = $_POST['timestamp'];
    while ($chat = mysqli_fetch_assoc($query)) {
        if (function_exists('processName')) {
            $chat['fromu'] = processName($chat['fromu']);
            $chat['tou'] = processName($chat['tou']);
        }
        $time = $chat['sent'] * 1000;
        if (strpos($chat['message'], 'CC^CONTROL_') === false) {
            array_unshift($messages, array('id' => $chat['id'], 'from' => $chat['from'], 'to' => $chat['to'], 'fromu' => $chat['fromu'], 'tou' => $chat['tou'], 'message' => $chat['message'], 'time' => $time));
        } elseif (strpos($chat['message'], 'sendSticker')) {
            $message = str_replace('CC^CONTROL_', '', $chat['message']);
            $message = json_decode($message);
            $category = $message->params->category;
            $key = $message->params->key;
            $image = '<img class="cometchat_stickerImage" type="image" src="' . BASE_URL . '/plugins/stickers/images/' . $category . '/' . $key . '.png">';
            array_unshift($messages, array('id' => $chat['id'], 'from' => $chat['from'], 'to' => $chat['to'], 'fromu' => $chat['fromu'], 'tou' => $chat['tou'], 'message' => $image, 'time' => $time));
        }
        if ($chat['id'] > $timestamp) {
            $timestamp = $chat['id'];
        }
    }
    $response['timestamp'] = $timestamp;
    $response['online'] = onlineusers();
    if (!empty($messages)) {
        $response['messages'] = $messages;
    }
    header('Content-type: application/json; charset=utf-8');
    echo json_encode($response);
    exit;
}