Never been to DZone Snippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

About this user

Amy Hoy http://www.ahoyhere.com

« Newer Snippets
Older Snippets »
Showing 1-3 of 3 total  RSS 

Debugging SimpleXML Objects

AGRH@!! SimpleXML bites the big one -- you can't even var_dump it to examine the contents and the controls are terrible. Luckily, you can convert it for debugging:

   1  
   2  $sxml = simplexml_load_string($data);
   3  // .. much hate between then and now... //
   4  debugsxml($sxml);
   5  
   6  
   7  function debugsxml($sxml) {
   8      $dom = dom_import_simplexml($sxml);
   9      printArray($dom);
  10  }
  11  
  12  function printArray($array){
  13      echo '<pre>';
  14      print_r($array);
  15      echo '</pre>';
  16  }
  17  

set tinymce to use relative links

If installed under Mambo, edit:
   1  mambots/editors/tinymce_exp.php

Lines 157-158:
   1  
   2    relative_urls : true,
   3    remove_script_host : true,

fix tinymce link editor default of target:_new

When installed in Mambo, edit
   1  mambos/editors/tinymce_exp/jscripts/tiny_mce/plugins/advlink/link.php
lines 253-258:
   1  
   2  <select name="target" id="target">
   3            <option value="_self" selected>_self&nbsp;(<?php echo _insert_link_target_same ?>)</option>
   4            <option value="_blank">_blank&nbsp;(<?php echo _insert_link_target_blank ?>)</option>
   5            <!--<option value="_parent">_parent&nbsp;(<?php echo _insert_link_target_parent ?>)</option>
   6            <option value="_top">_top&nbsp;(<?php echo _insert_link_target_top ?>)</option>-->
   7  </select>
« Newer Snippets
Older Snippets »
Showing 1-3 of 3 total  RSS