diff -a -x Root -x Repository -x Tag -x Entries -x Entries.Log -x .svn -x '*.rej' -x '*.orig' -N -r -u ./src/daemon/common/commonFile.ml ./src/daemon/common/commonFile.ml
--- ./src/daemon/common/commonFile.ml	2006-11-09 22:32:26.000000000 +0100
+++ ./src/daemon/common/commonFile.ml	2006-11-10 10:59:10.000000000 +0100
@@ -92,9 +92,8 @@
     mutable op_file_active_sources : ('a -> client list);
     mutable op_file_comment : ('a -> string);
     mutable op_file_set_priority : ('a -> int -> unit);
-    mutable op_file_print_plain : ('a -> Buffer.t -> unit);
-    mutable op_file_print_html : ('a -> Buffer.t -> unit);
-    mutable op_file_print_sources_html : ('a -> Buffer.t -> unit);
+    mutable op_file_print : ('a -> CommonTypes.ui_conn -> unit);
+    mutable op_file_print_sources : ('a -> CommonTypes.ui_conn -> unit);
     mutable op_file_files : ('a -> 'a file_impl -> file list);    
 (* added in 2.5.27 to remove use of network names in global modules *)
     mutable op_file_debug : ('a -> string);
@@ -366,7 +365,9 @@
   try impl.impl_file_ops.op_file_active_sources impl.impl_file_val with _ -> []
 
 (* Default for networks that don't implement it *)
-let default_file_print_sources_html file buf =
+let default_file_print_sources file o =
+  let buf = o.conn_buf in
+  if use_html_mods o then begin
   let cfile = as_file file in
   let allsources = ref (file_all_sources cfile) in
   if List.length !allsources > 0 then begin
@@ -408,20 +409,26 @@
     Printf.bprintf buf "\\</table\\>\\</div\\>\\<br\\>";
 
   end
+  end
+  else
+    let cfile = as_file file in
+    let srcs = ref (file_all_sources cfile) in
+      Printf.bprintf buf "%d sources:\n" (List.length !srcs);
+    let print_source c =
+      Printf.bprintf buf "  [%4d] " (client_num c);
+      client_bprint c buf;
+    in
+    List.iter print_source !srcs;
+    ()
 
-
-let file_print_sources_html (file : file) buf =
+let file_print_sources (file : file) conn =
   let file = as_file_impl file in
-  try file.impl_file_ops.op_file_print_sources_html file.impl_file_val buf with _ ->
-    default_file_print_sources_html file buf
-
-let file_print_html file buf =
-  let impl = as_file_impl file in
-  impl.impl_file_ops.op_file_print_html impl.impl_file_val buf
+  try file.impl_file_ops.op_file_print_sources file.impl_file_val conn with _ ->
+    default_file_print_sources file conn
 
-let file_print_plain file buf =
+let file_print file o =
   let impl = as_file_impl file in
-  impl.impl_file_ops.op_file_print_plain impl.impl_file_val buf
+  impl.impl_file_ops.op_file_print impl.impl_file_val o
 
 let file_find num =
   H.find files_by_num (as_file {
@@ -799,7 +806,7 @@
             ("", "sr", magic) ]
        | _ -> ());
 
-      file_print_html file buf;
+      file_print file o;
       
       Printf.bprintf buf "\\</tr\\>\\</table\\>\\</div\\>"; 
       Printf.bprintf buf "\\</td\\>\\</tr\\>\\</table\\>\\</div\\>\\<br\\>";
@@ -830,24 +837,11 @@
         | Some filename ->
             Printf.bprintf buf "Probable name: %s\n" filename);
       List.iter (fun name -> Printf.bprintf buf "    (%s)\n" name) info.G.file_names;
-      file_print_plain file buf
+      file_print file o
     end;
 
   (try
-            
-      if !!print_all_sources then begin
-          if use_html_mods o then
-            file_print_sources_html file buf
-          else begin
-            Printf.bprintf buf "%d sources:\n" (List.length srcs);
-          let print_source c =
-                  Printf.bprintf buf "  [%4d] " (client_num c);
-                  client_bprint c buf;
-          in
-          List.iter print_source srcs;
-        end;
-        end
-    
+      if !!print_all_sources then file_print_sources file o
     with _ -> ())
 
 let file_print_ed2k_link filename filesize md4hash =
@@ -1001,9 +995,8 @@
       op_file_active_sources = (fun _ -> fni network "file_active_sources");
       op_file_comment = (fun _ -> ni_ok network "file_comment"; "");
       op_file_set_priority = (fun _ _ -> ni_ok network "file_set_priority");
-      op_file_print_plain = (fun _ _ -> ni_ok network "file_print_plain");
-      op_file_print_html = (fun _ _ -> ni_ok network "file_print_html");
-      op_file_print_sources_html = (fun _ _ -> fni network "file_print_sources_html");
+      op_file_print = (fun _ _ -> ni_ok network "file_print_html");
+      op_file_print_sources = (fun _ _ -> fni network "file_print_sources");
       op_file_debug = (fun _ -> "");
       op_file_proposed_filenames = (fun impl -> []);
     }
@@ -1046,12 +1039,10 @@
         lprintf_nl "op_file_all_sources";
       if c.op_file_active_sources == cc.op_file_active_sources then
         lprintf_nl "op_file_active_sources";
-      if c.op_file_print_plain == cc.op_file_print_plain then
-        lprintf_nl "op_file_print_plain";
-      if c.op_file_print_html == cc.op_file_print_html then
-        lprintf_nl "op_file_print_html";
-      if c.op_file_print_sources_html == cc.op_file_print_sources_html then
-        lprintf_nl "op_file_print_sources_html";
+      if c.op_file_print == cc.op_file_print then
+        lprintf_nl "op_file_print";
+      if c.op_file_print_sources == cc.op_file_print_sources then
+        lprintf_nl "op_file_print_sources";
   ) !files_ops;
   lprint_newline ()
 
diff -a -x Root -x Repository -x Tag -x Entries -x Entries.Log -x .svn -x '*.rej' -x '*.orig' -N -r -u ./src/daemon/common/commonFile.mli ./src/daemon/common/commonFile.mli
--- ./src/daemon/common/commonFile.mli	2006-11-09 22:32:26.000000000 +0100
+++ ./src/daemon/common/commonFile.mli	2006-11-10 10:55:25.000000000 +0100
@@ -59,9 +59,8 @@
   mutable op_file_active_sources : 'a -> CommonTypes.client list;
   mutable op_file_comment : 'a -> string;
   mutable op_file_set_priority : 'a -> int -> unit;
-    mutable op_file_print_plain: 'a -> Buffer.t -> unit;
-    mutable op_file_print_html: 'a -> Buffer.t -> unit;
-    mutable op_file_print_sources_html : 'a -> Buffer.t -> unit;
+    mutable op_file_print: 'a -> CommonTypes.ui_conn -> unit;
+    mutable op_file_print_sources : 'a -> CommonTypes.ui_conn -> unit;
     mutable op_file_files : ('a -> 'a file_impl -> CommonTypes.file list);    
     mutable op_file_debug : 'a -> string;
     mutable op_file_proposed_filenames : 'a -> string list;
@@ -100,7 +99,7 @@
 val file_preview : CommonTypes.file -> unit
 val file_all_sources : CommonTypes.file -> CommonTypes.client list
 val file_active_sources : CommonTypes.file -> CommonTypes.client list
-val file_print_sources_html : CommonTypes.file -> Buffer.t -> unit
+val file_print_sources : CommonTypes.file -> CommonTypes.ui_conn -> unit
 val files_ops : (int file_ops * int file_ops) list ref
 val new_file_ops : CommonTypes.network -> 'a file_ops
 val check_file_implementations : unit -> unit
diff -a -x Root -x Repository -x Tag -x Entries -x Entries.Log -x .svn -x '*.rej' -x '*.orig' -N -r -u ./src/networks/bittorrent/bTInteractive.ml ./src/networks/bittorrent/bTInteractive.ml
--- ./src/networks/bittorrent/bTInteractive.ml	2006-11-09 22:32:27.000000000 +0100
+++ ./src/networks/bittorrent/bTInteractive.ml	2006-11-10 11:00:34.000000000 +0100
@@ -154,8 +154,10 @@
 
     end 
 
-let op_file_print_html file buf =
+let op_file_print file o =
 
+  let buf = o.conn_buf in
+  if use_html_mods o then begin
   Printf.bprintf buf "\\</tr\\>\\<tr class=\\\"dl-%d\\\"\\>" (html_mods_cntr ());
   html_mods_td buf [
     ("Filename", "sr br", "Filename");
@@ -335,8 +337,7 @@
     ];
     incr cntr;
   ) file.file_files
-
-let op_file_print_plain file buf =
+  end else begin
 
   Printf.bprintf buf "Trackers:\n";
   List.iter (fun tracker ->
@@ -367,8 +368,37 @@
     in
     Printf.bprintf buf "File %d: %s (%Ld bytes)%s\n" !cntr filename size magic_string
   ) file.file_files
+  end
 
-let op_file_print_sources_html file buf =
+let op_file_print_sources file o =
+  let buf = o.conn_buf in
+
+(* redefine functions for telnet output *)
+  let html_mods_td buf l =
+    if use_html_mods o then
+      html_mods_td buf l
+    else
+      (* List *)
+      List.iter (fun (t,c,d)  ->
+	  (* Title Class Value *)
+	  Printf.bprintf buf "%s "
+	  d;
+      ) l
+  in
+  let html_mods_table_header buf n c l =
+    if use_html_mods o then
+      html_mods_table_header buf n c l
+    else
+      if List.length l > 0 then begin
+	Printf.bprintf buf "\n";
+	List.iter (fun (w,x,y,z)  ->
+	  (* Sort Class Title Value *)
+	  Printf.bprintf buf "%s "
+	  z;
+	) l;
+	Printf.bprintf buf "\n"
+    end
+  in
 
   if Hashtbl.length file.file_clients > 0 then begin
 
@@ -419,6 +449,7 @@
       html_mods_table_header buf "sourcesTable" "sources al" header_list;
 
       Hashtbl.iter (fun _ c ->
+	  if use_html_mods o then
           Printf.bprintf buf "\\<tr class=\\\"dl-%d\\\"\\>" (html_mods_cntr());
 
           let btos b = if b then "T" else "F" in
@@ -466,11 +497,13 @@
           ] in
 
           html_mods_td buf td_list;
-          Printf.bprintf buf "\\</tr\\>";
+          if use_html_mods o then Printf.bprintf buf "\\</tr\\>"
+	  else Printf.bprintf buf "\n";
 
       ) file.file_clients;
 
-      Printf.bprintf buf "\\</table\\>\\</div\\>\\<br\\>";
+      if use_html_mods o then Printf.bprintf buf "\\</table\\>\\</div\\>\\<br\\>"
+      else Printf.bprintf buf "\n";
 
     end
 
@@ -1167,9 +1200,8 @@
   file_ops.op_file_active_sources <- op_file_active_sources;
   file_ops.op_file_debug <- op_file_debug;
   file_ops.op_file_commit <- op_file_commit;
-  file_ops.op_file_print_html <- op_file_print_html;
-  file_ops.op_file_print_plain <- op_file_print_plain;
-  file_ops.op_file_print_sources_html <- op_file_print_sources_html;
+  file_ops.op_file_print <- op_file_print;
+  file_ops.op_file_print_sources <- op_file_print_sources;
   file_ops.op_file_check <- op_file_check;
   file_ops.op_file_cancel <- op_file_cancel;
   file_ops.op_file_info <- op_file_info;
diff -a -x Root -x Repository -x Tag -x Entries -x Entries.Log -x .svn -x '*.rej' -x '*.orig' -N -r -u ./src/networks/donkey/donkeyInteractive.ml ./src/networks/donkey/donkeyInteractive.ml
--- ./src/networks/donkey/donkeyInteractive.ml	2006-11-09 22:32:27.000000000 +0100
+++ ./src/networks/donkey/donkeyInteractive.ml	2006-11-10 11:08:31.000000000 +0100
@@ -1231,15 +1231,16 @@
       ) file.file_sources;
       !list
   );
-  file_ops.op_file_print_plain <- (fun file buf ->
-    let cntr = ref 0 in
-    List.iter (fun (ip, n, r, c) ->
-      incr cntr;
-      Printf.bprintf buf
-	"Comment %d: Rating(%d): %s (%s/%s)\n" !cntr r (Charset.to_utf8 c) n (Ip.to_string ip)) file.file_comments
-  );
-  file_ops.op_file_print_html <- (fun file buf ->
+  file_ops.op_file_print <- (fun file o ->
 
+     let buf = o.conn_buf in
+     if not (use_html_mods o) then begin
+	let cntr = ref 0 in
+	List.iter (fun (ip, n, r, c) ->
+	  incr cntr;
+	  Printf.bprintf buf
+	    "Comment %d: Rating(%d): %s (%s/%s)\n" !cntr r (Charset.to_utf8 c) n (Ip.to_string ip)) file.file_comments
+     end else begin
      let tr () =
       Printf.bprintf buf "\\</tr\\>\\<tr class=\\\"dl-%d\\\"\\>" (html_mods_cntr ())
      in
@@ -1305,11 +1306,12 @@
    ^ "\\<td\\>"
    ^ "\\<input name=\\\"newName\\\" type=text size=" ^ input_size ^ " value=\\\"" ^ (file_best_name file) ^ "\\\"\\>\\</input\\>\\</td\\>\\</form\\>\\</tr\\>\\</table\\>"
     ) ];
-
-
+  end
   );
-  file_ops.op_file_print_sources_html <- (fun file buf ->
+  file_ops.op_file_print_sources <- (fun file o ->
 
+    if not (use_html_mods o) then raise Not_found;
+    let buf = o.conn_buf in
     let sources_list = ref [] in
     DonkeySources.iter_relevant_sources (fun s ->
       let s_uid = s.DonkeySources.source_uid in
diff -a -x Root -x Repository -x Tag -x Entries -x Entries.Log -x .svn -x '*.rej' -x '*.orig' -N -r -u ./src/networks/fileTP/fileTPInteractive.ml ./src/networks/fileTP/fileTPInteractive.ml
--- ./src/networks/fileTP/fileTPInteractive.ml	2006-11-09 22:32:27.000000000 +0100
+++ ./src/networks/fileTP/fileTPInteractive.ml	2006-11-10 10:55:53.000000000 +0100
@@ -417,8 +417,7 @@
     ) file.file_clients
   );
   file_ops.op_file_resume <- (fun file -> ());
-  file_ops.op_file_print_html <- (fun file buf -> ());
-  file_ops.op_file_print_plain <- (fun file buf -> ());
+  file_ops.op_file_print <- (fun file buf -> ());
   network.op_network_close_search <- (fun s -> ());
   network.op_network_forget_search <- (fun s -> ());
   network.op_network_connect_servers <- (fun s -> ());
diff -a -x Root -x Repository -x Tag -x Entries -x Entries.Log -x .svn -x '*.rej' -x '*.orig' -N -r -u ./src/networks/gnutella/gnutellaInteractive.ml ./src/networks/gnutella/gnutellaInteractive.ml
--- ./src/networks/gnutella/gnutellaInteractive.ml	2006-10-01 19:54:00.000000000 +0200
+++ ./src/networks/gnutella/gnutellaInteractive.ml	2006-11-10 10:55:47.000000000 +0100
@@ -289,8 +289,7 @@
 module P = GuiTypes
   
 let _ =
-  file_ops.op_file_print_html <- (fun file buf -> ());
-  file_ops.op_file_print_plain <- (fun file buf -> ());
+  file_ops.op_file_print <- (fun file buf -> ());
   file_ops.op_file_cancel <- (fun file ->
       CommonSwarming.remove_swarmer file.file_swarmer;
       file.file_swarmer <- None;
