home *** CD-ROM | disk | FTP | other *** search
/ PC Professionell 2007 April / PCpro_2007_04.ISO / files / dsl / NVinst.exe / Scripts / Scripter / HtmlMaps.nvs < prev    next >
Encoding:
Text File  |  2007-02-10  |  1.9 KB  |  59 lines

  1. {
  2. WebCenter HtmlMaps helper script
  3. }
  4. const HTML_FILE='';//Path and name of result html file, images will be also placed there
  5.                    //If empty default to nv_directory+\Scripts\HTTP\DefaultHost\HtmlMaps\index.html';
  6.  
  7.  
  8.  
  9. procedure GenerateHtml(fn:string);
  10. var f:integer;
  11.     sr:TSearchRec;
  12. begin
  13. f:=OpenFile(fn,11);
  14. writefile(f,'<html><title>NetView Visual Maps</title>'#13#10
  15.             '<body text="#FFFFFF" bgcolor="#000000" link="#00FFFF" vlink="#00FFAA" alink="#00AAAA">'#13#10);
  16.  
  17. writefile(f,'<p align=center><a href=/>Go to main page</a></p>');
  18. writefile(f,'<H3><p align=center>Visual map images by NetView updated on '+
  19.             FormatDateTime(' YYYY-MM-DD HH:MM.SS',Now)+'</p></H3>');
  20.  
  21. if FindFirst(ExtractFilePath(fn)+'*.gif',sr)=0 then
  22.  begin
  23.  repeat
  24.   writefile(f,'<p align="center"><a target="_blank" href="'+sr.name+'">'+copy(sr.name,1,length(sr.name)-4)+
  25.   ' - exported on '+FormatDateTime(' YYYY-MM-DD HH:MM.SS',sr.Time)+'</a></p><br>'#13#10);
  26.   until findnext(sr)<>0;
  27.  findclose(sr);
  28.  end;
  29. FindClose(sr);
  30.  
  31. writefile(f,'<p align="center">Powered by NetView<br><img border="0" src="/nvico.gif" width="64" height="64"><br><a href="http://www.killprog.com">http://www.killprog.com</a></p>');
  32. writefile(f,'</body><script language="JavaScript" src="/fade.js"></script></html>');
  33. CloseFile(f);
  34. end;
  35.  
  36. var e,v1,v2:integer;
  37.     lst:TNVList;
  38.     fn:string;
  39. Begin
  40. if length(HTML_FILE)=0 then fn:=nv_directory+'Scripts\HTTP\DefaultHost\HtmlMaps\index.html'
  41.                        else fn:=HTML_FILE;
  42. CreateDirectory(ExtractFilePath(fn));
  43. GenerateHtml(fn);
  44. lst:=TNVList.Create;
  45. repeat
  46.  e:=WaitEvent(v1,v2);
  47.  if(e=NMNP_ACTION)and(v2<>0)then
  48.   begin
  49.   lst.GETLIST(v2,0);
  50.   if lst.id=v2 then
  51.    begin
  52.    CopyFile(nv_directory+'Export\'+lst.lname+'.gif',ExtractFilePath(fn)+lst.lname+'.gif',false);
  53.    GenerateHtml(fn);
  54.    end;
  55.   end;
  56.  until e=0;
  57. lst.Free;
  58. End.
  59.