We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 15065
    • 138 Posts
    Hi

    Anybody know on what basis files arranged in FCKEditor - I mean alphabetical, or some other basis

    pls reply

    jurdy
      • 10449
      • 956 Posts
      iirc, it’s the Apache default filelisting sort-order. Which is by file-creation or file-modification date, if I’m not mistaken.

      If you want to change that behaviour, you’ll have to hack two files in your manager/media/browser/mcpuk/connectors/php/Commands/ directory:

      sort($folders); // add this at approx. line 60 in GetFolders.php
      sort($files); // add this at approx. line 91 in GetFoldersAndFiles.php
      
        • 15065
        • 138 Posts
        thanks
          • 15065
          • 138 Posts
          Hi

          thanks for your reply. I tried  "sort($files); " and I got the files in alphabetical sorted order.

          But I couldn’t sort the folders. When I tried with "sort($folders)"  in getfolders.php it didn’t display in sorted order. I tried it several lines near line 60. Where is its correct place to add. The following is my page (line 40-64)
          <?php
          if ($dh=opendir($this->real_cwd)) {
          while (($filename=readdir($dh))!==false) {
          if (($filename!=".")&&($filename!="..")) {
          if (is_dir($this->real_cwd."/$filename")) {

          //check if$fckphp_configured not to show this folder
          $hide=false;
          for($i=0;$i<sizeof($this->fckphp_config[’ResourceAreas’][$this->type][’HideFolders’]);$i++)
          $hide=(ereg($this->fckphp_config[’ResourceAreas’][$this->type][’HideFolders’][$i],$filename)?true:$hide);

          if (!$hide) echo "<Folder name=\"$filename\" />\n";
          }
          }
          }
          closedir($dh);
          }
          ?>
          </Folders>
          </Connector>
          <?php
          }
          }

          ?>

          Pls reply.....

          thanks

          jurdi
            • 10449
            • 956 Posts
            
            				closedir($dh);
            			}
            
            sort($folders);
            foreach($folders as $k=>$v) {
            	echo "<Folder name=\"$v\" />\n";
            }
            		
            		?>
            	</Folders>
            
            
            



            I don’t remember if I had to delete a line further up, but this should work.
              • 15065
              • 138 Posts
              Hi

              I tried it in my two sites but it does not work. [ I copied the same code and paste it. ] Is there any changes to made ?

              Pls help me..

              thanks ..

              jurdi
                • 15065
                • 138 Posts
                Hi
                I cut & paste your code. but didn’t work. $k and $v denotes what ? Any need to change variable?

                pls help

                thanks & regards

                jurdi