$threadid,'db'=>$GLOBALS['config']['apps']['vb_news']['db'])); $xml_url = $xml_svr."/2010/apps/vb_news/xmls/get_news_content_v0.04_vb.php?$prm_st"; //echo $xml_url; die(0); echo ''; $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) { $s[] = '/forum/attachment.php?'; $r[] = '/2010/apps/vb_news/xmls/get_news_image_v0.03_vb.php?db='.$GLOBALS['config']['apps']['vb_news']['db'].'&'; return str_replace($s,$r,$st); } function fix_url($st) { // ob_clean(); echo $GLOBALS['site']['server_name']; die(0); if($GLOBALS['site']['server_name']=='2010p.star-board.com') { $s[] = 'http://www.star-board.com'; $r[] = 'http://2010p.star-board.com'; } if($GLOBALS['site']['server_name']=='www.star-board.com') { $s[] = 'http://2010p.star-board.com'; $r[] = 'http://www.star-board.com'; } return str_replace($s,$r,$st); } ?>