- Issue created by @mikeocana
- 🇵🇭Philippines mikeocana
/** * Implements hook_views_pre_render(). */ function MODULENAME_views_pre_render(&$view) { // Overwrite the 'Updated Date' column to display the recent date event click. if ($view->name == 'ad_ui_administration' && $view->current_display == 'page') { $results = &$view->result; foreach ($results as &$result) { $result->node_changed = _MODULENAME_get_ad_recent_click_event($result->nid, $result->node_created); } } } /** * Custom function to get the Ad recent click date event. */ function _MODULENAME_get_ad_recent_click_event($ad_nid, $ad_node_created) { $results = db_query("SELECT * FROM {eck_tracked_event} WHERE ad = :nid ORDER BY created DESC LIMIT 1", array( ':nid' => $ad_nid )); // Set default to node_created. $created = $ad_node_created; foreach ($results as $result) { $created = $result->created; } return $created; }