function _getESOptions($fields) { $db = JFactory::getDBO(); $socialadshelper = new socialadshelper(); $eschk = $socialadshelper->eschk(); if (!empty($eschk)) { for ($i = 0; $i < count($fields); $i++) { if ($fields[$i]->mapping_fieldtype != 'textbox') { $field_option = array(); require_once JPATH_ADMINISTRATOR . '/components/com_easysocial/includes/foundry.php'; $field = Foundry::table('Field'); $field->load($fields[$i]->mapping_fieldid); $filed_array = new stdclass(); $filed_array->id = $fields[$i]->mapping_fieldid; $options_value = Foundry::fields()->getOptions($field); /* if(empty($options_value)) { $model = Foundry::model( 'Fields' ); $options_value = $model->getOptions($fields[$i]->mapping_fieldid); $options_value=$options_value['items']; } */ $options = implode("\n", $options_value); $filed_array->options = $options; $field_option[] = $filed_array; $mapping_options[] = $field_option; } } } if (!empty($mapping_options)) { return $mapping_options; } }
function _getESFields() { //TODO: Use ignore field list from defines $socialadshelper = new socialadshelper(); $eschk = $socialadshelper->eschk(); if (!empty($eschk)) { //relationship not working $query = "SELECT element FROM #__social_apps WHERE element IN ('boolean','checkbox','birthday','calendar','birthday','country','datetime','dropdown','email','gender','multilist','textarea','textbox','multidropdown','url')"; $this->_db->setQuery($query); $socialtypes = $this->_db->loadColumn(); $socialtypes = implode("','", $socialtypes); $qry = "SELECT m.*, f.title AS field_label, f.unique_key as mapping_fieldname,a.element AS type, f.id AS id\n\t\t\t\t\t\tFROM #__social_fields AS f\n\t\t\t\t\t\tLEFT JOIN #__ad_fields_mapping AS m ON f.id = m.mapping_fieldid\n\t\t\t\t\t\tLEFT JOIN #__social_apps AS a ON a.id=f.app_id\n\t\t\t\t\t\tWHERE f.state = 1\n\t\t\t\t\t\tAND a.type = 'fields'\n\t\t\t\t\t\tAND a.element IN ('" . $socialtypes . "')\n\t\t\t\t\t\tORDER BY f.id\n\t\t\t\t\t\t"; $this->_db->setQuery($qry); $steps = $this->_db->loadobjectList(); } //empty check //print_r($steps); die('asdasd'); return $steps; }
function getUserData($int_typ, $adRetriever) { $socialadshelper = new socialadshelper(); if ($int_typ == 0) { $cbchk = $socialadshelper->cbchk(); if (!empty($cbchk)) { $ud = $adRetriever->getCBData(); return $ud; } //chk empty } elseif ($int_typ == 1) { $jschk = $socialadshelper->jschk(); if (!empty($jschk)) { $ud = $adRetriever->getJSData(); return $ud; } //chk empty } elseif ($int_typ == 3) { $eschk = $socialadshelper->eschk(); if (!empty($eschk)) { $ud = $adRetriever->getESData(); return $ud; } //chk empty } elseif ($int_typ == 2) { // check if intregration is set to None... return; } }