1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
|
...
function getSBMsg() {
/* Get Messages for this user */
global $db, $config;
$ret = '';
$msg_cnt = ($config['shoutbox_msg_dispcnt']>0)?$config['shoutbox_msg_dispcnt']:20;
$sql = 'select * from ! order by act_time desc ';
if ($_REQUEST['cnt'] == '0' or $_REQUEST['cnt'] == '' or !isset($_REQUEST['cnt'])) $sql.= ' limit 0,'.$msg_cnt;
$messages = $db->getAll($sql, array(SHOUTBOX_TABLE) );
if (count($messages) <= 0) return '';
$ret='<table border="0" cellpadding="0" cellspacing="0" width="90%" ><tr><td height="5"></td></tr>';
foreach ($messages as $msg) {
$ret .= '<tr><td width="100%" >';
if ($msg['from_user'] != '-1') {
/* Not visitor */
$ret.='<a href="javascript:popUpScrollWindow2(\''.DOC_ROOT;
if ($config['enable_mode_rewrite'] == 'Y') {
/* Mode rewrite SEO friendly tags*/
if ($config['seo_username'] == 'Y') {
/* Username tag */
$ret.=$msg['username'];
} else {
$ret.=$msg['from_user'].'.htm';
}
} else {
$ret.= 'showprofile.php?';
if ($config['seo_username'] == 'Y') {
$ret.='username='.$msg['username'];
}else{
$ret.='id='.$msg['from_user'];
}
}
$ret.="','top',650,600)\">";
$ret.=$msg['username']."</a>";
} else{
$ret.=$msg['username'];
}
$ret.=' a dit [<i>'.date(SHOUTBOX_TIME_FORMAT, $msg['act_time']).'</i>] : <font color="#000066"><b>'.stripslashes($msg['message']).'</b></font>';
$ret.='<tr><td height="4"></td></tr>';
}
$ret.='</table>';
return $ret;
}
?> |
Partager