Correction de script

Fermé
kenny - 30 juil. 2009 à 20:43
 le père - 31 juil. 2009 à 09:17
Bonjour,

Voici mon probleme donc enfaite je suis entrain de crée une nouvelle version de mon site , et j'ai un script phpbb news.

Le soici c'est quand je les reconfigue pour la nouvelle version et bien sa m'affiche un messgage erreur voici le Script :

<?
db_connect();
$result=mysql_query("select * from phpbb_topics where forum_id='26'order by topic_time DESC limit 10");
while ($donnees=mysql_fetch_array($result))
{
$result2=mysql_query("select * from phpbb_posts where topic_id='".$donnees
['topic_id']."' order by post_time ASC limit 1");
$donnees2=mysql_fetch_array($result2);
$text=smilies($donnees2['post_text']);
$text = preg_replace('#\[b:[a-z0-9]{8}\](.+)\[/b:[a-z0-9]{8}\]#isU', '<b>$1</b>', $text);
$text = preg_replace('#\[i:[a-z0-9]{8}\](.+)\[/i:[a-z0-9]{8}\]#isU', '<i>$1</i>', $text);
$text = preg_replace('#\[u:[a-z0-9]{8}\](.+)\[/u:[a-z0-9]{8}\]#isU', '<u>$1</u>', $text);
$text = preg_replace('#\[quote:[a-z0-9]{8}="(.+)"\](.+)\[/quote:[a-z0-9]{8}\]#isU', '<div class="genmed" style="margin:5px 50px 5px 50px;"><b>$1 a &#65533;crit :</b><br /><div class="quote" style="padding:5px; margin:5px 0 5px 0;">$2</div></div>', $text);
$text = preg_replace('#\[quote:[a-z0-9]{8}\](.+)\[/quote:[a-z0-9]{8}\]#isU', '<div class="genmed" style="margin:5px 50px 5px 50px;"><b>Citation :</b><br /><div class="quote" style="padding:5px; margin:5px 0 5px 0;">$1</div></div>', $text);
$text = preg_replace('#\[code:1:[a-z0-9]{8}\](.+)\[/code:1:[a-z0-9]{8}\]#isU', '<div class="genmed" style="margin:5px 50px 5px 50px;"><b>Code :</b><br /><div class="code" style="padding:5px; margin:5px 0 5px 0; max-height:50px; overflow:auto;">$1</div></div>', $text);
$text = preg_replace('#\[color=(.+):[a-z0-9]{8}\](.+)\[/color:[a-z0-9]{8}\]#isU', '<span style="color:$1;">$2</span>', $text);
$text = preg_replace('#\[size=(.+):[a-z0-9]{8}\](.+)\[/size:[a-z0-9]{8}\]#isU', '<span style="font-size:$1;">$2</span>', $text);
$text = preg_replace('#\[urll=(.+)\](.+)\/urll\#isU', '<a href="$1">$2</a>', $text);
$text = preg_replace('#\[urll](.+)\/urll\#isU', '<a href="$1">$1</a>', $text);
$text = preg_replace('#\[img:[a-z0-9]{8}\](.+)\[/img:[a-z0-9]{8}\]#isU', '<img src="$1" />', $text);
$text = preg_replace('#\[center:[a-z0-9]{8}\](.+)\[/center:[a-z0-9]{8}\]#isU', '<center>$1</center>', $text);
$text = preg_replace('#\[youtube:[a-z0-9]{8}\](.+)\[/youtube:[a-z0-9]{8}\]#isU', '<object width="425" height="355"><param name="movie" value="$1"></param><param name="wmode" value="transparent"></param><embed src="$1" type="application/x-shockwave-flash" wmode="transparent" width="425" height="355"></embed></object>', $text);
$text = preg_replace('#\[url=(.+):[a-z0-9]{8}\](.+)\[/url:[a-z0-9]{8}\]#isU', '<a href="$1" target="_blank">$2</a>', $text);
$text = preg_replace('#\[url:[a-z0-9]{8}](.+)\[/url:[a-z0-9]{8}\]#isU', '<a href="$1" target=_blank>$1</a>', $text);
$text = preg_replace('#\[dailymotion:[a-z0-9]{8}\](.+)\[/dailymotion:[a-z0-9]{8}\]#isU', '<div><object width="480" height="381"><param name="movie" value="$1"></param><param name="allowFullScreen" value="true"></param><param name="allowScriptAccess" value="always"></param><embed src="$1" type="application/x-shockwave-flash" width="480" height="381" allowFullScreen="true" allowScriptAccess="always"></embed></object><br /><b><a href=""></a></b><br /><i><a href=""></a> <a href="https://www.dailymotion.com/fr/channel/videogames"></a></i></div>', $text);
$time=date('d/m/Y à H:i', $donnees['topic_time']);
$title=$donnees2['post_subject'];
$titre=$donnees['post_subject'];
echo '
<tr> <h1>'.$title.'</h1><div class="text"><div align='center'></div>
	<br />'.nl2br($text).' </div><div class="auteur">Posté par <strong>'.$donnees['topic_first_poster_name'].'</strong> le '.$time.'.&nbsp;&nbsp;&nbsp; &nbsp; <a href="/forums/viewtopic.php?t='.$donnees['topic_id'].'"> Poster / Voir commentaire.&nbsp;('.$donnees['topic_replies'].')</a></div></tr>
';
}
?>


Et voici la message erreur :

Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in /homepages/23/d290938342/htdocs/v2/index.php on line 130
A voir également:

1 réponse

Bonjour

La prochaine fois, dis-nous quelle est la ligne 130, ce sera plus facile...
Vers la fin, remplace
<tr> <h1>'.$title.'</h1><div class="text"><div align='center'></div>

par
<tr> <h1>'.$title.'</h1><div class="text"><div align=\'center\'></div>

(\'center\' au lieu de 'center')
1