Dear all,
in CF 7, I use the below script to populate a dropdown with specific entries from JEvents. This works smooth and fine for years now on this site: https://pdh.ch/index.php/de/agenda
Now I installed CF8 on a J5 site and tried to use the same logic. But the db entries are not showing up:
$current_day = JFactory::getDate('+0 seconds');
$current_day = $current_day->toUnix();$options = array();$db =& JFactory::getDBO();$query = "SELECT #__jevents_vevdetail.dtstart, #__jevents_vevdetail.summaryFROM #__jevents_vevdetailINNER JOIN #__jevents_vevent ON #__jevents_vevdetail.evdet_id = #__jevents_vevent.detail_idWHERE #__jevents_vevdetail.dtstart > " . $current_day ." AND #__jevents_vevent.access = 1 AND #__jevents_vevent.state >= 1order by #__jevents_vevdetail.dtstart;";$db->setQuery($query);return $db->loadAssocList();foreach ( $data as $d ) { $options[] = "<option value='{$d->summary}'>{$d->summary}</option>";}
Where do I have to adapt this part in order to fetch the data?Thanks so much for your help,
Martin
ISSUE SOLVED. I have to use the new Read Data function, which makes it way easier.
Great, thanks for sharing your solution! :)
You can use the Read Data with the "Where Statement" to choose which records to read, and feed that to the Dynamic Options of the Dropdown