i have done that:
if someone can look if it seems good.
thx a lot
original code
[c]
{
$result2 = $db->query('SELECT posted, poster, poster_id, message, hide_smilies FROM '.$db->prefix.'posts WHERE topic_id='.$cur_topic['id'].' ORDER BY posted ASC LIMIT 1') or error('Impossible de récupérer la liste des sujets', __FILE__, __LINE__, $db->error());
$cur_post = $db->fetch_assoc($result2);
$message = parse_message($cur_post['message'], $cur_post['hide_smilies']);
$message = str_replace('img/smilies/', $pun_config['o_base_url'].'/img/smilies/', $message);
$search = array(
'<titre_news>',
'<date_news>',
'<nom_auteur>',
'<url_profil_auteur>',
'<message_news>',
'<url_news>'
);
$replace = array(
pun_htmlspecialchars($cur_topic['subject']),
date($pun_config['o_date_format'].' '.$pun_config['o_time_format'], $cur_post['posted']),
pun_htmlspecialchars($cur_post['poster']),
$pun_config['o_base_url'].'/profile.php?id='.$cur_post['poster_id'],
$message,
$pun_config['o_base_url'].'/viewtopic.php?id='.$cur_topic['id']
);
fwrite($fh, str_replace($search, $replace, $news_tpl));
}
[/c]
modified code
[c]
{
$result2 = $db->query('SELECT posted, poster, poster_id, message, hide_smilies FROM '.$db->prefix.'posts WHERE topic_id='.$cur_topic['id'].' ORDER BY posted ASC LIMIT 1') or error('Impossible de récupérer la liste des sujets', __FILE__, __LINE__, $db->error());
$cur_post = $db->fetch_assoc($result2);
$message = parse_message($cur_post['message'], $cur_post['hide_smilies']);
$message = str_replace('img/smilies/', $pun_config['o_base_url'].'/img/smilies/', $message);
$message_light = substr("$message", 0, 200); // n'affiche que les 200 premeirs caracteres
$search = array(
'<titre_news>',
'<date_news>',
'<nom_auteur>',
'<url_profil_auteur>',
'<message_news>',
'<url_news>'
);
$replace = array(
pun_htmlspecialchars($cur_topic['subject']),
date($pun_config['o_date_format'].' '.$pun_config['o_time_format'], $cur_post['posted']),
pun_htmlspecialchars($cur_post['poster']),
$pun_config['o_base_url'].'/profile.php?id='.$cur_post['poster_id'],
$message_light,
$pun_config['o_base_url'].'/viewtopic.php?id='.$cur_topic['id']
);
fwrite($fh, str_replace($search, $replace, $news_tpl));
}
[/c]