PhotoPost Photo Gallery Sales PhotoPost Sales Toll Free Phone Number
Mon-Fri 9am-4pm EST
  PhotoPost Photo Sharing Photo Gallery    Visualize community tm
| | | | | | | | |
Old May 22nd, 2005, 03:32 AM   #1 (permalink)
Member
Verified Customer
 
Join Date: Oct 2004
Posts: 62
Question Attachments to Gallery?

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?

Thanks.
funkmeister is offline   Reply With Quote
Old May 22nd, 2005, 11:22 AM   #2 (permalink)
Brian
Guest
 
Posts: n/a
Re: Attachments to Gallery?

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.
Attached Files
File Type: php import_attachments.php (2.9 KB, 20 views)
  Reply With Quote
Old May 22nd, 2005, 02:03 PM   #3 (permalink)
Member
Verified Customer
 
Join Date: Oct 2004
Posts: 62
Re: Attachments to Gallery?

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.
funkmeister is offline   Reply With Quote
Old May 22nd, 2005, 02:08 PM   #4 (permalink)
Brian
Guest
 
Posts: n/a
Re: Attachments to Gallery?

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.
  Reply With Quote
Old May 22nd, 2005, 02:39 PM   #5 (permalink)
Member
Verified Customer
 
Join Date: Oct 2004
Posts: 62
Re: Attachments to Gallery?

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.
funkmeister is offline   Reply With Quote
Old May 22nd, 2005, 03:09 PM   #6 (permalink)
Brian
Guest
 
Posts: n/a
Re: Attachments to Gallery?

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.
  Reply With Quote
Old May 23rd, 2005, 01:45 AM   #7 (permalink)
Member
Verified Customer
 
Join Date: Oct 2004
Posts: 62
Re: Attachments to Gallery?

I ran the script as per the instructions, but it appears to be transposing the directory names. For example, here's the physical path to one of the attachments in vB:

/forum/attachments/2/4/2/1381.attach

The script is failing with the following error:

Warning: copy(/forum/attachments/242/1381.attach): failed to open stream: No such file or directory in /gallery/import_attachments.php on line 81

It appears to be trying to copy the directory contents of 242 instead of 2/4/2.

Is their something in the script I can edit to correct this?

Thanks.
funkmeister is offline   Reply With Quote
Old May 23rd, 2005, 09:16 AM   #8 (permalink)
Brian
Guest
 
Posts: n/a
Re: Attachments to Gallery?

Find this bit of code:
Code:
Content visible to verified customers only.
Replace with:
Code:
Content visible to verified customers only.
And see if that helps.
  Reply With Quote
Old May 23rd, 2005, 02:08 PM   #9 (permalink)
Member
Verified Customer
 
Join Date: Oct 2004
Posts: 62
Re: Attachments to Gallery?

Thanks, that fixed it. I also had to Rebuild Image Sizes and Info, as they weren't showing up initially after running the script.
funkmeister is offline   Reply With Quote
Old June 12th, 2005, 09:07 PM   #10 (permalink)
Member
 
Join Date: Aug 2003
Posts: 98
Re: Attachments to Gallery?

Would this import the text and title and the name of user for the post the attachment was in? Thanks!
PhoenixDown21 is offline   Reply With Quote
Old June 13th, 2005, 08:59 AM   #11 (permalink)
Brian
Guest
 
Posts: n/a
Re: Attachments to Gallery?

It imports the user info, but nothing from the thread.
  Reply With Quote
Old June 14th, 2005, 07:45 PM   #12 (permalink)
Member
 
Join Date: Feb 2005
Posts: 111
Re: Attachments to Gallery?

is there a way to integrate the forums upload tool with the gallery as well, only for images?
Da GoTTi is offline   Reply With Quote
Old June 14th, 2005, 08:39 PM   #13 (permalink)
Member
 
Join Date: Feb 2005
Posts: 111
Re: Attachments to Gallery?

getting this error:

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
Imported banana.jpg
Da GoTTi is offline   Reply With Quote
Old June 15th, 2005, 08:06 AM   #14 (permalink)
Brian
Guest
 
Posts: n/a
Re: Attachments to Gallery?

/path/to/your/attachment/directory

Somehow I don't think that's a valid directory on your server...
  Reply With Quote
Old June 15th, 2005, 10:20 AM   #15 (permalink)
Member
 
Join Date: Feb 2005
Posts: 111
Re: Attachments to Gallery?

lol yyea....i seen this....

so what is this line mean then, im lost on it?
Da GoTTi is offline   Reply With Quote
Old June 16th, 2005, 08:37 AM   #16 (permalink)
Brian
Guest
 
Posts: n/a
Re: Attachments to Gallery?

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.
  Reply With Quote
Old June 16th, 2005, 11:43 AM   #17 (permalink)
Borgs8472
Guest
 
Posts: n/a
Re: Attachments to Gallery?

This idea seems promising. Before I break my board, are the attachments replaced with nice [ img ] images instead? Or are they removed?

Or is it purely to copy things over so you can prune old attachments without losing unique stuff?

And I too would like the VB attachments system replaced with automatic gallery uploading, it would be great if it were as quick
  Reply With Quote
Old June 17th, 2005, 08:31 AM   #18 (permalink)
Brian
Guest
 
Posts: n/a
Re: Attachments to Gallery?

It just copies your attachments over to the gallery. It does not touch the ones you have in your forum.
  Reply With Quote
Old June 17th, 2005, 09:43 AM   #19 (permalink)
Member
 
Join Date: Feb 2005
Posts: 111
Re: Attachments to Gallery?

wait...my attachments are stored on the DB, not as files on the server in a folder, is that the problem here?
Da GoTTi is offline   Reply With Quote
Old June 17th, 2005, 09:47 AM   #20 (permalink)
Brian
Guest
 
Posts: n/a
Re: Attachments to Gallery?

The script was created for the file system. Would it be a problem to move them?
  Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Import from Attachments Wayne Luke Before You Buy 1 August 23rd, 2005 09:51 AM
Still using attachments? Grae How Do I? - vBulletin 3.0.X 1 June 13th, 2005 10:39 PM
Attachments under Images: Request PixelFX vBGallery Suggestions 0 February 13th, 2005 09:40 AM


All times are GMT -5. The time now is 11:59 AM.

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0