добре де, този цикъл нещо не го разбрах ....... значи имам ето този код
кода си работи, но искам да огранича и символите на самото заглавие на темата? :shock:
Код:
<?php
$max = "100";
$address = ""; //
$host = "localhost"; //db host, localhost?
$user = ""; //db user
$pass = ""; //db secret
$db = ""; //forum database
$show = "11"; //number of posts to show
$link = mysql_pconnect($host, $user, $pass) or die('Error connecting to mysql host!');
$db = mysql_select_db($db) or die('Error selecting database!');
$query = "SELECT DISTINCT u.username,t.topic_id,t.topic_title, x.post_text FROM phpbb_users u,phpbb_topics t, phpbb_posts p, phpbb_posts_text x WHERE t.topic_poster = u.user_id and t.topic_id = p.topic_id and t.topic_first_post_id = x.post_id order by t.topic_time desc limit 0,$show";
$result = mysql_query($query, $link) or die(mysql_error());
while ($row=mysql_fetch_array($result))
{
if (strlen($row[post_text])>$max)
{$thedots='...';}
else
{$thedots='';}
$text= substr($row[post_text],0 , $max);
$text = nl2br($text);
$text = preg_replace('/\s\s+/', ' ', $text);
echo ("<img src=\"../../images/q3.gif\" width=\"3\" height=\"5\" align=\"absmiddle\"> <a onmouseover=\"return overlib('<b>$row[username]</b>: $text$thedots');\" onmouseout=\"return nd();\" href='$address/viewtopic.php?t=$row[topic_id]' target=_blank>$row[topic_title]</a><br/>\n");
}
?>
кода си работи, но искам да огранича и символите на самото заглавие на темата? :shock: