[1] | 1 | <?php |
---|
| 2 | |
---|
| 3 | $with_tables = TRUE; |
---|
| 4 | //$with_tables = FALSE; |
---|
| 5 | |
---|
| 6 | echo " |
---|
| 7 | <html> |
---|
| 8 | <body bgcolor='white'>"; |
---|
| 9 | |
---|
| 10 | echo " |
---|
| 11 | <STYLE TYPE='text/css'> |
---|
| 12 | BODY |
---|
| 13 | {scrollbar-face-color: #0069B3; |
---|
| 14 | scrollbar-shadow-color: #000000; |
---|
| 15 | scrollbar-highlight-color: #FFFFFF; |
---|
| 16 | scrollbar-3dlight-color: #000000; |
---|
| 17 | scrollbar-darkshadow-color: #000000; |
---|
| 18 | scrollbar-track-color: #0069B3; |
---|
| 19 | scrollbar-arrow-color: #FFCC00;} |
---|
| 20 | TD.a {color:blue; |
---|
| 21 | background-color:#FFFFFF; |
---|
| 22 | font-color:blue; |
---|
| 23 | font-size:11px; |
---|
| 24 | font-family:verdana;} |
---|
| 25 | A.a {color:#FFCC00; |
---|
| 26 | background-color:#000000; |
---|
| 27 | foreground-color:#ffcc00; |
---|
| 28 | font-color:#FFCC00; |
---|
| 29 | font-size:11px; |
---|
| 30 | font-family:verdana;} |
---|
| 31 | A.b {color:#FFCC00; |
---|
| 32 | background-color:#0069b3; |
---|
| 33 | foreground-color:#ffcc00; |
---|
| 34 | text-decoration:none; |
---|
| 35 | font-color:#FFCC00; |
---|
| 36 | font-size:11px; |
---|
| 37 | font-family:verdana;} |
---|
| 38 | A { |
---|
| 39 | color:#FFFFFF; |
---|
| 40 | text-decoration:none; |
---|
| 41 | } |
---|
| 42 | A:hover { |
---|
| 43 | color:#FFCC00; |
---|
| 44 | text-decoration:underline; |
---|
| 45 | } |
---|
| 46 | A.menu { |
---|
| 47 | color:#000000; |
---|
| 48 | text-decoration:underline; |
---|
| 49 | } |
---|
| 50 | A:hover.menu { |
---|
| 51 | color:#FFFF00; |
---|
| 52 | text-decoration:underline; |
---|
| 53 | } |
---|
| 54 | A.esp { |
---|
| 55 | color:#FF3333; |
---|
| 56 | text-decoration:underline; |
---|
| 57 | } |
---|
| 58 | A:hover.esp { |
---|
| 59 | color:#33FFFF; |
---|
| 60 | text-decoration:none; |
---|
| 61 | } |
---|
| 62 | |
---|
| 63 | A.div { |
---|
| 64 | color:#FFCC00; |
---|
| 65 | text-decoration:none; |
---|
| 66 | } |
---|
| 67 | A:hover.div { |
---|
| 68 | color:#FF3333; |
---|
| 69 | text-decoration:none; |
---|
| 70 | } |
---|
| 71 | TD.b {color:black; |
---|
| 72 | background-color:white; |
---|
| 73 | font-size:11px; |
---|
| 74 | font-family:verdana;} |
---|
| 75 | TD.c {color:red; |
---|
| 76 | background-color:white; |
---|
| 77 | font-size:11px; |
---|
| 78 | font-family:verdana;} |
---|
| 79 | P.a { |
---|
| 80 | background-color:$res_couleur_fond_entête; |
---|
| 81 | color:$res_couleur_texte_entête;} |
---|
| 82 | P.c {color:#FFCC00; |
---|
| 83 | background-color:#000000; |
---|
| 84 | font-size:11px; |
---|
| 85 | font-family:verdana; |
---|
| 86 | } |
---|
| 87 | INPUT {color:#FFCC00; |
---|
| 88 | background-color:#0069B3; |
---|
| 89 | font-size:11px; |
---|
| 90 | font-family:verdana;} |
---|
| 91 | SELECT {color:#FFCC00;background-color:#0069D2;font-size:12px;font-family:verdana;} |
---|
| 92 | TEXTAREA {color:#FFCC00;background-color:#0069B3;font-size:11px;font-family:verdana;} |
---|
| 93 | </STYLE>"; |
---|
| 94 | |
---|
| 95 | if (with_tables) |
---|
| 96 | { |
---|
| 97 | echo " |
---|
| 98 | <table border width=100%> |
---|
| 99 | <tr> |
---|
| 100 | <td width=70 nowrap class='a'><i><center>date</center></i></td> |
---|
| 101 | <td width=50% class='b'><i><center>file</center></i></td> |
---|
| 102 | <td class='c'><i><center>comment</center></i></td> |
---|
| 103 | </tr>"; |
---|
| 104 | } |
---|
| 105 | |
---|
| 106 | $started = FALSE; |
---|
| 107 | |
---|
| 108 | $fcontents = file ('ChangeLog'); |
---|
| 109 | |
---|
| 110 | $date = ""; |
---|
| 111 | |
---|
| 112 | while (list ($n, $line) = each ($fcontents)) |
---|
| 113 | { |
---|
| 114 | $line = str_replace ("\t", " ", $line); |
---|
| 115 | $c = substr ($line, 0, 1); |
---|
| 116 | |
---|
| 117 | $line = trim ($line); |
---|
| 118 | if ($line == "") continue; |
---|
| 119 | |
---|
| 120 | $words = explode (" ", $line); |
---|
| 121 | $NF = count ($words) - 1; |
---|
| 122 | |
---|
| 123 | //echo "|<font color=red>$line</font>|". $words[0] . "|". $words[1] . "|". $words[2] . "|<br>"; |
---|
| 124 | |
---|
| 125 | $marker = strpos ("." . $line, "):"); |
---|
| 126 | if ($marker >= 1) |
---|
| 127 | { |
---|
| 128 | } |
---|
| 129 | else |
---|
| 130 | { |
---|
| 131 | $marker = 0; |
---|
| 132 | } |
---|
| 133 | |
---|
| 134 | //echo "<br>date: $date<br> ladate: $ladate<br>"; |
---|
| 135 | |
---|
| 136 | if ($c != " ") |
---|
| 137 | { |
---|
| 138 | // <date> <who> <number> |
---|
| 139 | |
---|
| 140 | $has_number = (strcspn ($words[$NF], "0123456789") == 0); |
---|
| 141 | |
---|
| 142 | if ($has_number) |
---|
| 143 | { |
---|
| 144 | $last = $NF - 1; |
---|
| 145 | $number = $words[$NF]; |
---|
| 146 | } |
---|
| 147 | else |
---|
| 148 | { |
---|
| 149 | $last = $NF; |
---|
| 150 | $number = ""; |
---|
| 151 | } |
---|
| 152 | |
---|
| 153 | $who = ""; |
---|
| 154 | |
---|
| 155 | for ($i = 1; $i <= $last; $i++) |
---|
| 156 | { |
---|
| 157 | $who .= " "; |
---|
| 158 | $who .= $words[$i]; |
---|
| 159 | } |
---|
| 160 | |
---|
| 161 | |
---|
| 162 | $date = $words[0]; |
---|
| 163 | if ($date != $ladate) |
---|
| 164 | { |
---|
| 165 | $ladate = $date; |
---|
| 166 | } |
---|
| 167 | else |
---|
| 168 | { |
---|
| 169 | $date = " "; |
---|
| 170 | } |
---|
| 171 | |
---|
| 172 | //echo "date:[" . $date . "] ladate:[" . $ladate . "] who:" . $who . " #:" . $number . " [$line]<br>" ; |
---|
| 173 | |
---|
| 174 | } |
---|
| 175 | else if (($words[0] == "*") || ($marker >= 1)) |
---|
| 176 | { |
---|
| 177 | if ($started) |
---|
| 178 | { |
---|
| 179 | if ($with_tables) echo "</td></tr>"; |
---|
| 180 | |
---|
| 181 | $started = FALSE; |
---|
| 182 | } |
---|
| 183 | |
---|
| 184 | if ($marker == 0) |
---|
| 185 | { |
---|
| 186 | $marker = strpos ("." . $line, ":"); |
---|
| 187 | } |
---|
| 188 | else |
---|
| 189 | { |
---|
| 190 | $marker++; |
---|
| 191 | } |
---|
| 192 | |
---|
| 193 | //echo " ...Starting an entry... marker=$marker date=$date<br>"; |
---|
| 194 | |
---|
| 195 | if ($marker > 0) |
---|
| 196 | { |
---|
| 197 | $head = substr ($line, 0, $marker); |
---|
| 198 | $line = substr ($line, $marker); |
---|
| 199 | } |
---|
| 200 | else |
---|
| 201 | { |
---|
| 202 | $head = $line; |
---|
| 203 | $line = ""; |
---|
| 204 | } |
---|
| 205 | |
---|
| 206 | $head = trim ($head); |
---|
| 207 | $line = trim ($line); |
---|
| 208 | |
---|
| 209 | //echo "[$head] [$line]<br>"; |
---|
| 210 | |
---|
| 211 | $par = strpos ("." . $head, "("); |
---|
| 212 | if ($par > 0) |
---|
| 213 | { |
---|
| 214 | if ($par > 1) $file = substr ($head, 0, $par-1); |
---|
| 215 | $info = substr ($head, $par); |
---|
| 216 | $info = str_replace ("(", "", $info); |
---|
| 217 | $info = str_replace (")", "", $info); |
---|
| 218 | $info = str_replace (":", "", $info); |
---|
| 219 | } |
---|
| 220 | else |
---|
| 221 | { |
---|
| 222 | $file = $head; |
---|
| 223 | $info = ""; |
---|
| 224 | } |
---|
| 225 | |
---|
| 226 | $file = str_replace ("*", "", $file); |
---|
| 227 | $file = str_replace ("(", "", $file); |
---|
| 228 | $file = str_replace (")", "", $file); |
---|
| 229 | $file = str_replace (":", "", $file); |
---|
| 230 | $file = str_replace ("\\", "/", $file); |
---|
| 231 | |
---|
| 232 | if ($with_tables) echo "<tr><td class='a' valign='top'> "; |
---|
| 233 | |
---|
| 234 | echo "$date"; |
---|
| 235 | |
---|
| 236 | if ($with_tables) echo "</td><td class='b' valign='top'>"; |
---|
| 237 | |
---|
| 238 | echo "$file"; |
---|
| 239 | |
---|
| 240 | if (!empty ($info)) echo " (<font color='green'>$info</font>)"; |
---|
| 241 | |
---|
| 242 | //echo "</tt>"; |
---|
| 243 | |
---|
| 244 | if ($with_tables) echo "</td><td class='c' valign='top'>"; |
---|
| 245 | |
---|
| 246 | $date = " "; |
---|
| 247 | |
---|
| 248 | $line = trim ($line); |
---|
| 249 | |
---|
| 250 | if (empty ($line)) $line=" "; |
---|
| 251 | |
---|
| 252 | echo "$line"; |
---|
| 253 | if (!$with_tables) echo "<br>"; |
---|
| 254 | |
---|
| 255 | $started = TRUE; |
---|
| 256 | $was_empty = FALSE; |
---|
| 257 | $was_not_empty = FALSE; |
---|
| 258 | |
---|
| 259 | } |
---|
| 260 | else if ($started) |
---|
| 261 | { |
---|
| 262 | $line = trim ($line); |
---|
| 263 | if (empty ($line)) |
---|
| 264 | { |
---|
| 265 | if ($was_not_empty) |
---|
| 266 | { |
---|
| 267 | $was_not_empty = FALSE; |
---|
| 268 | $was_empty = TRUE; |
---|
| 269 | } |
---|
| 270 | $line = " "; |
---|
| 271 | } |
---|
| 272 | else |
---|
| 273 | { |
---|
| 274 | if ($was_empty) |
---|
| 275 | { |
---|
| 276 | $was_empty = TRUE; |
---|
| 277 | echo "<br>"; |
---|
| 278 | } |
---|
| 279 | $was_not_empty = TRUE; |
---|
| 280 | } |
---|
| 281 | echo "$line"; |
---|
| 282 | if (!$with_tables) echo "<br>"; |
---|
| 283 | } |
---|
| 284 | } |
---|
| 285 | |
---|
| 286 | if ($with_tables) echo "</table>"; |
---|
| 287 | |
---|
| 288 | echo " |
---|
| 289 | </body> |
---|
| 290 | </html>"; |
---|
| 291 | |
---|
| 292 | |
---|
| 293 | ?> |
---|
| 294 | |
---|