function printpage ($left, $right, $title, $content_main, $editor="") {
global $DB, $Skin, $mklib_board, $mkportals;
// parse content if there is header. Remove header and other duplicates tag
$board_header = "";
$pos = strpos($content_main, "<head>");
$pos2 = strpos($content_main, "</head>");
if ($pos && $pos2) {
$board_header = substr($content_main, ($pos +6), ($pos2 - $pos -6));
$content_main = substr($content_main, $pos2);
$content_main = str_replace ("</head>", "", $content_main);
$content_main = str_replace ("<body>", "", $content_main);
$content_main = str_replace ("</body>", "", $content_main);
$content_main = str_replace ("</html>", "", $content_main);
$content_main = "<tr><td valign=\"top\">".$content_main."</td></tr>";
}
//end parse
$output = $this->header($title, $left, $right, $board_header);
if ($this->loadcolumnleft) {
$output .= $this->block_left();
}
$content_main = str_replace('©2004-2005 All rights reserved', '<a href="http://www.gulfson.com" target="_blank">تعريب وتطوير شبكة ابن الخليج</a>', $content_main);
$output .= $this->block_center($content_main);
if ($this->loadcolumnright) {
$output .= $this->block_right();
}
$output .= $editor;
$output .= $this->footer();
print $output;
$this->update_counter();
$DB->close_db();
exit;
}