Example #1
0
$j('div.mypanel').hide();
$j('#panelt1').show();
$j('ul.tabs li').css('cursor', 'pointer');
});
</script>
</head>
<body>
<div id="mypanelbody">
<?php 
global $db, $current_user;
if (empty($db)) {
    $db = DBManagerFactory::getInstance();
}
$myTmp = mktime(5, 0, 0, date('m'), date('d') - 15, date('Y'));
require_once 'modules/let_Chat/helper.php';
$helper = new chatHelper();
$all = '';
//ALL MESS
$q = "SELECT mh.id, mh.id as sortid, mh.user as nickname, mh.msg as message, mh.time, mh.foruser, u1.first_name, u1.last_name\n\t\t\t\t\t\t FROM messages_history mh\n\t\t\t\t\t\t LEFT JOIN users u1 ON u1.user_name = mh.user AND u1.deleted = 0\n\t\t\t\t\t\t WHERE mh.foruser = '******' AND mh.time>=" . $myTmp . " ORDER BY sortid";
$q = $helper->escapeSQL($q);
//Taras 2012-12-21
$result = $db->query($q);
while (($message = $db->fetchByAssoc($result)) != null) {
    $message['message'] = htmlspecialchars(stripslashes($message['message']));
    $all .= '<div class="shoutbox-list">' . '<span class="shoutbox-list-time">' . date($GLOBALS['timedate']->get_date_time_format(), $message['time']) . '</span>' . '<span class="shoutbox-list-nick">' . $helper->format_display_name($message['nickname'], $message['first_name'], $message['last_name']) . ':</span>' . '<span class="shoutbox-list-message">' . $message['message'] . '</span>' . '</div>';
}
?>
	<ul class="tabs tabs1">
		<li class="t1 tab-current"><a>All (15 days)</a></li>
	</ul>
Example #2
0
*
* You can contact Letrium Ltd. at email address crm@letrium.com.
*
* SimpleChat version 3.5.2, Copyright (C) Letrium Ltd., Taras Machyshyn.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Letrium" label.
*
*For more information on how to apply and follow the GNU GPL, see http://www.gnu.org/licenses.
********************************************************************************/
global $db, $current_user;
if (empty($db)) {
    $db = DBManagerFactory::getInstance();
}
require_once 'modules/let_Chat/helper.php';
$helper = new chatHelper();
$display_num = $helper->display_num;
$user_timeout = $helper->user_timeout;
// seconds
$prefix = 'messages';
//deprecated
$timestamp = time();
$time = time();
/*$q = "SELECT otop, oleft FROM ".$prefix."_online WHERE usr_id='".$current_user->id."' limit 0,1" ;
$result = $db->query($q);
while (($message = $db->fetchByAssoc($result)) != null) {
	$otop =  $message['otop'];
  	$oleft =  $message['oleft'];
    $collapsed=$message['collapsed'];
} */
$q = "DELETE FROM messages_online WHERE usr_id='" . $current_user->id . "' OR ({$timestamp}-rtime)>{$user_timeout}";