Importing Images into Dolphin

I'm trying to import images from a remote destination and automatically add them to an item of content i.e article, custom module, profile, etc

 

So far I am:

Importing image.

Inserting into bx_photos_main

Saving image at /modules/boonex/photos/data/files/__ID__.jpg

Resizing the image in various sizes and saving as:

/modules/boonex/photos/data/files/__ID___ri.jpg

/modules/boonex/photos/data/files/__ID___rt.jpg

/modules/boonex/photos/data/files/__ID___t.jpg

/modules/boonex/photos/data/files/__ID___m.jpg

 

Updating the item of contents "thumb" field as the image ID

 

However, all that happens is the content thumbnail appears. It registers there's the correct number of images when you view the content. i.e theres the correct number of mini thumbnail icons to click on... but they are blank.

 

Image is definitely uploaded.

 

Any ideas? Have I missed somewhere I have to insert into the database?

Quote · 13 Sep 2012

I'm not sure why you're trying to manually duplicate how the system handles images with its php uploader. The way Dolphin is set up you have to go into your photo module, create an album and use the uploader there, or use the "add image" button for the various modules that have such capabilities. When you upload the image, it replicates the image in the various sizes automatically to call those versions when it needs them. I'm not sure that manually recreating that process can work the way you want since the system won't be able to track where the images are directly and I don't understand at all how it would "automatically add them to an item of content i.e article, custom module, profile, etc".

 

I would recommend using the system's image uploaders or creating a folder in your hosting file system named "images" and using ftp or cpanel to upload images directly and using the url from that to post images in articles.

Quote · 13 Sep 2012

Thanks for the reply, but neither suggestions can help.

 

The script I'm running is going to be setup on a cron job, so doesn't touch the dolphin system... just imports the images directly into the database. It doesn't operate from the front end and isn't logged into any account.

 

So far I've got it working only for the thumbnail, however it seems the other larger images aren't being associated with the content... hence I'm thinking the issue is one of two things:

  • Something to do with the image Hash (unsure if there's a criteria for generating the Hash... i've just gone with a random unique MD5)
  • I've missed inserting an entry into a link table or something
Quote · 13 Sep 2012

Worked it out.

If anyone is trying to do the same thing, you have to add the image to a photo album for it to be picked up by the BxPhotosSearch->_getImageDbInfo() function!

Quote · 20 Sep 2012

I am haveing same problem.
Actually I don't know what should I do with "BxPhotosSearch->_getImageDbInfo() function!"
will kindly ask you to how do you run this script.

Thanks,

Quote · 6 Jun 2013

Problem is solved.

Quote · 6 Jun 2013

I would actually like to have details on this as well. This would be my last step in transferring over about 20,000 profiles from another script. Images is the hardest part. When you say add to an album ? It would be great to have a module or app to automatically fill in other tables, and create the proper hash tags for each image. As you, I just used a unique name for the hash. when I try to run a sql for hash. Any help would be greatly appreciated. I have photos uploaded with proper extensions and names. bx_photos_main table populated, image files have been renamed to reflect the bx_photos_main ID instead of their original names. Sys_albums table has been populated correctly, sys_albums_objects has also been populated to reflect images. Privacy settings are '3' for each user. Having some thumbs show up, but majority of images are not. I suspect the Hash tag. Any help ? Thanks guys. I thought I was done with this, but this would be the final peice to puzzle.

Quote · 30 Apr 2017

Dolphin creates a hash for the images file name; this is to help prevent accessing the images directly; I think this was set in place back when Dolphin was more dating software oriented.  Look into the code to see how this hash is generated.  If you go to a photo and click on the Original button you will see the image displayed and in the URL you will see the photo's hash.

I am not sure this is your problem but that hash is part of how photos are handled in Dolphin.

The other thing is that you need to have the public privacy group set in your admin settings if photos are set to public (3).  If you don't, then only the member and admin will be able to view the photos, any other member won't see the images.

Geeks, making the world a better place
Quote · 30 Apr 2017

Hi Geek Girl, 

Not sure either if Hash is an issue either. I saw a posting by  Deano that it just needs to be unique. Have the public privacy set to 3, so this is not an issue. Thanks. 

Quote · 30 Apr 2017
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.