here you can read more details about custom post type: http://codex.wordpress.org/Post_Types
So we will be sorting the downloads via WP rather than Download Manager?
When is this likely to come into play as I am now looking at alternatives for file management as i require files to be in date order.
I have given up on WPDM. All we ask is for a simple sorting function. Simple as that. Donkeymusic-if you find a good alternative, post back. We will do the same.
I must have it, How did you do that?
I thougt I must repalace the $id parameter with something like $name to sort it by name.
How did you do that?
It works at this website: http://culchethhigh.co.uk/the-eagle-newsletter/ .
If my English is not so good, I’m a German.
Alexander,
Sorting by ID is fine, but name is not working. Following the reposted link in your posting, it is clear this guy wasn’t able to sort by Name either.
I wish the developer would add name sorting already!!
For theconsolidatedlodge;
Ok, now I know it…
It’s not so good, that the developer hasn’t add this function, to sort by nme, but now, I guess, you must replace this:
$ndata = $wpdb->get_results(“select * from ahm_files where category like ‘%\”$id\”%’ limit $start, $item_per_page”,ARRAY_A);
wih this:
$ndata = $wpdb->get_results(“select * from ahm_files where category like ‘%\”$id\”%’ order by title asc limit $start, $item_per_page”,ARRAY_A);
But it’s better, if you lokk in your dat-tabel, of the plugin an find out, wht, you want to sort.
Thank you for a reply,
Alexander Jank
Are you suggesting that the snippet you provided sorts the packages by name? if so, in which file did you make this edit?
For theconsolidatedlodge;
I edited the file named “download-manager/download-manager.php” in the plugin, it’s 100% compatible with the new version 2.5.3.
But you must search with ctrl+f for “items” and there is only one result. The line 7 after the found word is the line, you must edit.
I updated the Post, what I have writte before this, there are the compatible things.
It’s line 600.
My change is into the MySQL command.
Thank you for a reply,
Alexander Jank
Oh, yes, i have forgotten the example:
Go to this Link:
http://test.alexanderjank.de/wordpress/downloads/
It’s our school WordPress.
I’m developing for my school.
The link you show, isnt working with sorting by name and only was until the update earlier this year since then it has not worked and the lack of support from the designer is very limited although they did say they update in April would include this option.
I have made the changes as suggested in post #9467 and this returns an error. Returned to an earlier post and added order “by id desc” to line 600 of download-manager.php – no error and this was the change i made earlier in the year that worked. However nothing is happening now.
So, I am now questioning myself as to what i am expecting to happen, I was hoping that from the backend i can force the ordering of the files, but going through all options i cannot see this, so as a back up option i would like to be able to sort them from the front end and then any member of the publish can filter them as they wish, but i dont see any filter options at all.
The page i am working on is http://culchethhigh.co.uk/the-eagle-newsletter/ and as you can see the newsletters are in no order.
Any advice or assistance would be much appreciated.
Thank you
For theconsolidatedlodge;
It’s to much work, I think, to add a line with filter options, it will be to much work, because you must add the Line and there some buttons must appear, you must style them with a lot of css and gthen, the user can order them in the frontdend by name.
My solution, is for the frontednd and not for the backend.
I konw, that the letters in my example are ordered, it orders the files alphabetical.
I have now added my “download-manager/download-manager.php” in the txt format to post #9467.
Here is the Link to the file I have uplouded:
http://www.wpdownloadmanager.com/wp-content/uploads/2013/10/d-manager.txt
The SQL command, what does this work ist: “SELECT * FROM ‘ahm_files‘ WHERE ‘category‘ LIKE ‘%\”$id\”%’ ORDER BY ‘title‘ ASC”
It’ correct SQL syntax.
I have made a screensshot, later, I will add it to the post, I’ve got technical problems…
Thank you for replys.
Alexander Jank
Alexander, these edits didn’t seem to fix my issue either 🙁 , but at least they didn’t throw an error like it did for donkeymusic.
Donkeymusic, I think it would be great for the author to implement filtering, but to do this is a huge amount of coding and CSS.
it would be wonderful to see sorting actually work, searching and filtering go into future releases. i am going to play around with this a bit more today; I’ll post back anything that may be useful in helping us to resolve this name sorting issue. Also, for the record, I did attach a screen capture of my document library, just so you can see what i am dealing with. Cannot provide a link to this library-too sensitive.
hey donkeymusic, hey theconsolidatedlodge,
Ok, my Link was false, it was password protected.
New link to the Plugin on my testblog:
http://test.alexanderjank.de/wordpress/downloads/
Ok.
Thanks for a reply
Alexander Jank
it looks like you fixed it for your site. What does your shortcode look like? Also, did you make any changes other than line 600 in download-manager.php?
My shortcode: [wpdm_tree order_by=”title” order=”desc”]
I’ve got the download manager free.
My shortcode:
{wpdm_category=download-site}
because, they are all in the category called download-site.
I’ve only made the changes in line 600 of the file.
Alexander jank
For theconsolidatedlodge,
In you thing, if you want to display the tree, you must edit line 345.
please replace:
$ndata = $wpdb->get_results(“select * from ahm_files where category like ‘%\”{$_POST[‘dir’]}\”%'”,ARRAY_A);
with this:
$ndata = $wpdb->get_results(“select * from ahm_files where category like ‘%\”{$_POST[‘dir’]}\”%’ order by title asc”,ARRAY_A);
I’ve added the file, for the tree and the category list to this post.
Thanks for replys.
Alexander Jank
I’ve forgotten to say:
I’ve added the tree with your shortcode to my example.
look at:
http://test.alexanderjank.de/wordpress/downloads/
It’s in the end of this site.
I have the free edition as well. Thanks for the shortcode; we’re using two different views.
However, you were helpful in pointing me in the right direction, so thank you! I am trying to use the dropdown tree view and order the documents by name (‘title’). I think i need to change the code between lines 568-574 to force the dropdown tree to sort by title.
I’ve written it before…
It’s line 345 to sort the files in the dropdown list by title.
It’s in #9494.
And, I know, we use two diffrent views, but I have fixed it for your view too, look at #9494.
And go to the link….
Under my method, there is your tree structure method.
Alexanderjank, I have copied your suggestions and it has done the job, the issue for me is that i think i needed them to be listed in date created order. Now they are in a more random order than before http://culchethhigh.co.uk/the-eagle-newsletter/
Totally did not see your post 9494 earlier. I implemented you code on line 345 and it worked perfect. Thank you SO much, Alexander! You really helped me out!!
You cannot sort the items by creation-date.
Because tthe creation-date is not given to the MySQL Database.
Thank you for your replys.
Alexander Jank, Germany
mmm, i m sure i used to have them like this, just trying to find my original thread to see what i enquired about
What schould this mean, I’m a German, I don’t understand it….
The topic ‘Sorting Download Files’ is closed to new replies.