Possible to sort attachments by name?
nathanreed
New
Is it possible to sort attachments by name?
This would solve a problem for me :-)
Thanks for any help!
Tagged:
0
Comments
yes, you could probably sort it via jquery or js as one solution, if you wanted to research it and write yourself a mod.
although probably faster to sort via php upon discussion display.
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
I don't think I've got the skills to mod the plugin myself.
I was hoping there might be a "sort" option somewhere in the plugin that I'm missing, but I don't see anything obvious.
you could change the FileUpload/views/link_files.php ands sort there as well.
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
.
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
deleted.
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
@nathanreed
replace FileUpload/views/link_files.php with the unzipped version of attachment below.
if it works for you awesome, let me know.
here is a mod for vanilla 2.0.18.10 of the plugin 1.5.2 downloadable
if not .. oh well.
and click awesome, do not accept this as best answer - otherwise this zip file will disappear.
to be forewarned is to be forearmed.
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
my final answer.
modify FileUpload/views/link_files.php change line 5 from foreach ($this->Data('CommentMediaList') as $Media) { to the following - insert the following lines.... with line 5 comented as below. $newarray = array(); foreach ($this->Data('CommentMediaList') as $Media) { $name = htmlspecialchars($Media->Name); $newarray[$name] = $Media; } ksort($newarray); // change attachment order to alpha sort. foreach ($newarray as $Media) { // foreach ($this->Data('CommentMediaList') as $Media) {I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.