/** * Preprocess functions for node.tpl.php. */ function base_preprocess_node(&$vars){ $node = $vars['node']; $url = substr($vars['node_url'], 1); // Add general theme suggestions for all content types and view modes $vars['theme_hook_suggestions'][] = 'node__' . $vars['type'] . '__' . $vars['view_mode']; // PROJECT ==================================================== if($vars['type'] == 'project'){ $vars['body'] = render($vars['content']['body']); $vars['images'] = render($vars['content']['field_project_images']); $vars['location_date'] = render($vars['content']['field_project_location_date']); $vars['photo_cred'] = render($vars['content']['field_photo_credit']); $vars['contribs'] = render($vars['content']['field_other_contributors']); $vars['cover_image'] = render_image($vars['field_project_images'][0]['uri'], 'project_full', ''); $vars['teaser_image'] = render_image($vars['field_project_images'][0]['uri'], 'project_teaser', ''); $vars['url'] = '/' . $url; if($vars['view_mode'] == 'featured'){ drupal_add_js(path_to_theme() . '/js/init_featured.js'); } if($vars['view_mode'] == 'full'){ drupal_add_js(path_to_theme() . '/js/init_gallery.js'); } } // PRESS ==================================================== if($vars['type'] == 'press'){ $vars['body'] = render($vars['content']['body']); $vars['images'] = render($vars['content']['field_press_image']); $vars['source'] = render($vars['content']['field_original_source']); $vars['pdf'] = render($vars['content']['field_press_pdf']); $vars['photo_cred'] = render($vars['content']['field_photo_credit']); $vars['cover_image'] = render_image($vars['field_press_image'][0]['uri'], 'project_full', ''); $vars['teaser_image'] = render_image($vars['field_press_image'][0]['uri'], 'project_teaser', ''); $vars['url'] = '/' . $url; if($vars['view_mode'] == 'featured'){ drupal_add_js(path_to_theme() . '/js/init_featured.js'); } if($vars['view_mode'] == 'full'){ drupal_add_js(path_to_theme() . '/js/init_gallery.js'); } } // INTRO GALLERY ==================================================== if($vars['type'] == 'intro_gallery'){ $vars['images'] = render($vars['content']['field_project_images']); } }
/** * Preprocess functions for node.tpl.php. */ function bb_preprocess_node(&$vars) { $node = $vars['node']; $url = $vars['node_url']; // Add general theme suggestions for all content types and view modes $vars['theme_hook_suggestions'][] = 'node__' . $vars['type'] . '__' . $vars['view_mode']; // BLOG POST ==================================================== if ($vars['type'] == 'post') { $vars['body'] = render($vars['content']['body']); $vars['created'] = format_date($vars['created'], 'custom', "n/j/y"); $vars['section'] = render($vars['content']['field_site_section']); $vars['tags'] = render($vars['content']['field_tags']); $vars['service_links'] = render($vars['content']['service_links']); $vars['comments'] = render($vars['content']['comments']['comments']); $vars['content']['comments']['comment_form']['actions']['submit']['#value'] = t('submit comment'); $vars['comment_form'] = render($vars['content']['comments']['comment_form']); if ($vars['view_mode'] == 'teaser') { $vars['title'] = l($vars['title'], $url); } //kpr($vars); } // ART ==================================================== if ($vars['type'] == 'art') { $vars['body'] = render($vars['content']['body']); $vars['size'] = render($vars['content']['field_art_size']); $vars['medium'] = render($vars['content']['field_art_medium']); $vars['main_image'] = render($vars['content']['field_art_main_image']); $vars['detail_image'] = render_image($vars['field_art_main_image'][0]['uri'], 'art_details', ''); if ($vars['view_mode'] == 'teaser') { $vars['title'] = l($vars['title'], $url); } //kpr($vars); } // TOUR SLIDE ==================================================== if ($vars['type'] == 'tour_slide') { $vars['body'] = render($vars['content']['body']); } // TOUR ==================================================== if ($vars['type'] == 'guided_tour') { $vars['slides'] = render($vars['content']['field_tour_slides']); drupal_add_js(path_to_theme() . '/js/jquery.easing.js'); drupal_add_js(path_to_theme() . '/js/tour.js'); // kpr($vars); } }
/** * Preprocess functions for node.tpl.php. */ function theadmin_preprocess_node(&$vars) { $node = $vars['node']; $url = substr($vars['node_url'], 5); // Add general theme suggestions for all content types and view modes $vars['theme_hook_suggestions'][] = 'node__' . $vars['type'] . '__' . $vars['view_mode']; $vars['nid'] = $vars['node']->nid; // IMAGE GALLERY ==================================================== if ($vars['type'] == 'media_gallery') { drupal_set_title(t('welcome to your backend.')); if (isset($vars['user']->roles[1]) && $vars['user']->roles[1] || $vars['view_mode'] == 'gallery_preview') { //$vars['images'] = render($vars['content']['media_gallery_file']); $images = array(); for ($i = 0; $i < count($vars['media_gallery_file']); $i++) { $uri = $vars['media_gallery_file'][$i]['uri']; $alt = $vars['media_gallery_file'][$i]['alt']; $title = $vars['media_gallery_file'][$i]['title']; $images[] = render_image($uri, $style = 'gallery_large', $alt); } $vars['images'] = theme_item_list(array('items' => $images, 'title' => null, 'type' => 'ul', 'attributes' => array())); $vars['theme_hook_suggestions'][] = 'node__' . $vars['type'] . '__preview'; drupal_add_js(path_to_theme() . '/js/init_gallery.js'); } else { $vars['add_media'] = render($vars['content']['add_media_link']); $vars['images'] = render($vars['content']['media_gallery_file']); } //kpr($vars); } if ($vars['type'] == 'image_gallery') { $images = array(); for ($i = 0; $i < count($vars['field_images']); $i++) { $uri = $vars['field_images'][$i]['uri']; $alt = $vars['field_images'][$i]['alt']; $images[] = render_image($uri, $style = 'gallery_large', $alt); } } // kpr($vars); }
<?php include_once 'include/inc.php'; if (isset($_GET['t'])) { echo render_image($_GET['t'], $img_settings, NULL, NULL, $mysqli); } else { echo render_image(NULL, $img_settings, $_GET['id'], NULL, $mysqli); }
{ echo "<a href=\"{$url}\">"; echo "<img id=\"{$id}\" class=\"section-gallary-image\" src=\"/{$url}\">"; echo "</a>"; } $dirs_to_scan = ['wp-content/gallery/sugarcreek-industries', 'wp-content/gallery/sugarcreek-industries-windows', 'wp-content/gallery/alside-siding']; foreach ($dirs_to_scan as $d) { foreach (scandir($_SERVER['DOCUMENT_ROOT'] . '/' . $d) as $i) { if (is_file($_SERVER['DOCUMENT_ROOT'] . '/' . $d . '/' . $i)) { $image_paths[] = $d . '/' . $i; } } } //randomly establish a set of 6 foreach (array_rand($image_paths, 6) as $i) { $image['path'] = $image_paths[$i]; $dimensions = getimagesize($_SERVER['DOCUMENT_ROOT'] . '/' . $image_paths[$i]); $image['aspect'] = $dimensions[0] / $dimensions[1]; $subset[] = $image; } //calculate sums of aspect ratios (3, 3, and 6) foreach ($subset as $i => $image) { $sum3[$i / 3] += $image['aspect']; $sum6 += $image['aspect']; } //render things foreach ($subset as $i => $image) { $id = uniqid('i'); render_style($id, $image['aspect'], $sum3[$i / 3], $sum6, 0.25, 1.5, 3); render_image($id, $image['path']); }
<?php echo $a->description; ?> </div> </div> </div> <?php if ($nodes[$key]->field_image['und'][$key]['uri']) { ?> <a href="<?php echo render_href($nodes[$key]->nid); ?> "> <img src="<?php echo render_image('x633', $nodes[$key]->field_image['und'][$key]['uri']); ?> " alt=""> </a> <?php } ?> <h3> <a href="<?php echo render_href($nodes[$key]->nid); ?> "> <?php echo $nodes[$key]->title; ?>
<th class="padding-th" width="20%">Ordine</th> <th class="padding-th" width="20%"></th> </tr> </thead> <tbody> <?php foreach ($results as $result) { ?> <tr class="highlight-element"> <td> <a href="#" class="screenshot" rel="<?php echo get_image_path($result['filename'], 'normal'); ?> "> <?php echo render_image($result['filename'], 'thumb', array('alt' => '')); ?> </a> </td> <td> <?php echo $result['category']; ?> <td> <?php echo $result['sort']; ?> <td> <a href="<?php echo site_url('admin/galerie/edit/' . $result['id']);
<ul class="tags"> <?php echo $tags['html']; ?> </ul> <h3 class="node-title"><?php echo $title; ?> </h3> <?php if ($n->field_image['und'][0]['uri']) { ?> <img src="<?php echo render_image('x585', $n->field_image['und'][0]['uri']); ?> " alt=""/> <?php } ?> <?php if ($n->field_image['und'][0]['alt']) { ?> <div class="img-caption"><?php echo $n->field_image['und'][0]['alt']; ?> </div> <?php }
<div class="row-fluid"> <?php $user_id = $_SESSION[id]; $query = "SELECT * FROM `tcmks`.`images` WHERE user_id = {$user_id}"; $result = mysqli_query($dbc, $query) or die('Error querying database.'); while ($row = mysqli_fetch_array($result)) { echo '<ul class = "thumbnails">'; render_image($row); if ($row = mysqli_fetch_array($result)) { render_image($row); } if ($row = mysqli_fetch_array($result)) { render_image($row); } if ($row = mysqli_fetch_array($result)) { render_image($row); } echo '</ul>'; } ?> </div> </div> </div> </div> <div id="myModal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> <H3 id="myModalLabel" >图片信息录入:</H3> </div> <div id ="myContent" class="modal-body">
<span class="label"> <a href="<?php echo $menus['promoted'][$i]['href']; ?> "> <?php echo $menus['promoted'][$i]['title']; ?> </span> </a> <a href="<?php echo $menus['promoted'][$i]['href']; ?> "> <img src="<?php echo render_image('x307', $menus['promoted'][$i]['image']->uri); ?> " alt=""> </a> </div> <?php } ?> </div> </div> <div class="w-main"> <div class="main"> <div class="first">
/** * Preprocess functions for node.tpl.php. */ function base_preprocess_node(&$vars) { $node = $vars['node']; $options = array('absolute' => TRUE); $nid = $vars['vid']; // Node ID $url = url('node/' . $nid, $options); $vars['theme_hook_suggestions'][] = 'node__' . $vars['view_mode']; $vars['theme_hook_suggestions'][] = 'node__' . $vars['type'] . '__' . $vars['view_mode']; // GENERAL VARS ==================================================== $vars['body'] = render($vars['content']['body']); $vars['created'] = format_date($vars['created'], 'custom', "n/j/y"); $vars['sections'] = render($vars['content']['field_section']); $vars['tags'] = render($vars['content']['field_tags']); $vars['service_links'] = render($vars['content']['service_links']); $vars['video'] = render($vars['content']['field_video_url']); if ($vars['view_mode'] == 'teaser') { $vars['title'] = l(html_entity_decode($vars['title']), $url, array('html' => TRUE)); $vars['cover_image'] = render($vars['content']['field_cover_image']); if ($vars['type'] == 'video') { $vars['cover_image'] = render($vars['content']['field_video_url']); } } // IMAGE GALLERY ==================================================== if ($vars['type'] == 'image_gallery') { if ($vars['view_mode'] == 'teaser') { $vars['cover_image'] = render($vars['content']['field_cover_image']); if (isset($vars['cover_image'])) { $vars['cover_image'] = l($vars['cover_image'], $url, array('html' => TRUE)); } else { $vars['cover_image'] = l(render_image($vars['field_other_images'][0], 'cover_image'), $url, array('html' => TRUE)); } $read_more = l(' — read more', $url); $summary_text = render($vars['content']['body']); $vars['summary'] = $summary_text . ' ' . $read_more; } if ($vars['view_mode'] == 'full') { $images = array(); for ($i = 0; $i < count($vars['field_other_images']); $i++) { $image = render_image($vars['field_other_images'][$i], 'gallery_large'); if ($vars['field_other_images'][$i]['linknext'][1]) { $caption1 = '<div class="caption c-left">' . $vars['field_other_images'][$i]['title'] . '</div>'; $iw = $vars['field_other_images'][$i]['width']; $i++; $caption2 = '<div class="caption c-right">' . $vars['field_other_images'][$i]['title'] . '</div>'; $iw2 = $vars['field_other_images'][$i]['width']; $wt = $iw + $iw2; $image2 = render_image($vars['field_other_images'][$i], 'gallery_large'); $images[] = '<div class="image-group" data-wt="' . $wt . '">' . $image . $image2 . '<div class="captions">' . $caption1 . $caption2 . '</div></div>'; } else { $caption = '<div class="captions"><div class="caption">' . $vars['field_other_images'][$i]['title'] . '</div></div>'; $images[] = '<div class="single-image">' . $image . $caption . '</div>'; } } $gallery_settings = array('autoplay' => $vars['field_autoplay_slideshow'][0]['value'], 'start_thumbs' => $vars['field_start_with_thumbnails'][0]['value'], 'hide_controls' => $vars['field_hide_controls'][0]['value']); drupal_add_js(array('gallery_settings' => $gallery_settings), 'setting'); $vars['images'] = theme_item_list(array('items' => $images, 'title' => null, 'type' => 'ul', 'attributes' => array())); drupal_add_js(path_to_theme() . '/js/init_gallery.js'); } if ($vars['vid'] == 8) { $vars['theme_hook_suggestions'][] = 'node__intro__gallery'; $intro_images = array(); for ($i = 0; $i < 5; $i++) { $intro_images[] = file_create_url($vars['field_other_images'][$i]['uri']); } drupal_add_js(array('intro_images' => $intro_images), 'setting'); drupal_add_js(path_to_theme() . '/js/jquery.backstretch.min.js'); drupal_add_js(path_to_theme() . '/js/intro-gallery.js'); //kpr($intro_images); } //kpr($vars); } // ARTICLE ==================================================== if ($vars['type'] == 'article') { $vars['cover_image'] = render($vars['content']['field_cover_image']); $vars['post_date'] = $vars['created']; $vars['tags'] = render($vars['content']['field_tags']); $vars['summary'] = render($vars['content']['body']); $vars['service_links'] = render($vars['content']['service_links']); $vars['comment_count'] = l('Comments ' . $vars['comment_count'], $url . '#comments'); if ($vars['view_mode'] == 'teaser') { //$vars['title'] = l($vars['title'], $url); $vars['cover_image'] = l($vars['cover_image'], $url, array('html' => TRUE)); $read_more = l(' — read more', $url); $summary_text = render($vars['content']['body']); $vars['summary'] = $summary_text . ' ' . $read_more; } //kpr($vars); } }
echo ' error'; } ?> "> <?php echo form_label('Categorie<span class="required">*</span>', 'item_id_category', array('class' => 'big-label')); ?> <?php echo form_dropdown('item[id_category]', $categories_dropdown, isset($form_values['item']['id_category']) ? $form_values['item']['id_category'] : '', 'id="item_id_category" class="selectInput" style="width: 180px;"'); ?> </div> </div> <div class="hover-wrapper"> <?php if (isset($form_values['item']['filename'])) { echo render_image($form_values['item']['filename'], 'thumb'); } ?> <div class="ctrlHolder clearfix"> <?php echo form_label('Imagine', 'image', array('class' => 'big-label')); ?> <input type="file" name="image"> </div> </div> <div class="hover-wrapper"> <div class="ctrlHolder clearfix<?php if (form_error('item[sort]') != '') { echo ' error'; } ?>
function render_images() { #TODO global $pdf_file; global $img_dir; global $img_uri; global $lock; $pdf_base = strip_ext($pdf_file); $imgs = get_images($pdf_base); if (count($imgs) == 0) { render_regen_form($pdf_file, 'Obrázky je nutné nejdříve vygenerovat.'); return; } render_check_update($pdf_base, $imgs[0]); foreach ($imgs as $idx => $img) { $img_uri_path = "{$img_uri}/{$img}"; $img_path = "{$img_dir}/{$img}"; list($w, $h) = getimagesize($img_path); $id = "img-{$idx}"; if ($lock) { echo "<b>Od " . $lock["cas"] . " zanáší " . $lock["au"] . " korektury.</b>"; } render_image($img_path, $id, $w, $h); } if ($lock) { render_unlock($pdf_file); } else { render_lock($pdf_file); } render_delall($pdf_file); }
<?php //pprint($node->field_image[und]) ?> <div id="owl-gallery" class="owl-carousel"> <?php foreach ($node->field_image[und] as $g) { ?> <div> <img src="<?php echo render_image('x585', $g['uri']); ?> " /> </div> <?php } ?> </div>
echo $cm[$i % 2]; ?> "> <?php if ($nodes[$i]) { ?> <?php if ($nodes[$i]->type != 'blog') { ?> <a href="<?php echo render_href($nodes[$i]->nid); ?> "> <img src="<?php echo render_image('x307', $nodes[$i]->field_image['und'][0]['uri']); ?> " alt=""> </a> <h3> <a href="<?php echo render_href($nodes[$i]->nid); ?> "> <?php echo $nodes[$i]->title; ?> </a>
<?php require_once 'render.php'; render_image("000000000000000000000000000000000000000000000001QQ11MQQJ1000N0111L0000100000000000000000J1100E0000000000000000000N00P00001QQJ11011LOO000N00P0000100000000000000N00D0000B00000000000000N0010000N00000000000000C0000000N0011MQQQ00100010000000N00P0000000N00011000000N00P0000000N00011011011100P0000000100010000000000D000000010000000000000010001LO0100000000000000E0001000I000000000000000000100000000000NP00000000K1000K1110000000000000010001M00N0000NP0000000010000000N0000NP0000000010000000N0000NP0000000000000000C0000NP0111OO1110K1100010000CD0000000000M00000100001100000J0000000000100001100K00000K0000000000001100000000000000000000011LOOOOOK110P011LOO0000J111E00000000000000000000000000000000000000000000000000000000000000|5^528,564!7^276,444,3!7^300,444,3!7^564,228,2!7^564,252,2!7^84,84,0!7^84,108,0!12^420,228!12^432,204!12^432,180!12^420,156!12^396,144!12^372,144!12^348,156!12^372,468!12^360,492!12^360,516!12^372,540!12^396,552!12^420,540!12^84,300!12^72,324!12^48,336!12^24,336!12^708,516!12^720,540!12^744,552!12^768,552!9^420,504,0,0,4,23,1,-1,0!9^396,180,0,0,5,23,1,-1,0!9^744,516,0,0,6,23,1,-1,0!9^48,288,0,0,7,23,1,-1,0!11^252,564,372,300!9^636,252,0,0,8,23,1,-1,0!0^504,72!0^516,72!0^510,60!0^522,60!0^516,48!0^528,48!0^618,168!0^606,168!0^612,180!0^600,180!0^618,312!0^606,312!0^612,324!0^600,324!0^192,306!0^204,306!0^198,318!0^210,318!0^204,330!0^216,330!0^738,246!0^750,246!0^744,258!0^732,258!0^738,270!0^726,270!0^174,96!0^186,96!0^180,108!0^192,108!0^186,120!0^198,120!8^732,36,1!8^756,36,1!8^36,36,1!8^60,36,1!12^288,264!12^300,288!12^300,312!12^288,336!12^264,348!12^636,348!12^648,372!12^636,396!12^612,408!12^588,396!2^480,516,0,-1!2^504,516,0,-1!2^168,60,0,1!2^252,180,0,-1!2^276,180,0,-1!7^252,60,3!7^276,60,3!7^300,60,3!7^468,96,3!2^504,312,0,-1!2^474,312,0,-1!1^492,234!1^492,168!1^204,246!1^204,396!1^564,468!1^120,216!7^684,348,2!7^690,348,2!7^156,324,2!7^162,324,2!7^468,102,3!1^384,108!7^324,108,2!2^312,564,0,-5!2^192,540,0,-1!2^144,540,0,-1!9^336,564,0,0,13,23,0,0,0!7^540,324,1!7^540,318,1!2^324,108,-1,0!6^180,156,1,0,2,2!6^540,180,0,0,2,3", 1);
echo render_href($more[1]->nid); ?> "><h4><?php echo $more[1]->title; ?> </h4></a> </div> <?php } ?> <?php if ($more[2]) { ?> <div class="three"> <img src="<?php echo render_image('x307', $more[2]->field_image['und'][0]['uri']); ?> " alt=""> <a href="<?php echo render_href($more[2]->nid); ?> "><h4><?php echo $more[2]->title; ?> </h4></a> </div> <?php } ?> </div>
for ($i = 0; $i < count($lines); $i++) { $draw->setFillColor('black'); $target->annotateImage($draw, $rect->x + 1, $rect->y + 1 + $i * $line_height, 0, $lines[$i]); $draw->setFillColor('white'); $target->annotateImage($draw, $rect->x, $rect->y + $i * $line_height, 0, $lines[$i]); } } /*$image = new Imagick(); $draw = new ImagickDraw(); $pixel = new ImagickPixel( 'transparent' ); $image_crop_width = 600; $image_aspect = 1.6; $image_height = 1024; $image_width = $image_height * $image_aspect; $image->newImage($image_width, $image_height, $pixel); $draw->setFont('Helvetica.ttf'); $draw->setFontSize(36); $icon = new Imagick('uploads/' . '25.jpg'); $draw->setFillColor('black'); $image->annotateImage($draw, $image_crop_width + 11, 46, 0, 'The quick brown fox jumps over the lazy dog.'); $draw->setFillColor('white'); $image->annotateImage($draw, $image_crop_width + 10, 45, 0, 'The quick brown fox jumps over the lazy dog.'); */ $output = create_image(1280, 720, 'uploads/25.jpg'); render_image($output);
function simpl_preprocess_page(&$vars) { if ($vars['is_front']) { // load homepage promoted menu $vars['menus']['promoted'] = render_menu('menu-promoted'); // load populare content $vars['popular'] = get_v('popular'); // pprint($vars['popular']); $vars['nq'] = array(); // load hero nodequeue $nq_hero = nodequeue_load_nodes(1, false, 0, 1); foreach ($nq_hero as $node) { $hero[] = n_load($node->nid); } $vars['nq']['hero'] = $hero; // load promoted nodequeue $nq_featured = nodequeue_load_nodes(2, false, 0, 3); foreach ($nq_featured as $node) { $featured[] = n_load($node->nid); } $vars['nq']['featured'] = $featured; // load latest nodequeue $nq_latest = nodequeue_load_nodes(4, false, 0, 12); foreach ($nq_latest as $node) { $latest[] = n_load($node->nid); } $vars['nq']['latest'] = $latest; // load opinions nodequeue $nq_opinions = nodequeue_load_nodes(5, false, 0, 6); foreach ($nq_opinions as $node) { $opinions[] = $node->nid; } $vars['nq']['opinions'] = array_values(node_load_multiple($opinions)); //$vars['opinions'] = array_values(get_vn('taxonomy_term', array('all', 1,'blog'), 5)); } /* Node page */ if (!empty($vars['node'])) { $GLOBALS['body-class'] = 'node-page'; $vars['n'] = node_load($vars['node']->nid); $section_id = $vars['n']->field_section['und'][0]['tid']; $tags = $vars['n']->field_tags['und']; if (count($tags)) { $tags_ids = []; foreach ($tags as $tag) { $tags_ids[] = $tag['tid']; } } $vars['more'] = array_values(get_vn('taxonomy_term', array(join('+', $tags_ids), 1, 'article', $vars['node']->nid), 3)); $vars['readlist'] = array_values(get_vn('taxonomy_term', array($section_id, 1, 'article+blog+gallery'), 5)); $vars['related'] = array_values(get_vn('taxonomy_term', array($section_id, 1, $vars['n']->type), 5)); $vars['tags'] = get_tags($vars['n']); $vars['popular'] = get_v('popular'); if ($vars['node']->type == 'article') { //create dedicated page for node, f**k the drupal nesting shit $vars['theme_hook_suggestions'][] = '__article'; $vars['r'] = node_view($vars['n'])['body'][0]['#markup']; $vars['author'] = get_author($vars['n']); } else { if ($vars['node']->type == 'blog') { $vars['theme_hook_suggestions'][] = '__blog'; $author = get_author($vars['n']); $vars['blog']['author'] = $author; //pprint($author); $element1 = array('#tag' => 'meta', '#attributes' => array('property' => 'og:image', 'content' => render_image('x585', $author->image_src))); $element2 = array('#tag' => 'link', '#attributes' => array('rel' => 'image_src', 'type' => 'image/jpeg', 'href' => render_image('x585', $author->image_src))); drupal_add_html_head($element1, 'element1'); drupal_add_html_head($element2, 'element2'); // load opinions nodequeue $nq_opinions = nodequeue_load_nodes(5, false, 0, 6); foreach ($nq_opinions as $node) { $opinions[] = $node->nid; } $vars['nq']['opinions'] = array_values(node_load_multiple($opinions)); $vars['readlist'] = array_values(get_vn('opinions_author', array($vars['blog']['author']->nid, $vars['node']->nid), 5)); } else { if ($vars['node']->type == 'author') { $vars['theme_hook_suggestions'][] = '__author'; $vars['author'] = get_author($vars['n']); $element1 = array('#tag' => 'meta', '#attributes' => array('property' => 'og:image', 'content' => render_image('x585', $vars['author']->image_src))); $element2 = array('#tag' => 'link', '#attributes' => array('rel' => 'image_src', 'type' => 'image/jpeg', 'href' => render_image('x585', $vars['author']->image_src))); drupal_add_html_head($element1, 'element1'); drupal_add_html_head($element2, 'element2'); // load opinions nodequeue $nq_opinions = nodequeue_load_nodes(5, false, 0, 6); foreach ($nq_opinions as $node) { $opinions[] = $node->nid; } $vars['nq']['opinions'] = array_values(node_load_multiple($opinions)); $vars['opinions_author'] = array_values(get_vn('opinions_author', array($vars['n']->nid, 0), 10)); //pprint($vars['opinions_author']); } else { if ($vars['node']->type == 'social') { $vars['author'] = get_author($vars['n']); $vars['theme_hook_suggestions'][] = '__social'; } else { if ($vars['node']->type == 'page') { $vars['theme_hook_suggestions'][] = '__static'; } } } } } } /* --- Node page ----- */ /* Taxonomy Term pages */ if (arg(0) == 'taxonomy' && arg(1) == 'term' && arg(4) == 'blog') { // load opinions nodequeue $nq_opinions = nodequeue_load_nodes(5, false, 0, 6); foreach ($nq_opinions as $node) { $opinions[] = $node->nid; } $vars['nq']['opinions'] = array_values(node_load_multiple($opinions)); $vars['theme_hook_suggestions'][] = '__opinions'; } /* --- Taxonomy Term pages ----- */ }