Dear all,
a long time ago, GreyHead helped me with setting up a working script in order to get data from JEvents DB entries. I used this script on several CFs and it works like a charm. But now, I need to add data from another table in the JEvents DB.
Currently, this script here fetches the data from #__jevents_vevdetail:
[pre]$current_day = JFactory::getDate('+0 seconds');
$current_day = $current_day->toUnix();[br]$options = array();[br]$db =& JFactory::getDBO();[br]$query = "[br]SELECT[br] #__jevents_vevdetail.dtstart, [br] #__jevents_vevdetail.summary[br]FROM #__jevents_vevdetail[br]INNER JOIN #__jevents_vevent ON #__jevents_vevdetail.evdet_id = #__jevents_vevent.detail_id[br]WHERE[br] #__jevents_vevdetail.dtstart > " . $current_day ." AND[br] #__jevents_vevent.access = 1 AND[br] #__jevents_vevent.state >= 1[br]order by #__jevents_vevdetail.dtstart;[br]";[br]$db->setQuery($query);[br]return $db->loadAssocList();[br]foreach ( $data as $d ) {[br] $options[] = "[option value="{$d-]summary}"]{$d->summary}[/option]";[br]}[br][br][br] #__jevents_repetition.startrepeat[br][br]#__jevents_repetition[/pre]
Now, I need to add data from this table: #__jevents_vevdetail.dtstart which contains the start date - but in UNIX format ...
How can I manage that in CF, when I define {var:dtstart} that this converts the UNIX timestamp into a readable date format (day.month year)?[br]
Martin
a long time ago, GreyHead helped me with setting up a working script in order to get data from JEvents DB entries. I used this script on several CFs and it works like a charm. But now, I need to add data from another table in the JEvents DB.
Currently, this script here fetches the data from #__jevents_vevdetail:
[pre]$current_day = JFactory::getDate('+0 seconds');
$current_day = $current_day->toUnix();[br]$options = array();[br]$db =& JFactory::getDBO();[br]$query = "[br]SELECT[br] #__jevents_vevdetail.dtstart, [br] #__jevents_vevdetail.summary[br]FROM #__jevents_vevdetail[br]INNER JOIN #__jevents_vevent ON #__jevents_vevdetail.evdet_id = #__jevents_vevent.detail_id[br]WHERE[br] #__jevents_vevdetail.dtstart > " . $current_day ." AND[br] #__jevents_vevent.access = 1 AND[br] #__jevents_vevent.state >= 1[br]order by #__jevents_vevdetail.dtstart;[br]";[br]$db->setQuery($query);[br]return $db->loadAssocList();[br]foreach ( $data as $d ) {[br] $options[] = "[option value="{$d-]summary}"]{$d->summary}[/option]";[br]}[br][br][br] #__jevents_repetition.startrepeat[br][br]#__jevents_repetition[/pre]
Now, I need to add data from this table: #__jevents_vevdetail.dtstart which contains the start date - but in UNIX format ...
How can I manage that in CF, when I define {var:dtstart} that this converts the UNIX timestamp into a readable date format (day.month year)?[br]
Martin
...it's as simple as that: {date:Y-m-d$(var:some_date_value_or_timestamp)}
Took me hours of research, just to get the solution ... on this very site 🙂
Took me hours of research, just to get the solution ... on this very site 🙂
You need to login to be able to post a reply.