--- outline_designer.module	2008-03-27 15:12:00.000000000 -0400
+++ outline_designer.module.new	2008-03-31 14:48:07.000000000 -0400
@@ -117,7 +117,7 @@
     '#suffix' => $packaged_icons,
   );
   $content_types = array();
-  $result = db_query("SELECT type,name FROM node_type");
+  $result = db_query("SELECT type,name FROM {node_type}");
   while($value = db_fetch_array($result)){
     array_push($content_types,t($value['type']));
     //create a textfield incase they want to enter an icon that way
@@ -167,7 +167,7 @@
   $dir = file_create_path(file_directory_path() . '/outline_designer');
   $is_writable = file_check_directory($dir, 1);
   if($is_writable) { 
-    $result = db_query("SELECT type,name FROM node_type");
+    $result = db_query("SELECT type,name FROM {node_type}");
     while($value = db_fetch_array($result)){
       $source = file_check_upload("outline_designer_" . $value['type'] . "_icon");   
       // Security measure to prevent exploit of file.php.png
@@ -280,7 +280,7 @@
 */
 function _outline_designer_tree_recurse($nid, $tree = array()) {
   global $user;
-  $result = db_query("SELECT node.uid,node.nid,parent,title,type FROM book JOIN node ON node.vid=book.vid WHERE book.parent=" . $nid . " ORDER BY weight");
+  $result = db_query("SELECT n.uid,n.nid,parent,title,type FROM {book} as b JOIN {node} as n ON n.vid=b.vid WHERE b.parent=%d ORDER BY weight", $nid);
   while($value = db_fetch_array($result)){
     if($value['type'] == 'book'){
     $term = 'pages';
@@ -309,7 +309,7 @@
 * this only returns the nids that will neeed to be converted during the duplication process, it is a helper function for the duplicate ajax command
 */
 function _outline_designer_recurse_duplicate_nodes($nid, $tree = array()) {
-  $result = db_query("SELECT node.nid FROM book JOIN node ON node.vid=book.vid WHERE book.parent=" .$nid . " ORDER BY weight");
+  $result = db_query("SELECT n.nid FROM {book} as b JOIN {node} as n ON n.vid=b.vid WHERE b.parent=%d ORDER BY weight", $nid);
   while($value = db_fetch_array($result)){
     $tree[$value['nid']] = 0;
     $tree = _outline_designer_recurse_duplicate_nodes($value['nid'],$tree);
