Created
April 29, 2011 05:05
-
-
Save nigelheap/947870 to your computer and use it in GitHub Desktop.
program_tabs.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* page callback for program tabs | |
*/ | |
function syn_custom_program_tab($node, $term_name) { | |
//$term = taxonomy_get_term_by_name($term_name); | |
$terms = array(); | |
$term = array(); | |
$parent = taxonomy_get_term_by_name($node->title); | |
$parent = end($parent); | |
$db_result = db_query("SELECT * FROM {term_data} td | |
JOIN {term_hierarchy} th ON th.tid = td.tid | |
WHERE th.parent = %d AND LOWER(td.name) = LOWER('%s')", $parent->tid, trim($term_name)); | |
while ($term = db_fetch_object($db_result)) { | |
$terms[] = $term; | |
} | |
$term = end($terms); | |
$output = '<div class="program-tabs">'. syn_custom_program_tabs($node) .'</div>'; | |
$output .= views_embed_view('og_ghp_syn', 'default', $node->nid, $term->tid); | |
return $output; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment