Skip to content

Instantly share code, notes, and snippets.

<?php
/**
* Implementation of hook_views_query_alter().
*/
function modulename_views_query_alter(&$view, &$query) {
if ($view->name == 'viewname') {
$type_clause = FALSE;
// check to see if we already have a node.type clause
foreach ($query->where[0]['clauses'] as $clause) {
if (substr(0, 10, $clause) == 'node.type ') {
<?php if ($submitted): ?>
<span class="submitted"><?php echo format_date($node->created, 'custom', 'd M Y') ?></span>
<?php endif; ?>