By bsuttis on
I've been investigating the JQuery Interface Sortable (http://drupal.org/project/interface_sortable) module and been attempting to make my nodes' file attachments sortable (by drag/drop) without any luck. (I've gotten as far as being able to move the table rows around to much disarray).
I'm willing to pay for the functionality -- I'm assuming it's a fairly small project, not more than a half day's (if that) work to implement. Quotes appreciated -- thanks.
Comments
did you get what you want?
did you get what you want?
Yes, I sponsored
Yes, I sponsored functionality similar to this long ago.
I am searching for a way to
I am searching for a way to sort the attached files of a node, also. can you help me?
thanx!
http://sublunarydesign.com/upload-sort-1.1.zip
http://sublunarydesign.com/upload-sort-1.1.zip
It involves overwriting the core Upload module in 5.5 and running update.php to add a weight column to the files table in your site's database. You also have to add a line of code to upload.js -- read INSTALL.txt.
Then you'll be able to sort Upload.module's file attachments by drag and drop.
A UI note -- while you see additional form fields for weights, you're best to ignore them as dragging/dropping does all the reordering.
I inserted the code in
I inserted the code in upload.js, activated the upload_helper.module and run update.php which was giving me the following answer:
now I can rearrange the attached files - thats nice, thank you very much!
but now I have the problem that my swftools-generated mp3-player is gone. the only reason I wanted to rearrange the uploads was because I wanted to rearrange the mp3-files for the playlist.
:-(
what exactly was changed in the hacked upload.module?
I use swftools without any
I got the error as well, but the column was added, didn't bother looking further into it.
I use swftools without any issue (I needed this mainly for rearranging mp3s as well). I use the wijering player and have Integration enabled so attached mp3s automatically get put in a playlist, haven't tried it with other players.
I suggest using WinMerge to compare the 2 modules if you're curious about changes.
thats strange. i also use
thats strange. i also use wijering player and have Integration enabled so attached mp3s automatically get put in a playlist. and i am also attaching other filetypes.
on your site the rearranging is working together with your wijering player?
I checked my code now.
I checked my code now. before i had turned of the function swftools_integrate_nodeapi() in the swftools_integrate.module (line 26) by commenting out its code (do you know where this function is called?). when i turn it on again it works fine.
the reason why i turned it of was that i don't want the player being generated inside the node but inside a block. i used
for that.
i also need the other uploads listed in a block
with the function upload_attachments_without_mp3() inside my template.php
both block doesn't work anymore.
do you know why?
I was curious about your
I was curious about your problem (and happy to see code separating files by extension), so I tried out your code. It works for me with both checked and non-checked 'List' options.
If you don't want the files output below the node content as well, it's as simple as changing TRUE to FALSE in the first block's code and unchecking the mp3s. See below:
For the second block, add a '!' in front of $file->list, uncheck non-mp3 files, and they'll appear as the second block. See below:
Lastly, turn off the Integration options so the player won't output in the node's content. The files are blocks, not part of the node's content. This all works with the new Upload drag/drop code.
i forgot to mention that i
i forgot to mention that i also overwrite the funktion in the template.php
to not list the files in the node.
hm - i don't understand what i should do.
but i thank you very much for your help and your trying!
You seem to have overwritten
You seem to have overwritten functions and this is why you are most likely having trouble.
Everything I wrote above works on a fresh install, nothing has been overwritten at all, swftools functions haven't been touched. Try removing your overrides above and see if it'll work for you. (I edited my comment above with code samples, hopefully they help)
Also, instead of overriding the upload_attachments function, there's an admin UI option to turn off listing files by default at /admin/settings/uploads so you don't have to repeatedly uncheck uploads.
i need the
i need the checked/non-checked 'List' options functionality.
I try your changes with a fresh install now.
thanx!
You can still list attached
You can still list attached files.
Using the admin option only makes it so that if more files you upload shouldn't be listed, it saves you time having to uncheck them. You can still check the box to have a file listed if needed.
Doing what you've done with the blocks though, I'm assuming you have your files unchecked, or you've got duplicate players and lists.
by overwriting
by overwriting
in template.php there is no listing of files in nodes any more.
anyway, as soon as i implement your changes, no files or players are listed in my sidebar blocks.
i don't understand that. perhaps i changed some code anywhere else, too...
Looks like you're using the
Looks like you're using the garland_upload_attachments_without_mp3 in the garland_upload_attachments function, maybe this typo is causing your issues
nope. i don't. why do you
nope. i don't. why do you thin that?
a couple posts above, you
a couple posts above, you said:
That's the start of your without_mp3s function, isn't it?
no its the
no its the upload_attachments()-function from the upload.module which i overwrite in the template.php
I don't see why you're
I don't see why you're overriding the upload_attachments function at all. Do the files show if you remove it from template.php?
From above, the second block calls a totally custom function you wrote (upload_attachments_without_mp3), so I don't know why you need to override a Drupal function...
the scary thing is that i
the scary thing is that i can't reverse the thing. i don't get back to the old view - i uninstallen the upload_helper, i got back the upload.js and the old upload.module and i droped the weight-field in the files-table.
still there is now block back!
aiaiai.....
thank you for trying to help
thank you for trying to help me and for sharing your modification of the upload.module.
i got my old working backuped installation reinstalled now.
i really like to use this wonderfull feature, but i think i have to try another way to sort my files.
:-(
my next try for finding some help ist this one: http://drupal.org/node/208123
You're welcome. I really
You're welcome. I really don't see why it's not working for you unless you've modified other functions, etc.
Did you try doing it on a completely fresh install with only swftools and the new upload.module just to view its proof of concept?
no, because my time is
no, because my time is running out.
but i am interested in trying this a few days later.
not only time, but also
not only time, but also space is running out here i guess... :-)
WARNING USING THIS MOD WITH CCK!
This mod implies a change to core functions that need a further column called "weight" to file fields. If you use cck filefield module, this mod will alter ALL the queries used by filefield, requiring a new field_FIELDNAME_weight column in the table structure. If not present, you're likely to lose all the files attached to your nodes. However, the mod works and it's a great enhancement to content administration.