![]() |
Bulk photo/gallery import script
Hey guys, I am trying to import thousands of existing photos into VB5. The images exist in folders/subfolders on the server. Anyone have a basic script to programmatically create a new gallery folder for a user and import a photo into it? I can probably figure it out from there if I had a sample to look at. Thanks in advance!
--------------- Added [DATE]1492107744[/DATE] at [TIME]1492107744[/TIME] --------------- A little more info as I keep trying to figure this out on my own - when I do this: Code:
$response = $api->callApi('content_gallery', 'add', array('data' => $data, 'options' => $options)); |
How are you executing the api? You should be logged in to create gallery post unless you enable permissions for guests which I assume you don't want.
|
Thanks! That helped me get past that issue. Now, I am getting this response when trying to add the image:
Code:
Array Code:
// This line does add the node for the album --------------- Added [DATE]1492129123[/DATE] at [TIME]1492129123[/TIME] --------------- Ok, I got past that problem. I needed to just pass 'file' => $fileInfo and do away with the $photos bit I was trying. At any rate, it does "upload" the image, but now I need to somehow get it to show up in the gallery. I'm thinking I need to do something like this: Code:
$response = $api->callApi('content_photo', 'add', ..... ); --------------- Added [DATE]1492129263[/DATE] at [TIME]1492129263[/TIME] --------------- Tried this, but to no avail: Code:
$response = $api->callApi('content_photo', 'add', array($albumId, array('filedataid' => $response['filedataid']))); Code:
Array Also, I noticed that in the vb_filedata table, that it had resized my test image (scaled it down). Is there some way to prevent that? These need to stay in their native 1920x1080 resolution. Thanks! |
Quote:
|
Any ideas on the actual call to "$api->callApi('content_photo' ...."? Is that the right call to use? If so, not sure what the arguments need to be.
I've also tried this, but to no avail: Code:
// Upload the file and add it |
Anyone?
|
Take a look at the actionGallery() function in /includes/vb5/frontend/controller/createcontent.php. That's the function called when you submit a gallery content type post.
|
Thanks, mate! I'll take a peek.
|
All times are GMT. The time now is 05:43 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|