1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Dismiss Notice
  3. What happens when the XF 2.0 is out? See the discussion here: http://www.sonnb.com/threads/what-happens-when-xf-2-0-is-out.1146/
    Dismiss Notice

Help Importer Help

Discussion in 'XenGallery' started by Craigr, Jun 16, 2018.

  1. Craigr

    Craigr Authorized Member Authorized

    Hi, i am trying to update from DBTech Gallery. In my old vBulletin database i have a couple of fields under dbtech_gallery_images that i would also like to import across. These are roll_id and award_id
    table.png
    Just wondering how i would edit the DBTechGalleryPro.php file to allow it to import these fields?

    I have something like this:
    Code:
                    $import = array(
                        'album_id' => $albumId,
                        'content_data_id' => $photoData['content_data_id'],
                        'title' => $parser->render($this->_convertToUtf8($attachment['title'], true)),
                        'description' => $parser->render($this->_convertToUtf8($attachment['text'], true)),
                        'user_id' => $userId,
                        'username' => $username,
                        'content_privacy' => array(
                            'allow_view' => 'everyone',
                            'allow_view_data' => array(),
                            'allow_comment' => 'everyone',
                            'allow_comment_data' => array()
                        ),
                        'roll_id' => $attachment['roll_id'],
                        'award_id' => $attachment['award_id'],
                        'view_count' => $attachment['views'],
                        'position' => $position,
                        'content_state' => 'visible',
                        'content_date' => $attachment['dateline'],
                        'content_updated_date' => $attachment['dateline']
    
    But i get error when it goes to import the photos. :(
    Mysqli statement execute error : Field 'roll_id' doesn't have a default value
     
  2. sonnb

    sonnb Administrator Staff Member

    Because the sonnb_XenGallery_DataWriter_Photo datawriter does not have these fields. You can add these fields into datawriter and then can import.

    But even you did that, how do you plan to use these fields? It is better to write a new method and import these fields as custom fields which can be displayed while viewing the photo. Please have a look at another class to see how to import custom fields.
     
    Craigr likes this.

Share This Page