Beispiel #1
0
 /**
  * Transfer Blogger configurations to the metaweblog api
  *
  * @return void
  */
 function _transfer_blogger()
 {
     if (!$this->EE->db->table_exists('metaweblog_api')) {
         require EE_APPPATH . 'modules/metaweblog_api/upd.metaweblog_api.php';
         $UPD = new Metaweblog_api_upd();
         $UPD->install();
     }
     $qry = $this->EE->db->get('blogger');
     foreach ($qry->result() as $row) {
         list($channel_id, $custom_field_id) = explode(':', $row->blogger_field_id);
         $qry = $this->EE->db->select('field_group')->where('channel_id', $channel_id)->get('channels');
         if (!$qry->num_rows()) {
             // nothing we can do here, that config shouldn't work
             continue;
         }
         $fg_id = $qry->row('field_group');
         $data = array('field_group_id' => $fg_id, 'content_field_id' => $custom_field_id, 'metaweblog_pref_name' => $row->blogger_pref_name . '_blogger', 'metaweblog_parse_type' => $row->blogger_parse_type);
         $this->EE->db->insert('metaweblog_api', $data);
     }
 }
Beispiel #2
0
 /**
  * Transfer Blogger configurations to the metaweblog api
  *
  * @return void
  */
 function _transfer_blogger()
 {
     if (!ee()->db->table_exists('metaweblog_api')) {
         // Note that in ud_270 we add a csrf_exempt column to the actions table
         // The Metaweblog installer requires that field
         // Add the csrf_exempt field
         ee()->smartforge->add_column('actions', array('csrf_exempt' => array('type' => 'tinyint', 'constraint' => 1, 'unsigned' => TRUE, 'default' => 0, 'null' => FALSE)));
         require EE_APPPATH . 'modules/metaweblog_api/upd.metaweblog_api.php';
         $UPD = new Metaweblog_api_upd();
         $UPD->install();
     }
     $qry = ee()->db->get('blogger');
     foreach ($qry->result() as $row) {
         list($channel_id, $custom_field_id) = explode(':', $row->blogger_field_id);
         $qry = ee()->db->select('field_group')->where('channel_id', $channel_id)->get('channels');
         if (!$qry->num_rows()) {
             // nothing we can do here, that config shouldn't work
             continue;
         }
         $fg_id = $qry->row('field_group');
         $data = array('field_group_id' => $fg_id, 'content_field_id' => $custom_field_id, 'metaweblog_pref_name' => $row->blogger_pref_name . '_blogger', 'metaweblog_parse_type' => $row->blogger_parse_type);
         ee()->db->insert('metaweblog_api', $data);
     }
 }