Originally posted by ImEraz
Thanks !
But i got an error :
You must login or register to view this content.
In english "length can not be less than 0"
Just play around with it until you can get it to work. I did most of the work for you

The error you get is because your folders might not be correctly setup or a few of your folders do not have "[" and "]".
It's trying to get the substring in between these two characters, and its throwing that error because a few folders don't have them.
I suggest adding a check to see which of the files have the characters "[" and "]".