Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Small patch for revcheck.php
Please review this patch (general and smarty versions).
It hides the files table (header) if no outdated files found.
Well, this is not a "mission-critical" patch, but why not? :)

Report this thread to moderator Post Follow-up to this message
Old Post
George Miroshnikov
10-29-04 01:56 PM


Re: Small patch for revcheck.php
Hi Geroge,

I have applied your fix to both phpdoc and smarty. Thank you.

Mehdi

George Miroshnikov wrote:
> Please review this patch (general and smarty versions).
> It hides the files table (header) if no outdated files found.
> Well, this is not a "mission-critical" patch, but why not? :)
>
>
> ------------------------------------------------------------------------
>
> Index: docs/scripts/revcheck.php
>  ========================================
===========================
> RCS file: /repository/smarty/docs/scripts/revcheck.php,v
> retrieving revision 1.4
> diff -u -u -r1.4 revcheck.php
> --- docs/scripts/revcheck.php	25 Oct 2004 11:13:34 -0000	1.4
> +++ docs/scripts/revcheck.php	29 Oct 2004 11:51:18 -0000
> @@ -721,6 +721,8 @@
>  // Files table goes here
>  //  ========================================
==============================
===
>
> +if (count($files_status) != 0) {
> +
>  print <<<END_OF_MULTILINE
>  <a name="files"></a>
>  <table width="820" border="0" cellpadding="4" cellspacing="1" align="cent
er">
> @@ -745,63 +747,64 @@
>  </tr>
>  END_OF_MULTILINE;
>
> -// This was the previous directory [first]
> -$prev_dir = $new_dir = $DOCDIR."en";
> -
> -// Go through all files collected
> -foreach ($files_status as $num => $file) {
> -
> -    // Make the maintainer a link, if we have that maintainer in the list
> -    if (isset($maint_by_nick[$file["maintainer"]])) {
> -      $file["maintainer"] = '<a href="#maint' . $maint_by_nick[$file["mai
ntainer"]] .
> -                            '">' . $file["maintainer"] . '</a>';
> -    }
> -
> -    // If we have a 'numeric' revision diff and it is not zero,
> -    // make a link to the CVS repository's diff script
> -    if ($file["revision"][2] != "n/a" && $file["revision"][2] !== 0) {
> -        $file["short_name"] = "<a href=\"http://cvs.php.net/diff.php/" .
> -                              preg_replace( "'^".$DOCDIR."'", "smarty/doc
s/", $file["full_name"]) .
> -                              "?r1=" . $file["revision"][1] .
> -                              "&r2=" . $file["revision"][0] .
> -                              CVS_OPT . "\">" . $file["short_name"] . "</
a>";
> -    }
> -
> -    // Guess the new directory from the full name of the file
> -    $new_dir = dirname($file["full_name"]);
> -
> -    // If this is a new directory, put out dir headline
> -    if ($new_dir != $prev_dir) {
> -
> -        // Drop out the unneeded parts from the dirname...
> -        $display_dir = str_replace($DOCDIR."en/", "", dirname($file["full
_name"]));
> -
> -        // Print out directory header
> -        print "<tr class=blue><th colspan=12>$display_dir</th></tr>\n";
> -
> -        // Store the new actual directory
> -        $prev_dir = $new_dir;
> -    }
> -
> -    // Write out the line for the current file (get file name shorter)
> -    print "<tr class={$CSS[$file['mark']]}><td>{$file['short_name']}</td>
".
> -          "<td> {$file['revision'][0]}</td>" .
> -          "<td> {$file['revision'][1]}</td>".
> -          "<td class=rb>{$file['revision'][2]} </td>".
> -          "<td class=r>{$file['size'][0]} </td>".
> -          "<td class=r>{$file['size'][1]} </td>".
> -          "<td class=rb>{$file['size'][2]} </td>".
> -          "<td class=r>{$file['date'][0]} </td>".
> -          "<td class=r>{$file['date'][1]} </td>".
> -          "<td class=rb>{$file['date'][2]} </td>".
> -          "<td class=c>{$file['maintainer']}</td>".
> -          "<td class=c>".trim($file['status'])."</td></tr>\n";
> +    // This was the previous directory [first]
> +    $prev_dir = $new_dir = $DOCDIR."en";
> +
> +    // Go through all files collected
> +    foreach ($files_status as $num => $file) {
> +
> +        // Make the maintainer a link, if we have that maintainer in the 
list
> +        if (isset($maint_by_nick[$file["maintainer"]])) {
> +          $file["maintainer"] = '<a href="#maint' . $maint_by_nick[$file[
"maintainer"]] .
> +                                '">' . $file["maintainer"] . '</a>';
> +        }
> +
> +        // If we have a 'numeric' revision diff and it is not zero,
> +        // make a link to the CVS repository's diff script
> +        if ($file["revision"][2] != "n/a" && $file["revision"][2] !== 0) 
{
> +            $file["short_name"] = "<a href=\"http://cvs.php.net/diff.php/
" .
> +                                  preg_replace( "'^".$DOCDIR."'", "smarty
/docs/", $file["full_name"]) .
> +                                  "?r1=" . $file["revision"][1] .
> +                                  "&r2=" . $file["revision"][0] .
> +                                  CVS_OPT . "\">" . $file["short_name"] .
 "</a>";
> +        }
> +
> +        // Guess the new directory from the full name of the file
> +        $new_dir = dirname($file["full_name"]);
> +
> +        // If this is a new directory, put out dir headline
> +        if ($new_dir != $prev_dir) {
> +
> +            // Drop out the unneeded parts from the dirname...
> +            $display_dir = str_replace($DOCDIR."en/", "", dirname($file["
full_name"]));
> +
> +            // Print out directory header
> +            print "<tr class=blue><th colspan=12>$display_dir</th></tr>\n
";
> +
> +            // Store the new actual directory
> +            $prev_dir = $new_dir;
> +        }
> +
> +        // Write out the line for the current file (get file name shorter
)
> +        print "<tr class={$CSS[$file['mark']]}><td>{$file['short_name']}<
/td>".
> +              "<td> {$file['revision'][0]}</td>" .
> +              "<td> {$file['revision'][1]}</td>".
> +              "<td class=rb>{$file['revision'][2]} </td>".
> +              "<td class=r>{$file['size'][0]} </td>".
> +              "<td class=r>{$file['size'][1]} </td>".
> +              "<td class=rb>{$file['size'][2]} </td>".
> +              "<td class=r>{$file['date'][0]} </td>".
> +              "<td class=r>{$file['date'][1]} </td>".
> +              "<td class=rb>{$file['date'][2]} </td>".
> +              "<td class=c>{$file['maintainer']}</td>".
> +              "<td class=c>".trim($file['status'])."</td></tr>\n";
> +
> +    }
> +
> +    print("</table>\n<p> </p>\n$navbar<p> </p>\n");
>
>  }
>
> -print("</table>\n<p> </p>\n$navbar<p> </p>\n");
> -
> -
>  //  ========================================
==============================
===
>  // Work in progress table goes here
>  //  ========================================
==============================
===
>
>
> ------------------------------------------------------------------------
>
> Index: scripts/revcheck.php
>  ========================================
===========================
> RCS file: /repository/phpdoc/scripts/revcheck.php,v
> retrieving revision 1.47
> diff -u -u -r1.47 revcheck.php
> --- scripts/revcheck.php	5 Sep 2004 22:11:53 -0000	1.47
> +++ scripts/revcheck.php	29 Oct 2004 12:00:44 -0000
> @@ -727,6 +727,8 @@
>  // Files table goes here
>  //  ========================================
==============================
===
>
> +if (count($files_status) != 0) {
> +
>  print <<<END_OF_MULTILINE
>  <a name="files"></a>
>  <table width="820" border="0" cellpadding="4" cellspacing="1" align="cent
er">
> @@ -751,70 +753,72 @@
>  </tr>
>  END_OF_MULTILINE;
>
> -// This was the previous directory [first]
> -$prev_dir = $new_dir = $DOCDIR."en";
> -
> -// Go through all files collected
> -foreach ($files_status as $num => $file) {
> -
> -    // Make the maintainer a link, if we have that maintainer in the list
> -    if (isset($maint_by_nick[$file["maintainer"]])) {
> -      $file["maintainer"] = '<a href="#maint' . $maint_by_nick[$file["mai
ntainer"]] .
> -                            '">' . $file["maintainer"] . '</a>';
> -    }
> -
> -    // If we have a 'numeric' revision diff and it is not zero,
> -    // make a link to the CVS repository's diff script
> -    if ($file["revision"][2] != "n/a" && $file["revision"][2] !== 0) {
> -        $file["short_name"] = "<a href=\"http://cvs.php.net/diff.php/" .
> -                              preg_replace( "'^".$DOCDIR."'", "phpdoc/", 
$file["full_name"]) .
> -                              "?r1=" . $file["revision"][1] .
> -                              "&r2=" . $file["revision"][0] .
> -                              CVS_OPT . "\">" . $file["short_name"] . "</
a>";
> -    }
> -
> -    // Guess the new directory from the full name of the file
> -    $new_dir = dirname($file["full_name"]);
> -
> -    // If this is a new directory, put out old dir lines
> -    if ($new_dir != $prev_dir && isset($lines)) {
> -        echo $prev_diplay_dir;
> -        echo " ($line_number)</th></tr>";
> -	echo $lines;
> -
> -	$lines = '';
> -	$line_number = 0;
> -
> -        // Store the new actual directory
> -        $prev_dir = $new_dir;
> -    }
> -    // Drop out the unneeded parts from the dirname...
> -    $display_dir = str_replace($DOCDIR."en/", "", dirname($file["full_nam
e"]));
> -    $prev_diplay_dir = "<tr class=blue><th colspan=12>$display_dir";
> -
> -    // Save the line for the current file (get file name shorter)
> -    $lines .= "<tr class={$CSS[$file['mark']]}><td>{$file['short_name']}<
/td>".
> -          "<td> {$file['revision'][0]}</td>" .
> -          "<td> {$file['revision'][1]}</td>".
> -          "<td class=rb>{$file['revision'][2]} </td>".
> -          "<td class=r>{$file['size'][0]} </td>".
> -          "<td class=r>{$file['size'][1]} </td>".
> -          "<td class=rb>{$file['size'][2]} </td>".
> -          "<td class=r>{$file['date'][0]} </td>".
> -          "<td class=r>{$file['date'][1]} </td>".
> -          "<td class=rb>{$file['date'][2]} </td>".
> -          "<td class=c>{$file['maintainer']}</td>".
> -          "<td class=c>".trim($file['status'])."</td></tr>\n";
> -     $line_number++;
> -
> +    // This was the previous directory [first]
> +    $prev_dir = $new_dir = $DOCDIR."en";
> +
> +    // Go through all files collected
> +    foreach ($files_status as $num => $file) {
> +
> +        // Make the maintainer a link, if we have that maintainer in the 
list
> +        if (isset($maint_by_nick[$file["maintainer"]])) {
> +          $file["maintainer"] = '<a href="#maint' . $maint_by_nick[$file[
"maintainer"]] .
> +                                '">' . $file["maintainer"] . '</a>';
> +        }
> +
> +        // If we have a 'numeric' revision diff and it is not zero,
> +        // make a link to the CVS repository's diff script
> +        if ($file["revision"][2] != "n/a" && $file["revision"][2] !== 0) 
{
> +            $file["short_name"] = "<a href=\"http://cvs.php.net/diff.php/
" .
> +                                  preg_replace( "'^".$DOCDIR."'", "phpdoc
/", $file["full_name"]) .
> +                                  "?r1=" . $file["revision"][1] .
> +                                  "&r2=" . $file["revision"][0] .
> +                                  CVS_OPT . "\">" . $file["short_name"] .
 "</a>";
> +        }
> +
> +        // Guess the new directory from the full name of the file
> +        $new_dir = dirname($file["full_name"]);
> +
> +        // If this is a new directory, put out old dir lines
> +        if ($new_dir != $prev_dir && isset($lines)) {
> +            echo $prev_diplay_dir;
> +            echo " ($line_number)</th></tr>";
> +    	echo $lines;
> +
> +    	$lines = '';
> +    	$line_number = 0;
> +
> +            // Store the new actual directory
> +            $prev_dir = $new_dir;
> +        }
> +        // Drop out the unneeded parts from the dirname...
> +        $display_dir = str_replace($DOCDIR."en/", "", dirname($file["full
_name"]));
> +        $prev_diplay_dir = "<tr class=blue><th colspan=12>$display_dir";
> +
> +        // Save the line for the current file (get file name shorter)
> +        $lines .= "<tr class={$CSS[$file['mark']]}><td>{$file['short_name
']}</td>".
> +              "<td> {$file['revision'][0]}</td>" .
> +              "<td> {$file['revision'][1]}</td>".
> +              "<td class=rb>{$file['revision'][2]} </td>".
> +              "<td class=r>{$file['size'][0]} </td>".
> +              "<td class=r>{$file['size'][1]} </td>".
> +              "<td class=rb>{$file['size'][2]} </td>".
> +              "<td class=r>{$file['date'][0]} </td>".
> +              "<td class=r>{$file['date'][1]} </td>".
> +              "<td class=rb>{$file['date'][2]} </td>".
> +              "<td class=c>{$file['maintainer']}</td>".
> +              "<td class=c>".trim($file['status'])."</td></tr>\n";
> +         $line_number++;
> +
> +    }
> +
> +    // echo the last dir and $lines
> +    echo "$prev_diplay_dir ($line_number)</th></tr>";
> +    echo $lines;
> +
> +    print("</table>\n<p> </p>\n$navbar<p> </p>\n");
> +
>  }
>
> -// echo the last dir and $lines
> -echo "$prev_diplay_dir ($line_number)</th></tr>";
> -echo $lines;
> -
> -print("</table>\n<p> </p>\n$navbar<p> </p>\n");
> -
>
>  //  ========================================
==============================
===
>  // Work in progress table goes here

Report this thread to moderator Post Follow-up to this message
Old Post
Mehdi Achour
10-29-04 08:56 PM


Re: Small patch for revcheck.php
Hi Geroge,

I have applied your fix to both phpdoc and smarty. Thank you.

Mehdi

George Miroshnikov wrote:
> Please review this patch (general and smarty versions).
> It hides the files table (header) if no outdated files found.
> Well, this is not a "mission-critical" patch, but why not? :)
>
>
> ------------------------------------------------------------------------
>
> Index: docs/scripts/revcheck.php
>  ========================================
===========================
> RCS file: /repository/smarty/docs/scripts/revcheck.php,v
> retrieving revision 1.4
> diff -u -u -r1.4 revcheck.php
> --- docs/scripts/revcheck.php	25 Oct 2004 11:13:34 -0000	1.4
> +++ docs/scripts/revcheck.php	29 Oct 2004 11:51:18 -0000
> @@ -721,6 +721,8 @@
>  // Files table goes here
>  //  ========================================
==============================
===
>
> +if (count($files_status) != 0) {
> +
>  print <<<END_OF_MULTILINE
>  <a name="files"></a>
>  <table width="820" border="0" cellpadding="4" cellspacing="1" align="cent
er">
> @@ -745,63 +747,64 @@
>  </tr>
>  END_OF_MULTILINE;
>
> -// This was the previous directory [first]
> -$prev_dir = $new_dir = $DOCDIR."en";
> -
> -// Go through all files collected
> -foreach ($files_status as $num => $file) {
> -
> -    // Make the maintainer a link, if we have that maintainer in the list
> -    if (isset($maint_by_nick[$file["maintainer"]])) {
> -      $file["maintainer"] = '<a href="#maint' . $maint_by_nick[$file["mai
ntainer"]] .
> -                            '">' . $file["maintainer"] . '</a>';
> -    }
> -
> -    // If we have a 'numeric' revision diff and it is not zero,
> -    // make a link to the CVS repository's diff script
> -    if ($file["revision"][2] != "n/a" && $file["revision"][2] !== 0) {
> -        $file["short_name"] = "<a href=\"http://cvs.php.net/diff.php/" .
> -                              preg_replace( "'^".$DOCDIR."'", "smarty/doc
s/", $file["full_name"]) .
> -                              "?r1=" . $file["revision"][1] .
> -                              "&r2=" . $file["revision"][0] .
> -                              CVS_OPT . "\">" . $file["short_name"] . "</
a>";
> -    }
> -
> -    // Guess the new directory from the full name of the file
> -    $new_dir = dirname($file["full_name"]);
> -
> -    // If this is a new directory, put out dir headline
> -    if ($new_dir != $prev_dir) {
> -
> -        // Drop out the unneeded parts from the dirname...
> -        $display_dir = str_replace($DOCDIR."en/", "", dirname($file["full
_name"]));
> -
> -        // Print out directory header
> -        print "<tr class=blue><th colspan=12>$display_dir</th></tr>\n";
> -
> -        // Store the new actual directory
> -        $prev_dir = $new_dir;
> -    }
> -
> -    // Write out the line for the current file (get file name shorter)
> -    print "<tr class={$CSS[$file['mark']]}><td>{$file['short_name']}</td>
".
> -          "<td> {$file['revision'][0]}</td>" .
> -          "<td> {$file['revision'][1]}</td>".
> -          "<td class=rb>{$file['revision'][2]} </td>".
> -          "<td class=r>{$file['size'][0]} </td>".
> -          "<td class=r>{$file['size'][1]} </td>".
> -          "<td class=rb>{$file['size'][2]} </td>".
> -          "<td class=r>{$file['date'][0]} </td>".
> -          "<td class=r>{$file['date'][1]} </td>".
> -          "<td class=rb>{$file['date'][2]} </td>".
> -          "<td class=c>{$file['maintainer']}</td>".
> -          "<td class=c>".trim($file['status'])."</td></tr>\n";
> +    // This was the previous directory [first]
> +    $prev_dir = $new_dir = $DOCDIR."en";
> +
> +    // Go through all files collected
> +    foreach ($files_status as $num => $file) {
> +
> +        // Make the maintainer a link, if we have that maintainer in the 
list
> +        if (isset($maint_by_nick[$file["maintainer"]])) {
> +          $file["maintainer"] = '<a href="#maint' . $maint_by_nick[$file[
"maintainer"]] .
> +                                '">' . $file["maintainer"] . '</a>';
> +        }
> +
> +        // If we have a 'numeric' revision diff and it is not zero,
> +        // make a link to the CVS repository's diff script
> +        if ($file["revision"][2] != "n/a" && $file["revision"][2] !== 0) 
{
> +            $file["short_name"] = "<a href=\"http://cvs.php.net/diff.php/
" .
> +                                  preg_replace( "'^".$DOCDIR."'", "smarty
/docs/", $file["full_name"]) .
> +                                  "?r1=" . $file["revision"][1] .
> +                                  "&r2=" . $file["revision"][0] .
> +                                  CVS_OPT . "\">" . $file["short_name"] .
 "</a>";
> +        }
> +
> +        // Guess the new directory from the full name of the file
> +        $new_dir = dirname($file["full_name"]);
> +
> +        // If this is a new directory, put out dir headline
> +        if ($new_dir != $prev_dir) {
> +
> +            // Drop out the unneeded parts from the dirname...
> +            $display_dir = str_replace($DOCDIR."en/", "", dirname($file["
full_name"]));
> +
> +            // Print out directory header
> +            print "<tr class=blue><th colspan=12>$display_dir</th></tr>\n
";
> +
> +            // Store the new actual directory
> +            $prev_dir = $new_dir;
> +        }
> +
> +        // Write out the line for the current file (get file name shorter
)
> +        print "<tr class={$CSS[$file['mark']]}><td>{$file['short_name']}<
/td>".
> +              "<td> {$file['revision'][0]}</td>" .
> +              "<td> {$file['revision'][1]}</td>".
> +              "<td class=rb>{$file['revision'][2]} </td>".
> +              "<td class=r>{$file['size'][0]} </td>".
> +              "<td class=r>{$file['size'][1]} </td>".
> +              "<td class=rb>{$file['size'][2]} </td>".
> +              "<td class=r>{$file['date'][0]} </td>".
> +              "<td class=r>{$file['date'][1]} </td>".
> +              "<td class=rb>{$file['date'][2]} </td>".
> +              "<td class=c>{$file['maintainer']}</td>".
> +              "<td class=c>".trim($file['status'])."</td></tr>\n";
> +
> +    }
> +
> +    print("</table>\n<p> </p>\n$navbar<p> </p>\n");
>
>  }
>
> -print("</table>\n<p> </p>\n$navbar<p> </p>\n");
> -
> -
>  //  ========================================
==============================
===
>  // Work in progress table goes here
>  //  ========================================
==============================
===
>
>
> ------------------------------------------------------------------------
>
> Index: scripts/revcheck.php
>  ========================================
===========================
> RCS file: /repository/phpdoc/scripts/revcheck.php,v
> retrieving revision 1.47
> diff -u -u -r1.47 revcheck.php
> --- scripts/revcheck.php	5 Sep 2004 22:11:53 -0000	1.47
> +++ scripts/revcheck.php	29 Oct 2004 12:00:44 -0000
> @@ -727,6 +727,8 @@
>  // Files table goes here
>  //  ========================================
==============================
===
>
> +if (count($files_status) != 0) {
> +
>  print <<<END_OF_MULTILINE
>  <a name="files"></a>
>  <table width="820" border="0" cellpadding="4" cellspacing="1" align="cent
er">
> @@ -751,70 +753,72 @@
>  </tr>
>  END_OF_MULTILINE;
>
> -// This was the previous directory [first]
> -$prev_dir = $new_dir = $DOCDIR."en";
> -
> -// Go through all files collected
> -foreach ($files_status as $num => $file) {
> -
> -    // Make the maintainer a link, if we have that maintainer in the list
> -    if (isset($maint_by_nick[$file["maintainer"]])) {
> -      $file["maintainer"] = '<a href="#maint' . $maint_by_nick[$file["mai
ntainer"]] .
> -                            '">' . $file["maintainer"] . '</a>';
> -    }
> -
> -    // If we have a 'numeric' revision diff and it is not zero,
> -    // make a link to the CVS repository's diff script
> -    if ($file["revision"][2] != "n/a" && $file["revision"][2] !== 0) {
> -        $file["short_name"] = "<a href=\"http://cvs.php.net/diff.php/" .
> -                              preg_replace( "'^".$DOCDIR."'", "phpdoc/", 
$file["full_name"]) .
> -                              "?r1=" . $file["revision"][1] .
> -                              "&r2=" . $file["revision"][0] .
> -                              CVS_OPT . "\">" . $file["short_name"] . "</
a>";
> -    }
> -
> -    // Guess the new directory from the full name of the file
> -    $new_dir = dirname($file["full_name"]);
> -
> -    // If this is a new directory, put out old dir lines
> -    if ($new_dir != $prev_dir && isset($lines)) {
> -        echo $prev_diplay_dir;
> -        echo " ($line_number)</th></tr>";
> -	echo $lines;
> -
> -	$lines = '';
> -	$line_number = 0;
> -
> -        // Store the new actual directory
> -        $prev_dir = $new_dir;
> -    }
> -    // Drop out the unneeded parts from the dirname...
> -    $display_dir = str_replace($DOCDIR."en/", "", dirname($file["full_nam
e"]));
> -    $prev_diplay_dir = "<tr class=blue><th colspan=12>$display_dir";
> -
> -    // Save the line for the current file (get file name shorter)
> -    $lines .= "<tr class={$CSS[$file['mark']]}><td>{$file['short_name']}<
/td>".
> -          "<td> {$file['revision'][0]}</td>" .
> -          "<td> {$file['revision'][1]}</td>".
> -          "<td class=rb>{$file['revision'][2]} </td>".
> -          "<td class=r>{$file['size'][0]} </td>".
> -          "<td class=r>{$file['size'][1]} </td>".
> -          "<td class=rb>{$file['size'][2]} </td>".
> -          "<td class=r>{$file['date'][0]} </td>".
> -          "<td class=r>{$file['date'][1]} </td>".
> -          "<td class=rb>{$file['date'][2]} </td>".
> -          "<td class=c>{$file['maintainer']}</td>".
> -          "<td class=c>".trim($file['status'])."</td></tr>\n";
> -     $line_number++;
> -
> +    // This was the previous directory [first]
> +    $prev_dir = $new_dir = $DOCDIR."en";
> +
> +    // Go through all files collected
> +    foreach ($files_status as $num => $file) {
> +
> +        // Make the maintainer a link, if we have that maintainer in the 
list
> +        if (isset($maint_by_nick[$file["maintainer"]])) {
> +          $file["maintainer"] = '<a href="#maint' . $maint_by_nick[$file[
"maintainer"]] .
> +                                '">' . $file["maintainer"] . '</a>';
> +        }
> +
> +        // If we have a 'numeric' revision diff and it is not zero,
> +        // make a link to the CVS repository's diff script
> +        if ($file["revision"][2] != "n/a" && $file["revision"][2] !== 0) 
{
> +            $file["short_name"] = "<a href=\"http://cvs.php.net/diff.php/
" .
> +                                  preg_replace( "'^".$DOCDIR."'", "phpdoc
/", $file["full_name"]) .
> +                                  "?r1=" . $file["revision"][1] .
> +                                  "&r2=" . $file["revision"][0] .
> +                                  CVS_OPT . "\">" . $file["short_name"] .
 "</a>";
> +        }
> +
> +        // Guess the new directory from the full name of the file
> +        $new_dir = dirname($file["full_name"]);
> +
> +        // If this is a new directory, put out old dir lines
> +        if ($new_dir != $prev_dir && isset($lines)) {
> +            echo $prev_diplay_dir;
> +            echo " ($line_number)</th></tr>";
> +    	echo $lines;
> +
> +    	$lines = '';
> +    	$line_number = 0;
> +
> +            // Store the new actual directory
> +            $prev_dir = $new_dir;
> +        }
> +        // Drop out the unneeded parts from the dirname...
> +        $display_dir = str_replace($DOCDIR."en/", "", dirname($file["full
_name"]));
> +        $prev_diplay_dir = "<tr class=blue><th colspan=12>$display_dir";
> +
> +        // Save the line for the current file (get file name shorter)
> +        $lines .= "<tr class={$CSS[$file['mark']]}><td>{$file['short_name
']}</td>".
> +              "<td> {$file['revision'][0]}</td>" .
> +              "<td> {$file['revision'][1]}</td>".
> +              "<td class=rb>{$file['revision'][2]} </td>".
> +              "<td class=r>{$file['size'][0]} </td>".
> +              "<td class=r>{$file['size'][1]} </td>".
> +              "<td class=rb>{$file['size'][2]} </td>".
> +              "<td class=r>{$file['date'][0]} </td>".
> +              "<td class=r>{$file['date'][1]} </td>".
> +              "<td class=rb>{$file['date'][2]} </td>".
> +              "<td class=c>{$file['maintainer']}</td>".
> +              "<td class=c>".trim($file['status'])."</td></tr>\n";
> +         $line_number++;
> +
> +    }
> +
> +    // echo the last dir and $lines
> +    echo "$prev_diplay_dir ($line_number)</th></tr>";
> +    echo $lines;
> +
> +    print("</table>\n<p> </p>\n$navbar<p> </p>\n");
> +
>  }
>
> -// echo the last dir and $lines
> -echo "$prev_diplay_dir ($line_number)</th></tr>";
> -echo $lines;
> -
> -print("</table>\n<p> </p>\n$navbar<p> </p>\n");
> -
>
>  //  ========================================
==============================
===
>  // Work in progress table goes here

Report this thread to moderator Post Follow-up to this message
Old Post
Mehdi Achour
10-29-04 08:56 PM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

PHP Documentation archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 05:12 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.