ispCP - Board - Support
Line Break in long lines (Seen in folder protection area) - Printable Version

+- ispCP - Board - Support (http://www.isp-control.net/forum)
+-- Forum: ispCP Omega Development Area (/forum-1.html)
+--- Forum: Suggestions (/forum-2.html)
+--- Thread: Line Break in long lines (Seen in folder protection area) (/thread-9249.html)



Line Break in long lines (Seen in folder protection area) - MasterTH - 01-18-2010 01:05 AM

Hi,

a customer tells me, that in his usage of the passwort-protected folders the site is getting longer and longer. he has 20 or 30 users in one group. And when he adds a user to the group the line of the group gets longer, everytime.

So, my suggestion is, to add a line break after x signs, and the line is cutted after the last ","...

Code:
if (lenght($string > 30)){

}


to be continued... Wink


RE: Line Break in long lines (Seen in folder protection area) - MasterTH - 01-23-2010 08:36 AM

i coded something, but i dont know why the for-loop isn't entered

Code:
#!/usr/bin/perl

use strict;

my $completestring;
my $splittedstring;
my $splittedstring2='';
my $splittedstring3='';
my @splitteddataset;
my $datasetsize;
my $lengthnextsplit;

$completestring="asdhkjashdkas,asdhkasdhkasd,asdhklashdkasd,asdhkashdkas,asdhkasdhkasd,asdhkashdk​asd,asdhjashdkasd,asdhjashkdas,123";
$splittedstring=$completestring;

while (length($splittedstring)>30) {
    $splittedstring2 = substr($splittedstring, 0, 30);
    #print "$splittedstring2\n";
    @splitteddataset = reverse split(/,/,$splittedstring2,2);
    my $splittedstring3 = "$splittedstring3\s@splitteddataset[1],\s";

    $lengthnextsplit = length($splittedstring3);
    $splittedstring = substr($splittedstring, $lengthnextsplit,30);
    
}


but i think this should work... when the for-loop sets the string3...


I'd like to have some feedback Wink


RE: Line Break in long lines (Seen in folder protection area) - joximu - 01-23-2010 07:29 PM

why perl?

this is a gui problem and should be solved in the gui... -> php...

/J


RE: Line Break in long lines (Seen in folder protection area) - MasterTH - 04-01-2010 01:59 AM

i had a lot of work to do, but now i found the time to code this in php.

i'll try it in my installation an post the code in here.


RE: Line Break in long lines (Seen in folder protection area) - joximu - 04-01-2010 05:18 PM

Hi

thanx - I'm looking forward to your solution :-)

/J