Recent posts"; echo ""; $i = 0; while($row = mysql_fetch_assoc($result)) { $i = $i+1; // This is to have different color for odd/even rows echo ""; } mysql_free_result($result); // This function summarizes posts to max. 200 characters function summary($str, $limit = 200, $strip = false) { $str = ($strip == true)?strip_tags($str):$str; if (strlen ($str) > $limit) { $str = substr ($str, 0, $limit - 3); return trim(substr ($str, 0, strrpos ($str, ' ')).'...'); } return trim($str); } // TODO: put your own forum link in the last line ?>
"; // Time of post $ptime = strftime('%A, %d. %b. %Y', $row['post_time']); // Username $puser = ($row['username']=="Anonymous")?$row['anon']:$row['username']; // Post text // Removing BBCode $ppost = preg_replace('/\[[^\]]*\]/', '', $row['post_text']); // Summarizing post $ppost = summary($ppost); // Removing some leftover formatting $ppost = str_replace("", "", $ppost); // TODO: Replace nebulo.ro in the following line to the URL of your forum echo "".$ptime."
".$puser."
".$row['topic_title']."
"."
".$ppost; echo "

Forum