Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function translator(){
- # not used right. =-=-=-= if($ob == null){ echo '<div style="visibility: visible!important; opacity: 1.0!important; display: block!important; width: 98%!important; height: auto!important; overflow: hidden!important; font-size: 1.5em;">There was an XML parsing error. Translation failed permanentaly.</div>'; }
- $obgc = ob_get_contents();
- ob_end_clean();
- if(!$obgc || $obgc = null){ return 'fail'; }
- /* if($obgc < 1){
- return '<div style="visibility: visible!important; opacity: 1.0!important; display: block!important; width: 98%!important; height: auto!important; overflow: hidden!important; font-size: 1.5em;">Translation failed permanentaly. ob_start() probably didn\'t happen.</div>';
- }
- */
- $xml = new DOMDocument();
- if($obgc === false){
- return '<div style="visibility: visible!important; opacity: 1.0!important; display: block!important; width: 98%!important; height: auto!important; overflow: hidden!important; font-size: 1.5em;">XML errors. Please validate page in XHTML Strict. Translation failed permanentaly.</div>';
- }
- if (!$xml->loadxml($obgc)) {
- $return = '<div style="visibility: visible!important; opacity: 1.0!important; display: block!important; width: 98%!important; height: auto!important; overflow: hidden!important; font-size: 1.5em;">XML errors. Please validate page in XHTML. Translation failed permanentaly.<br /><br />';
- foreach (libxml_get_errors() as $error) {
- $return .= $error.'<br/>';
- }
- libxml_clear_errors();
- return $return;
- } else {
- }
- }
- ?>
Add Comment
Please, Sign In to add comment