I have very attachment intensive forums (images, video) - is there some way to "import" these into the Gallery? Perhaps by attachment id or something similar?
When I first started out, there weren't really any viable forum/gallery integrated solutions, which is why I've ended up with things the way they are.
Ideally I'd like to convert my forums to be just for message threads (and in turn disable attachments) and then use the Gallery what it's designed for - image and video presentation, with the added bonus of vB integration for comments on each type.
If there isn't any current solution for this - is it something that might be considered for a future release?
I created this script for someone else, so you can try it and see if it works for you. First you need to create some categories in the gallery with the exact same name as the forums you want to import your attachments from. Then upload this script to your gallery directory, run it, and it should import your attachments from those forums.
Excellent, thanks Brian. I will give it a try shortly. Quick question....will it bring in only those attachment types defined in vBadvanced Gallery? For example, if I have a .txt, .doc, .pdf etc attachment in a vB forum, will it ignore them, if not defined in Gallery? If not, what happens with them?
Thanks again, will let you know how it works for me.
It should import any attachment in that forum no matter what the extension is. If you need to get rid of some afterwards though then you should be able to run a query like this:
DELETE FROM adv_gallery_images WHERE extension = 'txt';
Then after you remove any extensions you don't want in there, run the 'Scan Database' option in the maintenance section, as well as the 'Update Counters' option and that should take care of everything.
Excellent, thanks. Couple more questions.......does the script move or copy the attachments? In other words, do they stay in the source directory or are they moved or copied to the "gallery/files" directory? I wouldn't want duplicate files on disk, as in my case, available disk space might become an issue. I have over a gig of attachments .......and what state are the original messages left in? Is the message text left in place and the attachment removed from the thread or does the script convert the message text into a comment with the original posting's member details included in the newly created gallery posting? Also, is there any fall out with the member post counters? Or will the 'Update Counters' option take care of that? Finally, how long approximately will this whole process take? If it's a "move" I would think it would be quite quick, no matter how large my attachment totals are, right?
By the way, I store my attachments in the file system.....shouldn't be a problem, right?
Ok, no more questions, I'll try it out shortly, that will no doubt answer anything else. Thanks again.
It copies the files over to the gallery. If it just moved them then that would probably create a headache with the files that you don't want moved and such. I'm pretty sure vB has some options where you would easily be able to remove the attachments afterwards as well.
It shouldn't affect your posts/threads in any way.
The script has some redirects in place, so even if it does take it a little while to move all of the files you still should be able to just leave the window open while the script is doing it's thing.
Warning: copy(/path/to/your/attachment/directory//4/5/1/6/3036.attach): failed to open stream: No such file or directory in /home/site/public_html/forums/gallery/import_attachments.php on line 81
Open your includes/config.php file and add $debug = 1; somewhere in that file. Then go to your Admin CP => vBulletin Options => Version Info and Other Untouchables => File Attachment Path. Make sure that option is set to the full path to your attachments folder. Then remove that line that you added to your config.php file as leaving it there could be a security risk.