Re: [PHP-DOC] Patch for revcheck.php script

2005-07-28 Thread Yannick Torres
Nuno ?

How about this patch ?

Le Mardi 5 Juillet 2005 21:12, Yannick Torres a écrit :
 Le Mardi 5 Juillet 2005 21:09, Nuno Lopes a écrit :
  OK, thanks!
 
  This week I'm too busy, but next week I'll review and test it.
 
  Thanks,
  Nuno

 Thanks :)

-- 
Yannick


Re: [PHP-DOC] Patch for revcheck.php script

2005-07-28 Thread mazzanet

Just tested it here and it works fine, thanks.

I had to modify your www/revcheck.php patch slightly from
+$num = count($missfiles);
to
+$num = count($oldfiles);
for the file count to work properly.


Yannick Torres wrote:

Nuno ?

How about this patch ?

Le Mardi 5 Juillet 2005 21:12, Yannick Torres a écrit :


Le Mardi 5 Juillet 2005 21:09, Nuno Lopes a écrit :


OK, thanks!

This week I'm too busy, but next week I'll review and test it.

Thanks,
Nuno


Thanks :)





Re: [PHP-DOC] Patch for revcheck.php script

2005-07-28 Thread Nuno Lopes
Sorry Yannick, but I went in vacations and obviously without computer or 
internet access. I only came back yesterday.

Anyway, mazzanet has applied your patch today.

Sorry for the delay,
Nuno



Nuno ?

How about this patch ?

Le Mardi 5 Juillet 2005 21:12, Yannick Torres a écrit :
 Le Mardi 5 Juillet 2005 21:09, Nuno Lopes a écrit :
  OK, thanks!
 
  This week I'm too busy, but next week I'll review and test it.
 
  Thanks,
  Nuno

 Thanks :)

--
Yannick 


Re: [PHP-DOC] Patch for revcheck.php script

2005-07-28 Thread Yannick Torres
No problem Nuno :)

And thanks to mazzanet :)

I'm happy to see that it works fine :)

Le Jeudi 28 Juillet 2005 13:27, Nuno Lopes a écrit :
 Sorry Yannick, but I went in vacations and obviously without computer or
 internet access. I only came back yesterday.
 Anyway, mazzanet has applied your patch today.

 Sorry for the delay,
 Nuno

-- 
Yannick


Re: [PHP-DOC] Patch for revcheck.php script

2005-07-05 Thread Nuno Lopes

OK, thanks!

This week I'm too busy, but next week I'll review and test it.

Thanks,
Nuno


- Original Message - 

Hi Nuno,

I have done it. Look at these patchs.
I haven't tested them but they seem to work.

Tell me what you think about it.
If you agree with it, commit it, i haven't docweb cvs karma.

PS : Sorry again for my very bad english... :)
--
Yannick


Re: [PHP-DOC] Patch for revcheck.php script

2005-07-05 Thread Yannick Torres
Le Mardi 5 Juillet 2005 21:09, Nuno Lopes a écrit :
 OK, thanks!

 This week I'm too busy, but next week I'll review and test it.

 Thanks,
 Nuno

Thanks :)

-- 
Yannick


Re: [PHP-DOC] Patch for revcheck.php script

2005-07-04 Thread Yannick Torres
Hi Nuno,

I have done it. Look at these patchs.
I haven't tested them but they seem to work.

Tell me what you think about it.
If you agree with it, commit it, i haven't docweb cvs karma.

PS : Sorry again for my very bad english... :)

Le Samedi 2 Juillet 2005 21:00, Nuno Lopes a écrit :
 Hi Yannick,

 Thanks for your work! Just go ahead and commit it (or do you want me to do
 it?).

 And if you have some time, please port this fix to docweb (this isn't easy,
 because it parses the files in a different way AFAIR).

 Nuno


-- 
Yannick
Index: include/lib_revcheck.inc.php
===
RCS file: /repository/docweb/include/lib_revcheck.inc.php,v
retrieving revision 1.9
diff -U3 -r1.9 lib_revcheck.inc.php
--- include/lib_revcheck.inc.php5 Nov 2004 09:41:56 -   1.9
+++ include/lib_revcheck.inc.php4 Jul 2005 19:57:46 -
@@ -217,6 +217,32 @@
 }
 }
 
+function get_oldfiles($idx, $lang)
+{
+$sql = 'SELECT
+ dir, file, size
+
+ FROM
+ old_files
+
+ WHERE
+ lang=' . $lang . '
+ ';
+
+$result = sqlite_query($idx, $sql);
+$num = sqlite_num_rows($result);
+if ($num == 0) {
+// only 'null' will produce a 0 with sizeof()
+return null;
+} else {
+$tmp = array();
+while ($r = sqlite_fetch_array($result, SQLITE_ASSOC)) {
+$tmp[] = array('dir' = $r['dir'], 'size' = $r['size'], 'file' = 
$r['file']);
+}
+return $tmp;
+}
+}
+
 function get_description($idx, $lang)
 {
 $sql = 'SELECT intro FROM description WHERE lang = ' . $lang . ';';
Index: www/revcheck.php
===
RCS file: /repository/docweb/www/revcheck.php,v
retrieving revision 1.17
diff -U3 -r1.17 revcheck.php
--- www/revcheck.php22 May 2005 10:40:33 -  1.17
+++ www/revcheck.php4 Jul 2005 19:55:44 -
@@ -120,6 +120,7 @@
   li?php echo ($PART == 'files' ) ? ' class=liSelected' : ''; ?a 
href=?php echo BASE_URL . '/revcheck.php?p=filesFiles/a'; ?/li
   li?php echo ($PART == 'misstags' ) ? ' class=liSelected' : ''; ?a 
href=?php echo BASE_URL . '/revcheck.php?p=misstagsMissing revision 
numbers/a'; ?/li
   li?php echo ($PART == 'missfiles' ) ? ' class=liSelected' : ''; ?a 
href=?php echo BASE_URL . '/revcheck.php?p=missfilesUntranslated 
files/a'; ?/li
+  li?php echo ($PART == 'oldfiles' ) ? ' class=liSelected' : ''; ?a 
href=?php echo BASE_URL . '/revcheck.php?p=oldfilesNot in EN tree/a'; 
?/li
   li?php echo ($PART == 'graph' ) ? ' class=liSelected' : ''; ?a 
href=?php echo BASE_URL . '/revcheck.php?p=graphGraph/a'; ?/li
  /ul
 ?php
@@ -233,6 +234,43 @@
 }
 break;
 
+case 'oldfiles' :
+$oldfiles = get_oldfiles($dbhandle, $LANG);
+if (!$oldfiles) {
+echo 'No old file info';
+} else {
+$num = count($missfiles);
+echo OLDTAGS_HEAD
+pnbsp;/p
+div style=text-align:center !-- Compatibility with old IE --
+table width=400 border=0 cellpadding=3 cellspacing=1 class=Tc
+tr class=blue
+th rowspan=1Not in EN tree ($num files):/th
+th colspan=1kB/th
+/tr
+
+OLDTAGS_HEAD;
+
+$last_dir = false;
+$total_size = 0;
+foreach ($oldfiles as $old) {
+if (!$last_dir || $last_dir != $old['dir']) {
+echo 'tr class=blueth colspan=2' . $old['dir'] . 
'/th/tr';
+$last_dir = $old['dir'];
+}
+echo 'tr class=wiptd', $old['file'], '/tdtd 
class=r', $old['size'], '/td/tr';
+$total_size += $old['size'];
+// flush every 200 kbytes
+if (($total_size % 200) == 0) {
+flush();
+}
+}
+echo 'tr class=blue
+  th colspan=2Total Size ('.$num.' files): 
'.$total_size.' kB/th
+  /tr';
+echo '/table/div';
+}
+break;
 
 case 'misstags' :
 $sql = 'select
Index: scripts/rev.php
===
RCS file: /repository/docweb/scripts/rev.php,v
retrieving revision 1.15
diff -U3 -r1.15 rev.php
--- scripts/rev.php 26 Jan 2005 17:23:24 -  1.15
+++ scripts/rev.php 4 Jul 2005 19:56:19 -
@@ -147,6 +147,13 @@
 UNIQUE(lang, dir, name)
 );
 
+CREATE TABLE old_files (
+lang TEXT,
+dir TEXT,
+file TEXT,
+size INT
+);
+
 SQL;
 
 /**
@@ -252,6 +259,23 @@
 }
 }
 
+function dir_sort_old($a, $b) {
+global $DOCS, $dir, $lang;
+$a = $DOCS . $lang . $dir . '/' . $a;
+$b = $DOCS . $lang . $dir . '/' . $b;
+if (is_dir($a)  is_dir($b)) {
+return 0;
+} elseif (is_file($a)  is_file($b)) {
+return 0;
+} elseif (is_file($a)  is_dir($b)) {
+return -1;
+} elseif (is_dir($a)  is_file($b)) {
+

Re: [PHP-DOC] Patch for revcheck.php script

2005-07-02 Thread Yannick Torres
Ahem, this is, as you know, in response to the #comment in :

http://news.php.net/php.doc.fr/4219
 
;)

-- 
Yannick


Re: [PHP-DOC] Patch for revcheck.php script

2005-07-02 Thread Nuno Lopes

Hi Yannick,

Thanks for your work! Just go ahead and commit it (or do you want me to do 
it?).


And if you have some time, please port this fix to docweb (this isn't easy, 
because it parses the files in a different way AFAIR).


Nuno


- Original Message - 

Hi Nuno,

Here's a patch for the revcheck.php script of the phpdoc repository. I 
needed
it for the french translation, so there you go. I'm still using the old 
script

on my box, but I don't mind porting it to docweb if it is what you was
thinking
about.

Regards,
--
[EMAIL PROTECTED]