function _prev_next_category_sql in Previous/Next API 7.2
Helper function to return a SQL clause for categories to be indexed
Parameters
string $node_type:
Return value
string
1 call to _prev_next_category_sql()
- _prev_next_add in ./
prev_next.module - Create or update the prev_next records.
File
- ./
prev_next.module, line 471 - The previous next module indexes the previous and next nodes based upon user-selectable criteria and stores this index in the database for faster retrieval later.
Code
function _prev_next_category_sql($node_type = '') {
$cond = '';
$same_type = variable_get(PREV_NEXT_NODE_TYPE . $node_type . '_same_type', 0);
$category = variable_get(PREV_NEXT_NODE_TYPE . $node_type . '_category_criteria', 'none');
if (!$same_type || $category == 'none') {
return $cond;
}
$cond = " INNER JOIN {field_data_{$category}} ON nid = entity_id ";
return $cond;
}