1

Topic: Language selection displays 'hidden' folders.

For those of us who keep PunBB in Subversion, the .svn directory inside of lang/ appears as a language in the drop-down inside the profile editing page, the registration page, and the administrative options page. A simple fix is to exclude .svn (or .cvs or .whatever) from the language list:

Index: admin_options.php
===================================================================
--- admin_options.php   (revision 14)
+++ admin_options.php   (working copy)
@@ -222,7 +222,7 @@
                $d = dir(PUN_ROOT.'lang');
                while (($entry = $d->read()) !== false)
                {
-                       if ($entry != '.' && $entry != '..' && is_dir(PUN_ROOT.'lang/'.$entry))
+                       if ($entry != '.' && $entry != '..' && $entry != '.svn' && is_dir(PUN_ROOT.'lang/'.$entry))
                                $languages[] = $entry;
                }
                $d->close();
Index: register.php
===================================================================
--- register.php        (revision 14)
+++ register.php        (working copy)
@@ -337,7 +337,7 @@
                $d = dir(PUN_ROOT.'lang');
                while (($entry = $d->read()) !== false)
                {
-                       if ($entry != '.' && $entry != '..' && is_dir(PUN_ROOT.'lang/'.$entry))
+                       if ($entry != '.' && $entry != '..' && $entry != '.svn' && is_dir(PUN_ROOT.'lang/'.$entry))
                                $languages[] = $entry;
                }
                $d->close();
Index: profile.php
===================================================================
--- profile.php (revision 14)
+++ profile.php (working copy)
@@ -1129,7 +1129,7 @@
                $d = dir(PUN_ROOT.'lang');
                while (($entry = $d->read()) !== false)
                {
-                       if ($entry != '.' && $entry != '..' && is_dir(PUN_ROOT.'lang/'.$entry))
+                       if ($entry != '.' && $entry != '..' && $entry != '.svn' && is_dir(PUN_ROOT.'lang/'.$entry))
                                $languages[] = $entry;
                }
                $d->close();

Obviously, it would be cleaner to just ignore any directory whose name begins with a . but the above code works just fine for me.

Saab92x.com
Over 2300 users and 265,000 posts, running PunBB for 3 years

Re: Language selection displays 'hidden' folders.

i think rickard has added something similar in the next release

3 (edited by zaher 2005-07-04 09:10)

Re: Language selection displays 'hidden' folders.

There the same problem with _vti_* for whose useing FrontPage extension to upload files, like as me.

If your people come crazy, you will not need to your mind any more.

Re: Language selection displays 'hidden' folders.

http://dev.punbb.org/changeset/195

"Programming is like sex: one mistake and you have to support it for the rest of your life."