"'",
"(à)"=>"à",
"(â)"=>"â",
"(ä)"=>"ä",
"(ç)"=>"ç",
"(è)"=>"è",
"(é)"=>"é",
"(ê)"=>"ê",
"(ë)"=>"ë",
"(î)"=>"î",
"(ï)"=>"ï",
"(ô)"=>"ô",
"(ö)"=>"ö",
"(ù)"=>"ù",
"(ü)"=>"ü",
"(û)"=>"û",
"(«)"=>"«",
"(»)"=>"»",
"(©)"=>"©",
"(§)"=>"¶",
);
// Use this function only if the format differs
function convert($content)
{
$len = count($cvt);
while($htmlchar = current($cvt))
{
$letter = key($cvt);
preg_replace($letter, $htmlchar, $content);
next($cvt);
}
return $content;
}
// Use to convert to UTF-8
function makeUTF($desc)
{
$desc = UTF8_encode($desc);
$desc = stripslashes($desc);
return($desc);
}
function display($host, $dbname, $dbuser, $password, $size)
{
global $site;
global $forum;
global $topiclist;
global $table_prefix;
$db = @mysql_connect($host, $dbuser,$password);
mysql_select_db($dbname);
$posts = $table_prefix."posts";
$users = $table_prefix."users";
$top = $table_prefix."topics";
$sql = "SELECT TOP.topic_id, TOP.topic_title, TOP.topic_time, USER.username
FROM $posts REF, $users USER, $top TOP
WHERE REF.post_id = TOP.topic_first_post_id
AND TOP.topic_poster = USER.user_id
ORDER BY REF.post_time DESC LIMIT $size";
// optionally: AND TOP.forum_id IN (1,2,4,5, ...)
$results = mysql_query($sql) or die(mysql_error());
// Extracting and displaying titles
while($line = mysql_fetch_assoc($results))
{
$title = $line['topic_title'];
//$title = $line['post_subject'];
$url = $forum . "viewtopic.php?t=" . $line['topic_id'];
if($formatflag) $title = convert($title);
$username = $line['username'];
$date = strftime("%A %B %e, %Y %H:%M", $line['topic_time']+(0));
echo "$title by $username $date
\n";
}
}
if(substr($site, -1, 1) != "/") $site = $site. "/";
$forum = $site . $forumdir;
if(substr($forum,-1, 1) != "/") $forum = $forum. "/";
include($forumdir."config.php");
if (! PHPBB_INSTALLED) die("phpBB not installed in $forumdir");
display($dbhost, $dbname , $dbuser, $dbpasswd , 10);
?>