'; $xml_doc = new DOMDocument(); $xml_doc->load($xml_url); //echo "xx"; die(0); $xml_doc->preserveWhiteSpace = false; //ob_clean(); $xml_doc->saveXML(); die(0); $head_text = $xml_doc->getElementsByTagname('head_text')->item(0)->nodeValue; //ob_clean(); echo $head_text; die(0); $body_html = $xml_doc->getElementsByTagname('body_html')->item(0)->nodeValue; //ob_clean(); echo $body_html; die(0); $body_html = post_process($body_html); $body_html = fix_url($body_html); } else { echo "Missing news ID"; } function arr2url($arr) { $st = ""; foreach($arr as $k=>$v) $st.=($k."=".urlencode($v)."&"); return substr($st,0,-1); } function post_process($st) { global $prm; $s[] = '/forum/attachment.php?'; $r[] = '/2010/apps/vb_news/xmls/get_news_image_v0.03_vb.php?db='.$prm['db'].'&'; return str_replace($s,$r,$st); } function fix_url($st) { // ob_clean(); echo $GLOBALS['site']['server_name']; die(0); if($GLOBALS['html']['config']['site']['name']=='2011p.star-board.com') { $s[] = 'http://www.star-board.com'; $r[] = 'http://2010p.star-board.com'; } if($GLOBALS['html']['config']['site']['name']=='www.star-board.com') { $s[] = 'http://2010p.star-board.com'; $r[] = 'http://www.star-board.com'; } return str_replace($s,$r,$st); } ?>