本文整理汇总了PHP中taxonomy_node_get_terms_by_vocabulary函数的典型用法代码示例。如果您正苦于以下问题:PHP taxonomy_node_get_terms_by_vocabulary函数的具体用法?PHP taxonomy_node_get_terms_by_vocabulary怎么用?PHP taxonomy_node_get_terms_by_vocabulary使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了taxonomy_node_get_terms_by_vocabulary函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: showEntriesFromVocab
/**
* Fetch all terms from specified vocabulary
*
* @param Object $node
* @param Integer $vid
* @return Arrau
* @author Hasse R. Hansen
**/
function showEntriesFromVocab($node, $vid)
{
$entries = array();
$items = taxonomy_node_get_terms_by_vocabulary($node, $vid);
foreach ($items as $value) {
$entries[] = $value->name;
}
return $entries;
}
开发者ID:reload,项目名称:Netlydbog,代码行数:17,代码来源:template.php
示例2: light_print_terms
function light_print_terms($nid)
{
$vocabularies = taxonomy_get_vocabularies();
$output = '';
foreach ($vocabularies as $vocabulary) {
if ($vocabularies) {
$terms = taxonomy_node_get_terms_by_vocabulary($nid, $vocabulary->vid);
if ($terms) {
$links = array();
//$output .= '' . $vocabulary->name . ': ';
foreach ($terms as $term) {
$links[] = l($term->name, taxonomy_term_path($term), array('rel' => 'tag', 'title' => strip_tags($term->description)));
}
$output .= implode(', ', $links);
}
}
}
return $output;
}
开发者ID:e2thex,项目名称:thesummerfields.org,代码行数:19,代码来源:template.php
示例3: taxonomy_node_get_terms_by_vocabulary
* <?php if (isset($info_split['comment'])) : ?>
* <span class="info-comment">
* <?php print $info_split['comment']; ?>
* </span>
* <?php endif; ?>
*
* To check for all available data within $info_split, use the code below.
*
* <?php print '<pre>'. check_plain(print_r($info_split, 1)) .'</pre>'; ?>
*
* @see template_preprocess_search_result()
*/
$type = $full_node->type;
$term_list = '';
if ($type == "news") {
$terms = taxonomy_node_get_terms_by_vocabulary($full_node, 4);
foreach ($terms as $term) {
$term_list .= $term->name;
}
}
?>
<div class="news-article">
<div>
<hr>
</div>
<div>
<span class="date-display-single"><?php
print format_date(strtotime($full_node->field_date[0]['value']), 'custom', 'F j, Y');
?>
</span>
</div>
开发者ID:qltd,项目名称:kresge_d6,代码行数:31,代码来源:search-result-apachesolr_search-news.tpl.php
示例4: csa_base_preprocess_node
/**
* Implementation of template_preprocess_node().
*/
function csa_base_preprocess_node(&$variables)
{
// Add meaningfull classes to the node.
$node_classes = array();
$node_classes[] = 'node';
$node_classes[] = 'node-' . $variables['node']->type;
if (empty($variables['status'])) {
$node_classes[] = 'node-unpublished';
}
$variables['node_classes'] = implode(' ', $node_classes);
// Date & author.
$date = t('Posted ') . format_date($variables['node']->created, 'medium');
// Format date as small, medium, or large
$author = theme('username', $variables['node']);
$author_only_separator = t('Posted by ');
$author_date_separator = t(' by ');
$submitted_by_content_type = theme_get_setting('submitted_by_enable_content_type') == 1 ? $variables['node']->type : 'default';
$date_setting = theme_get_setting('submitted_by_date_' . $submitted_by_content_type) == 1;
$author_setting = theme_get_setting('submitted_by_author_' . $submitted_by_content_type) == 1;
$author_separator = $date_setting ? $author_date_separator : $author_only_separator;
$date_author = $date_setting ? $date : '';
$date_author .= $author_setting ? $author_separator . $author : '';
$variables['submitted'] = $date_author;
if (theme_get_setting('hide_front_page_title') && drupal_is_front_page()) {
$variables['submitted'] = NULL;
}
$taxonomy_content_type = theme_get_setting('taxonomy_enable_content_type') == 1 ? $variables['node']->type : 'default';
$taxonomy_display = theme_get_setting('taxonomy_display_' . $taxonomy_content_type);
$taxonomy_format = theme_get_setting('taxonomy_format_' . $taxonomy_content_type);
$taxonomy_format_links = theme_get_setting('taxonomy_format_links');
if (module_exists('taxonomy') && ($taxonomy_display == 'all' || $taxonomy_display == 'only' && $variables['page'])) {
$output = array();
$vocabularies = taxonomy_get_vocabularies($variables['node']->type);
foreach ($vocabularies as $vocabulary) {
if (theme_get_setting('taxonomy_vocab_display_' . $taxonomy_content_type . '_' . $vocabulary->vid)) {
$terms = taxonomy_node_get_terms_by_vocabulary($variables['node'], $vocabulary->vid);
if ($terms) {
$links = array();
foreach ($terms as $term) {
$links[] = array('data' => l($term->name, taxonomy_term_path($term), array('attributes' => array('rel' => 'tag', 'title' => strip_tags($term->description)))), 'class' => 'vocab-term');
}
if ($taxonomy_format == 'vocab') {
$data = theme_get_setting('taxonomy_display_vocab_name') ? '<span class="vocab-name">' . $vocabulary->name . ':</span> ' : '';
$class = array('vocab');
$children = array();
if ($taxonomy_format_links) {
$class[] = 'links';
$children = $links;
} else {
$term_list = array();
foreach ($links as $link) {
$term_list[] = $link['data'];
}
$data .= implode(theme_get_setting('taxonomy_format_delimiter'), $term_list);
}
$output[] = array('data' => $data, 'class' => implode(' ', $class), 'id' => 'vocab-' . $vocabulary->vid, 'children' => $children);
} else {
$output = array_merge($links, $output);
}
}
}
}
$variables['terms'] = theme('item_list', $output, null, 'ul', array('class' => 'taxonomy'));
} else {
$variables['terms'] = '';
}
}
开发者ID:rasjones,项目名称:csa,代码行数:70,代码来源:template.php
示例5: hook_cart_item
/**
* Add extra data about an item in the cart.
*
* Products that are added to a customer's cart are referred as items until the
* sale is completed. Just think of a grocery store having a bunch of products
* on the shelves but putting a sign over the express lane saying "15 Items or
* Less." hook_cart_item() is in charge of acting on items at various times like
* when they are being added to a cart, saved, loaded, and checked out.
*
* Here's the rationale for this hook: Products may change on a live site during
* a price increase or change to attribute adjustments. If a user has previously
* added an item to their cart, when they go to checkout or view their cart
* screen we want the latest pricing and model numbers to show. So, the essential
* product information is stored in the cart, but when the items in a cart are
* loaded, modules are given a chance to adjust the data against the latest settings.
*
* @param $op
* The action that is occurring. Possible values:
* - "load" - Passed for each item when a cart is being loaded in the function
* uc_cart_get_contents(). This gives modules the chance to tweak information
* for items when the cart is being loaded prior to being view or added to
* an order. No return value is expected.
* - "can_ship" - Passed when a cart is being scanned for items that are not
* shippable items. Übercart will bypass cart and checkout operations
* specifically related to tangible products if nothing in the cart is
* shippable. hook_cart_item functions that check for this op are expected
* to return TRUE or FALSE based on whether a product is shippable or not.
* @return
* No return value for load.
* TRUE or FALSE for can_ship.
*/
function hook_cart_item($op, &$item)
{
switch ($op) {
case 'load':
$term = array_shift(taxonomy_node_get_terms_by_vocabulary($item->nid, variable_get('uc_manufacturer_vid', 0)));
$arg1->manufacturer = $term->name;
break;
}
}
开发者ID:patdunlavey,项目名称:Williamstown-Beat,代码行数:40,代码来源:hooks.php
示例6: return_terms_from_vocabulary
function return_terms_from_vocabulary($node, $vid)
{
$terms = taxonomy_node_get_terms_by_vocabulary($node, $vid, $key = 'tid');
// $vocabolary = taxonomy_get_vocabulary($vid);
$vocabolary = taxonomy_vocabulary_load($vid);
// $content ='<div class="vocabolary_terms">';
// $content .='<div class="vocabolary">'.$vocabolary->name.'</div>';
$termslist = '';
if ($terms) {
$content .= '<div class="terms">';
foreach ($terms as $term) {
$termslist = $termslist . l($term->name, 'taxonomy/term/' . $term->tid) . ' | ';
// $termslist = $termslist .$term->name .' | ';
}
$content .= trim($termslist, " |") . '</div>';
}
// $content.='</div>';
return $content;
}
开发者ID:beltofte,项目名称:ding,代码行数:19,代码来源:template.php
示例7: acquia_marina_preprocess_node
function acquia_marina_preprocess_node(&$vars)
{
// Build array of handy node classes
$node_classes = array();
$node_classes[] = $vars['zebra'];
// Node is odd or even
$node_classes[] = !$vars['node']->status ? 'node-unpublished' : '';
// Node is unpublished
$node_classes[] = $vars['sticky'] ? 'sticky' : '';
// Node is sticky
$node_classes[] = isset($vars['node']->teaser) ? 'teaser' : 'full-node';
// Node is teaser or full-node
$node_classes[] = 'node-type-' . $vars['node']->type;
// Node is type-x, e.g., node-type-page
$node_classes = array_filter($node_classes);
// Remove empty elements
$vars['node_classes'] = implode(' ', $node_classes);
// Implode class list with spaces
// Add node_bottom region content
$vars['node_bottom'] = theme('blocks', 'node_bottom');
// Node Theme Settings
// Date & author
if (!module_exists('submitted_by')) {
$date = t('Posted ') . format_date($vars['node']->created, 'medium');
// Format date as small, medium, or large
$author = theme('username', $vars['node']);
$author_only_separator = t('Posted by ');
$author_date_separator = t(' by ');
$submitted_by_content_type = theme_get_setting('submitted_by_enable_content_type') == 1 ? $vars['node']->type : 'default';
$date_setting = theme_get_setting('submitted_by_date_' . $submitted_by_content_type) == 1;
$author_setting = theme_get_setting('submitted_by_author_' . $submitted_by_content_type) == 1;
$author_separator = $date_setting ? $author_date_separator : $author_only_separator;
$date_author = $date_setting ? $date : '';
$date_author .= $author_setting ? $author_separator . $author : '';
$vars['submitted'] = $date_author;
}
// Taxonomy
$taxonomy_content_type = theme_get_setting('taxonomy_enable_content_type') == 1 ? $vars['node']->type : 'default';
$taxonomy_display = theme_get_setting('taxonomy_display_' . $taxonomy_content_type);
$taxonomy_format = theme_get_setting('taxonomy_format_' . $taxonomy_content_type);
if (module_exists('taxonomy') && ($taxonomy_display == 'all' || $taxonomy_display == 'only' && $vars['page'])) {
$vocabularies = taxonomy_get_vocabularies($vars['node']->type);
$output = '';
$term_delimiter = ', ';
foreach ($vocabularies as $vocabulary) {
if (theme_get_setting('taxonomy_vocab_hide_' . $taxonomy_content_type . '_' . $vocabulary->vid) != 1) {
$terms = taxonomy_node_get_terms_by_vocabulary($vars['node'], $vocabulary->vid);
if ($terms) {
$term_items = '';
foreach ($terms as $term) {
// Build vocabulary term items
$term_link = l($term->name, taxonomy_term_path($term), array('attributes' => array('rel' => 'tag', 'title' => strip_tags($term->description))));
$term_items .= '<li class="vocab-term">' . $term_link . $term_delimiter . '</li>';
}
if ($taxonomy_format == 'vocab') {
// Add vocabulary labels if separate
$output .= '<li class="vocab vocab-' . $vocabulary->vid . '"><span class="vocab-name">' . $vocabulary->name . ':</span> <ul class="vocab-list">';
$output .= substr_replace($term_items, '</li>', -(strlen($term_delimiter) + 5)) . '</ul></li>';
} else {
$output .= $term_items;
}
}
}
}
if ($output != '') {
$output = $taxonomy_format == 'list' ? substr_replace($output, '</li>', -(strlen($term_delimiter) + 5)) : $output;
$output = '<ul class="taxonomy">' . $output . '</ul>';
}
$vars['terms'] = $output;
} else {
$vars['terms'] = '';
}
// Node Links
if (isset($vars['node']->links['node_read_more'])) {
$node_content_type = theme_get_setting('readmore_enable_content_type') == 1 ? $vars['node']->type : 'default';
$vars['node']->links['node_read_more'] = array('title' => acquia_marina_themesettings_link(theme_get_setting('readmore_prefix_' . $node_content_type), theme_get_setting('readmore_suffix_' . $node_content_type), t(theme_get_setting('readmore_' . $node_content_type)), 'node/' . $vars['node']->nid, array('attributes' => array('title' => t(theme_get_setting('readmore_title_' . $node_content_type))), 'query' => NULL, 'fragment' => NULL, 'absolute' => FALSE, 'html' => TRUE)), 'attributes' => array('class' => 'readmore-item'), 'html' => TRUE);
}
if (isset($vars['node']->links['comment_add'])) {
$node_content_type = theme_get_setting('comment_enable_content_type') == 1 ? $vars['node']->type : 'default';
if ($vars['teaser']) {
$vars['node']->links['comment_add'] = array('title' => acquia_marina_themesettings_link(theme_get_setting('comment_add_prefix_' . $node_content_type), theme_get_setting('comment_add_suffix_' . $node_content_type), t(theme_get_setting('comment_add_' . $node_content_type)), "comment/reply/" . $vars['node']->nid, array('attributes' => array('title' => t(theme_get_setting('comment_add_title_' . $node_content_type))), 'query' => NULL, 'fragment' => 'comment-form', 'absolute' => FALSE, 'html' => TRUE)), 'attributes' => array('class' => 'comment-add-item'), 'html' => TRUE);
} else {
$vars['node']->links['comment_add'] = array('title' => acquia_marina_themesettings_link(theme_get_setting('comment_node_prefix_' . $node_content_type), theme_get_setting('comment_node_suffix_' . $node_content_type), t(theme_get_setting('comment_node_' . $node_content_type)), "comment/reply/" . $vars['node']->nid, array('attributes' => array('title' => t(theme_get_setting('comment_node_title_' . $node_content_type))), 'query' => NULL, 'fragment' => 'comment-form', 'absolute' => FALSE, 'html' => TRUE)), 'attributes' => array('class' => 'comment-node-item'), 'html' => TRUE);
}
}
if (isset($vars['node']->links['comment_new_comments'])) {
$node_content_type = theme_get_setting('comment_enable_content_type') == 1 ? $vars['node']->type : 'default';
$vars['node']->links['comment_new_comments'] = array('title' => acquia_marina_themesettings_link(theme_get_setting('comment_new_prefix_' . $node_content_type), theme_get_setting('comment_new_suffix_' . $node_content_type), format_plural(comment_num_new($vars['node']->nid), t(theme_get_setting('comment_new_singular_' . $node_content_type)), t(theme_get_setting('comment_new_plural_' . $node_content_type))), "node/" . $vars['node']->nid, array('attributes' => array('title' => t(theme_get_setting('comment_new_title_' . $node_content_type))), 'query' => NULL, 'fragment' => 'new', 'absolute' => FALSE, 'html' => TRUE)), 'attributes' => array('class' => 'comment-new-item'), 'html' => TRUE);
}
if (isset($vars['node']->links['comment_comments'])) {
$node_content_type = theme_get_setting('comment_enable_content_type') == 1 ? $vars['node']->type : 'default';
$vars['node']->links['comment_comments'] = array('title' => acquia_marina_themesettings_link(theme_get_setting('comment_prefix_' . $node_content_type), theme_get_setting('comment_suffix_' . $node_content_type), format_plural(comment_num_all($vars['node']->nid), t(theme_get_setting('comment_singular_' . $node_content_type)), t(theme_get_setting('comment_plural_' . $node_content_type))), "node/" . $vars['node']->nid, array('attributes' => array('title' => t(theme_get_setting('comment_title_' . $node_content_type))), 'query' => NULL, 'fragment' => 'comments', 'absolute' => FALSE, 'html' => TRUE)), 'attributes' => array('class' => 'comment-item'), 'html' => TRUE);
}
$vars['links'] = theme('links', $vars['node']->links, array('class' => 'links inline'));
}
开发者ID:rtanglao,项目名称:rtvps-d6,代码行数:95,代码来源:template.php
示例8: skodaxanthifc_print_only_terms_of
/**
* GT
* Returns the terms of a specific vocabulary.
* Paremeters: Node id, Vocabulary id
*
*/
function skodaxanthifc_print_only_terms_of($node, $vid)
{
$terms = taxonomy_node_get_terms_by_vocabulary($node, $vid);
if ($terms) {
$links = array();
$output .= '';
foreach ($terms as $term) {
//$links[] = l($term->name, taxonomy_term_path($term), array('rel' => 'tag', 'title' => strip_tags($term->description)));
$output .= $term->name;
}
//$output .= implode(', ', $links);
$output .= ' ';
}
$output .= '';
return $output;
}
开发者ID:maduhu,项目名称:opengovplatform-beta,代码行数:22,代码来源:template.php
示例9: zeropoint_preprocess_node
function zeropoint_preprocess_node(&$vars)
{
$vars['template_files'][] = 'node-' . $vars['nid'];
//print_r($vars);
if ($vars['user']->uid) {
$vars['content'] = preg_replace('~<foranonym>.*</foranonym>~s', '', $vars['content']);
}
$vars['content'] = preg_replace('~"http://baza-voprosov.ru/~', '"/', $vars['content']);
// Build array of handy node classes
$node_classes = array();
$node_classes[] = $vars['zebra'];
// Node is odd or even
$node_classes[] = !$vars['node']->status ? 'node-unpublished' : '';
// Node is unpublished
$node_classes[] = $vars['sticky'] ? 'sticky' : '';
// Node is sticky
$node_classes[] = isset($vars['node']->teaser) ? 'teaser' : 'full-node';
// Node is teaser or full-node
$node_classes[] = 'node-type-' . $vars['node']->type;
// Node is type-x, e.g., node-type-page
// Add any taxonomy terms for node teasers
if ($vars['teaser'] && isset($vars['taxonomy'])) {
foreach ($vars['taxonomy'] as $taxonomy_id_string => $term_info) {
$taxonomy_id = array_pop(explode('_', $taxonomy_id_string));
$node_classes[] = 'tag-' . $taxonomy_id;
// Node teaser has terms (tag-x)
// $taxonomy_name = id_safe($term_info['title']);
// if ($taxonomy_name) {
// $node_classes[] = 'tag-'. $taxonomy_name; // Node teaser has terms (tag-name)
// }
}
}
$node_classes = array_filter($node_classes);
// Remove empty elements
$vars['node_classes'] = implode(' ', $node_classes);
// Implode class list with spaces
// Add node regions
$vars['node_middle'] = theme('blocks', 'node_middle');
$vars['node_bottom'] = theme('blocks', 'node_bottom');
// Render Ubercart fields into separate variables for node-product.tpl.php
if (module_exists('uc_product') && uc_product_is_product($vars) && $vars['template_files'][0] == 'node-product') {
$node = node_build_content(node_load($vars['nid']));
$vars['uc_image'] = drupal_render($node->content['image']);
$vars['uc_body'] = drupal_render($node->content['body']);
$vars['uc_display_price'] = drupal_render($node->content['display_price']);
$vars['uc_add_to_cart'] = drupal_render($node->content['add_to_cart']);
$vars['uc_weight'] = drupal_render($node->content['weight']);
$vars['uc_dimensions'] = drupal_render($node->content['dimensions']);
$vars['uc_model'] = drupal_render($node->content['model']);
$vars['uc_list_price'] = drupal_render($node->content['list_price']);
$vars['uc_sell_price'] = drupal_render($node->content['sell_price']);
$vars['uc_cost'] = drupal_render($node->content['cost']);
$vars['uc_additional'] = drupal_render($node->content);
}
// Node Theme Settings
// Date & author
if (!module_exists('submitted_by')) {
$date = t('') . format_date($vars['node']->created, 'medium');
// Format date as small, medium, or large
$author = theme('username', $vars['node']);
$author_only_separator = t('');
$author_date_separator = t(' — ');
$submitted_by_content_type = theme_get_setting('submitted_by_enable_content_type') == 1 ? $vars['node']->type : 'default';
$date_setting = theme_get_setting('submitted_by_date_' . $submitted_by_content_type) == 1;
$author_setting = theme_get_setting('submitted_by_author_' . $submitted_by_content_type) == 1;
$author_separator = $date_setting ? $author_date_separator : $author_only_separator;
$date_author = $date_setting ? $date : '';
$date_author .= $author_setting ? $author_separator . $author : '';
$vars['submitted'] = $date_author;
}
// Taxonomy
$taxonomy_content_type = theme_get_setting('taxonomy_enable_content_type') == 1 ? $vars['node']->type : 'default';
$taxonomy_display = theme_get_setting('taxonomy_display_' . $taxonomy_content_type);
$taxonomy_format = theme_get_setting('taxonomy_format_' . $taxonomy_content_type);
if (module_exists('taxonomy') && ($taxonomy_display == 'all' || $taxonomy_display == 'only' && $vars['page'])) {
$vocabularies = taxonomy_get_vocabularies($vars['node']->type);
$output = '';
$term_delimiter = ' | ';
foreach ($vocabularies as $vocabulary) {
if (theme_get_setting('taxonomy_vocab_hide_' . $taxonomy_content_type . '_' . $vocabulary->vid) != 1) {
$terms = taxonomy_node_get_terms_by_vocabulary($vars['node'], $vocabulary->vid);
if ($terms) {
$term_items = '';
foreach ($terms as $term) {
// Build vocabulary term items
$term_link = l($term->name, taxonomy_term_path($term), array('attributes' => array('rel' => 'tag', 'title' => strip_tags($term->description))));
$term_items .= '<li class="vocab-term">' . $term_link . $term_delimiter . '</li>';
}
if ($taxonomy_format == 'vocab') {
// Add vocabulary labels if separate
$output .= '<li class="vocab vocab-' . $vocabulary->vid . '"><span class="vocab-name">' . check_plain($vocabulary->name) . ':</span> <ul class="vocab-list">';
//$output .= '<li class="vocab vocab-'. $vocabulary->vid .'"> <ul class="vocab-list">';
$output .= substr_replace($term_items, '</li>', -(strlen($term_delimiter) + 5)) . '</ul></li>';
} else {
$output .= $term_items;
}
}
}
}
if ($output != '') {
//.........这里部分代码省略.........
开发者ID:chgk,项目名称:db.chgk.info,代码行数:101,代码来源:template.php
示例10: boron_print_text
function boron_print_text($node, $vid = NULL)
{
$vocabularies = taxonomy_get_vocabularies();
foreach ($vocabularies as $vocabulary) {
if ($vocabularies) {
$terms = taxonomy_node_get_terms_by_vocabulary($node, $vocabulary->vid);
if ($terms) {
$links = array();
foreach ($terms as $term) {
$links[] = $term->name;
}
$output .= implode(', ', $links);
}
}
}
return $output;
}
开发者ID:qltd,项目名称:kresge_d6,代码行数:17,代码来源:template.php
示例11: taxonomy_node_get_terms_by_vocabulary
if ($help) {
print $help;
}
?>
<?php
print $content;
?>
<!--BW6 START ATTEMPT TO DO NEWS AND UDPATES A DIFFERENT WAY -->
<DIV Class="newslinks">
<?php
global $language;
$lc = $language->language;
$vid = 3;
$terms = taxonomy_node_get_terms_by_vocabulary($node, $vid);
if ($lc == "en") {
print "<div class='field-label'>News and Updates:</div>";
}
if ($lc == "es") {
print "<div class='field-label'>Notas de prensa y boletines mensuales:</div>";
}
if ($lc == "en") {
print "<A HREF='/byproject/{$node->nid}'>for {$title}</A><BR/>";
}
if ($lc == "es") {
print "<A HREF='/es/byproject/{$node->nid}'>por {$title}</A><BR/>";
}
foreach ($terms as $term) {
if ($lc == "en") {
print "<A HREF='/newsupdate/{$term->tid}'>for {$term->name}</A><BR/>";
开发者ID:ndp,项目名称:aida-americas.org-src,代码行数:31,代码来源:page-project.tpl.php
示例12: taxonomy_node_get_terms_by_vocabulary
$g_print .= '<span>' . $big . '</span>';
}
$gallery .= '</ul>';
if (arg(0) == 'print') {
$gallery = $g_print;
}
$atts = ' no-atts';
if (count($node->attributes) >= 1) {
$atts = '';
}
$spec = FALSE;
if ($node->field_authorartist[0]['value'] || $node->field_publisher[0]['value'] || $node->field_originalreleasedate[0]['value'] || $node->field_pages[0]['value'] || $node->field_genre[0]['value'] || $node->field_binding[0]['value'] || $node->field_media[0]['value'] || $node->field_numberofsongs[0]['value'] || $node->field_numberofcds[0]['value'] || $node->field_sound[0]['value'] || $node->field_runtime[0]['value'] || $node->field_systemreq[0]['value'] || $node->field_age[0]['value'] || $node->field_sizecm[0]['value'] || $node->field_language[0]['value'] || $node->field_silverweight_int[0]['value'] || $node->field_sizeinch[0]['value']) {
$spec = TRUE;
}
$labels = '';
$freeterms = taxonomy_node_get_terms_by_vocabulary($node, 2);
foreach ($freeterms as $fterm) {
if ($fterm->name != 'Upsell') {
$labels .= '<span id="fterm-' . $fterm->tid . '" class="free-term">' . $fterm->name . '</span>';
}
}
//dpm($node);
//dpm($node->field_prod_offline[0]['value']);
?>
<div id="node-<?php
print $node->nid;
?>
" class="node<?php
if ($sticky) {
print ' sticky';
}
开发者ID:edwardchan,项目名称:israel-catalog,代码行数:31,代码来源:node-general.tpl.php
示例13: cmssimplicity_preprocess_node
/**
* Override or insert variables into the node templates.
*
* @param $vars
* An array of variables to pass to the theme template.
*/
function cmssimplicity_preprocess_node(&$vars)
{
if ($vars['picture']) {
$classes = explode(' ', $vars['classes']);
$classes[] = 'user-picture';
$vars['classes'] = implode(' ', $classes);
}
$node = $vars['node'];
// override the subbmitted text according to requirment
$author = "posted by ";
$author .= theme('username', $node);
$posted_date = date('F d, Y ', $node->created);
$submitted = '';
$submitted_by_content_type = theme_get_setting('submitted_by_content_type') == 1 ? $node->type : 'default';
$author_setting = theme_get_setting('submitted_by_author_' . $submitted_by_content_type) == 1;
$date_setting = theme_get_setting('submitted_by_date_' . $submitted_by_content_type) == 1;
if ($author_setting) {
$submitted = $author . ' ';
}
if ($date_setting) {
$submitted .= $posted_date;
}
$vars['submitted'] = $submitted;
//Formating taxonomy term list according to theme's requirement
$taxonomy_content_type = theme_get_setting('taxonomy_enable_content_type') == 1 ? $vars['node']->type : 'default';
$taxonomy_display = theme_get_setting('taxonomy_display_' . $taxonomy_content_type);
$taxonomy_format = theme_get_setting('taxonomy_format_' . $taxonomy_content_type);
if ($taxonomy_display == 'all' || $taxonomy_display == 'only' && $vars['page']) {
$vocabularies = taxonomy_get_vocabularies($vars['node']->type);
$vars['terms'] = '';
$term_delimiter = ' // ';
foreach ($vocabularies as $vocabulary) {
if (theme_get_setting('taxonomy_vocab_hide_' . $taxonomy_content_type . '_' . $vocabulary->vid) != 1) {
$terms = taxonomy_node_get_terms_by_vocabulary($vars['node'], $vocabulary->vid);
if ($terms) {
$term_items = '';
foreach ($terms as $term) {
// Build vocabulary term items
$term_link = l($term->name, taxonomy_term_path($term), array('attributes' => array('rel' => 'tag', 'title' => strip_tags($term->description))));
$term_items .= $term_delimiter . $term_link;
}
if ($taxonomy_format == 'vocab') {
// Add vocabulary labels if separate
$vars['terms'] .= '<span class="vocab-name">' . $vocabulary->name . ':</span>';
$vars['terms'] .= $term_items;
} else {
$vars['terms'] .= $term_items;
}
}
}
}
if ($vars['terms'] != '') {
$vars['terms'] = $vars['terms'];
}
}
}
开发者ID:naveen3,项目名称:test2-online,代码行数:62,代码来源:template.php
示例14: SUM
SUM(content_type_vote.field_vote_rate_rating) as sum,
COUNT(*)as count,
SUM(content_type_vote.field_vote_rate_rating)/COUNT(*)+1 as sum_dev_count, ((SUM(content_type_vote.field_vote_rate_rating)/25)-(COUNT(*)*2)) as sort_vote
FROM content_type_vote
INNER JOIN content_field_celebrity ON content_type_vote.nid = content_field_celebrity.nid
GROUP BY content_field_celebrity.field_celebrity_nid) sss ON node_data_field_firstname.nid = sss.seleb
WHERE (node.type in ('celebrity')) AND (node.nid =".$fields['nid']->raw.")
ORDER BY sss_sort_vote DESC");
$full_vote = db_fetch_object($query2);
?>
<?php
$node = (object)array('vid' => $fields['vid']->raw, 'taxonomy' => array(), 'nid' => $fields['nid']->raw);
$term=array_shift(taxonomy_node_get_terms_by_vocabulary($node, 1));
if ($term->tid==21)
{
$cat=t('fiveminfame');
}
else if($term->tid==1)
{
$cat=t('sports');
}
else if($term->tid==20)
{
$cat=t('business');
}
else if ($term->tid==2)
{
开发者ID:rkern21,项目名称:threebeats,代码行数:31,代码来源:views-view-fields--search-view--block-1.tpl.php
示例15: t
<div class="posted">
<?php
print t('posted ') . format_date($node->created, 'custom', variable_get('date_format_gfs_date', ''));
// Get the term for type of news or event
foreach (taxonomy_node_get_terms_by_vocabulary($node, 3) as $term) {
print " | " . i18ntaxonomy_translate_term_name($term->tid, $term->name);
}
?>
</div>
<?php
if ($node->field_news_image[0]['filename']) {
?>
<div id="news_main_image">
<div class="drop-shadow">
<div class="drop-shadow-outer">
<div class="drop-shadow-inner">
<img class="main_image" src="/sites/default/files/imagecache/news_event_main/<?php
print $node->field_news_image[0]['filename'];
?>
" alt="<?php
print $node->field_news_image[0]['data']['alt'];
?>
" title="<?php
print $node->field_news_image[0]['data']['title'];
?>
" />
</div>
</div>
</div>
</div>
开发者ID:davidclarkmoore,项目名称:vintage-enoteca,代码行数:31,代码来源:news_and_events_partial.tpl.php
注:本文中的taxonomy_node_get_terms_by_vocabulary函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论