"Fossies" - the Fresh Open Source Software Archive

Member "htmlrecode-1.3.1/argh/docmaker.php" (21 Jul 2009, 3360 Bytes) of package /linux/www/old/htmlrecode-1.3.1.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) PHP source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "docmaker.php" see the Fossies "Dox" file reference documentation.

    1 <?php
    2 
    3 # This is Bisqwit's generic docmaker.php, activated from depfun.mak.
    4 # The same program is used in many different projects to create
    5 # the README.html file from progdesc.php.
    6 #
    7 # docmaker.php version 1.1.0
    8 
    9 # Copyright (C) 2000,2004 Bisqwit (http://iki.fi/bisqwit/)
   10 
   11 # Syntax:
   12 
   13 # argv[1]: Archive name
   14 # argv[2]: Source file (default: progdesc.php)
   15 
   16 # Requires:
   17 #   /usr/local/bin/htmlrecode
   18 #   /WWW/document.php (document formatting module)
   19 #
   20 # From the source file, requires the following:
   21 #   $title
   22 #   $progname
   23 
   24 $archivename = $argv[1];
   25 $docmodulefn = $argv[2];
   26 $docformatfn = '/WWW/document.php';
   27 
   28 if(!$docmodulefn) $docmodulefn = 'progdesc.php';
   29 
   30 foreach(array($docmodulefn, $docformatfn) as $fn)
   31   if(!file_exists($fn))
   32   {
   33     print "$fn not found, not making document.\n";
   34     exit(1);
   35   }
   36 
   37 function shellfix($s){return "'".str_replace("'", "'\''", $s)."'";}
   38 
   39 $content_array = file($docmodulefn);
   40 $content = implode('', $content_array);
   41 $fw = fopen('docmaker-temp.php', 'w');
   42 fwrite($fw, preg_replace('/include \'.*;/U', '', $content));
   43 fclose($fw);
   44 include 'docmaker-temp.php';
   45 unlink('docmaker-temp.php');
   46 
   47 if($outset) ob_start();
   48 
   49 ?>
   50 <html><head><meta http-equiv="Content-type" content="text/html; charset=iso-8859-1">
   51  <title><?=htmlspecialchars($title)?></title>
   52  <style type="text/css"><!--
   53 TABLE.toc {border:0px}
   54 A:link,A:visited{text-decoration:none;color:#2A3B83}
   55 A:hover{text-decoration:underline;color:#002040}
   56 A:active{text-decoration:underline;color:#004060;background:#CCD8FF}
   57 TD.toc   {font-size:80%; font-family:Tahoma; text-align:left}
   58 H1       {font-size:250%; font-weight:bold} .level1 {text-align:center}
   59 H2       {font-size:200%; font-weight:bold} .level2 {margin-left:1%}
   60 H3       {font-size:160%; font-weight:bold} .level3 {margin-left:2%}
   61 H4       {font-size:145%; font-weight:bold} .level4 {margin-left:3%}
   62 H5       {font-size:130%; font-weight:bold} .level5 {margin-left:4%}
   63 H6       {font-size:110%; font-weight:bold} .level5 {margin-left:5%}
   64 BODY{background:white;color:black}
   65 CODE{font-family:lucida console,courier new,courier;color:#105000}
   66 PRE.smallerpre{font-family:lucida console,courier new,courier;font-size:80%;color:#500010;margin-left:30px}
   67 SMALL    {font-size:70%}
   68 --></style></head>
   69  <body>
   70   <h1><?=htmlspecialchars($title)?></h1>
   71   <h2 class=level2> 0. Contents </h2>
   72   
   73   This is the documentation of <?=htmlspecialchars($archivename)?>.
   74 <?
   75 
   76 $url = 'http://iki.fi/bisqwit/source/'.rawurlencode($progname).'.html';
   77 $k = '
   78    The official home page of '.htmlspecialchars($progname).'
   79    is at <a href="'.htmlspecialchars($url).'">'.htmlspecialchars($url).'</a>.<br>
   80    Check there for new versions.
   81 ';
   82 $text['download:99999. Downloading'] = $k;
   83 
   84 include $docformatfn;
   85 
   86 $st1 = stat($docmodulefn);
   87 $st2 = stat('docmaker.php');
   88 ?>
   89  <p align=right><small>Generated from
   90        <tt><?=$docmodulefn?></tt> (last updated: <?=date('r', $st1[9])?>)<br>
   91   with <tt>docmaker.php</tt> (last updated: <?=date('r', $st2[9])?>)<br>
   92   at <?=date('r')?></small>
   93  </p>
   94 </body>
   95 </html>
   96 <?
   97 
   98 if($outset)
   99 {
  100   $s = ob_get_contents();
  101   ob_end_clean();
  102   if(file_exists('/usr/local/bin/htmlrecode'))
  103   {
  104     /* Try to ensure browser interpretes japanese characters correctly */
  105     passthru('echo '.shellfix($s).
  106              '|/usr/local/bin/htmlrecode -Iiso-8859-1 -O'.$outset.' 2>/dev/null');
  107   }
  108   else
  109     print $s;
  110 }