本文整理汇总了PHP中theme_image_style函数的典型用法代码示例。如果您正苦于以下问题:PHP theme_image_style函数的具体用法?PHP theme_image_style怎么用?PHP theme_image_style使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了theme_image_style函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: buildDescription
/**
* Build the search row description.
*
* If there is a "result_description", run it thro token_replace.
*
* @param object $data
* An entity object that will be used in the token_place function.
*
* @see token_replace()
*/
function buildDescription($data)
{
$description_array = array();
//Get image info.
$imageinfo = image_get_info($data->uri);
if ($this->conf['image_extra_info']['thumbnail']) {
$image = $imageinfo ? theme_image_style(array('width' => $imageinfo['width'], 'height' => $imageinfo['height'], 'style_name' => 'linkit_thumb', 'path' => $data->uri)) : '';
}
if ($this->conf['image_extra_info']['dimensions'] && !empty($imageinfo)) {
$description_array[] = $imageinfo['width'] . 'x' . $imageinfo['height'] . 'px';
}
$description_array[] = parent::buildDescription($data);
if ($this->conf['show_scheme']) {
$description_array[] = file_uri_scheme($data->uri) . '://';
}
$description = (isset($image) ? $image : '') . implode('<br />', $description_array);
return $description;
}
示例2: image_get_info
<?php
$name = $fields['name']->content;
$job = $fields['field_job_position']->content;
$email = $fields['mail']->content;
$colour = $fields['field_colour']->content;
$uri = $fields['uri'];
$imageinfo = image_get_info($uri->raw);
$variables = array('style_name' => 'our_people', 'path' => $uri->raw, 'width' => $imageinfo['width'], 'height' => $imageinfo['height'], 'alt' => strip_tags($name));
$photo = theme_image_style($variables);
?>
<div class="teamBlock column <?php
print $zebra;
?>
">
<div class="teamImage" style="background-color:<?php
print $colour;
?>
"><?php
print $photo;
?>
<div class="teamName">
<h2><?php
print $name;
?>
</h2>
<h3><?php
print $job;
?>
</h3>
<ul class="socialLinksTeam">
示例3: nestor_image_style
function nestor_image_style($variables)
{
$resp_full_image_styles = array("blog_lg", "blog_sm", "portfolio_lg", "portfolio_sm", "image_full_width");
$resp_image_styles = array("image_responsive", "user_picture");
if (in_array($variables['style_name'], $resp_full_image_styles)) {
$variables['attributes']['class'][] = 'img-responsive';
$variables['attributes']['class'][] = 'img-full-width';
}
if (in_array($variables['style_name'], $resp_image_styles)) {
$variables['attributes']['class'][] = 'img-responsive';
}
return theme_image_style($variables);
}
示例4: foreach
if ($rows) {
?>
<div class="view-content">
<div class="widget kopa-article-list-widget article-list-9">
<ul class="clearfix">
<?php
foreach ($results as $article) {
?>
<?php
$thumbnail_uri = $article->field_field_image[0]['rendered']['#item']['uri'];
$image = '';
if ($thumbnail_uri) {
$variable = array('style_name' => 'content_carrousel_thumb', 'path' => $thumbnail_uri, 'width' => '', 'height' => '');
$image = theme_image_style($variable);
}
?>
<li>
<article class="entry-item">
<div class="entry-thumb">
<a href="<?php
echo drupal_get_path_alias("node/" . $article->nid);
?>
"><?php
echo !empty($image) ? $image : '';
?>
</a>
</div>
<h4 class="entry-title">
<a itemprop="name" href="<?php
示例5: foreach
<ul class="team-masonry row clearfix" style="position: relative; height: 120px;">
<?php
foreach ($players as $player) {
?>
<li class="t-item col-md-6 col-sm-6 col-xs-6" style="position: absolute; left: 0px; top: 0px;">
<article class="entry-item">
<div class="entry-thumb">
<a href="/<?php
echo drupal_get_path_alias('node/' . $player->nid);
?>
">
<?php
if (!is_null($player->image)) {
?>
<?php
echo theme_image_style(array('style_name' => 'squad_player', 'path' => $player->image, 'width' => '', 'height' => ''));
?>
<?php
} else {
?>
<img src="/<?php
echo $theme_path;
?>
/images/default_player_profile_small.png" width="190px" height="146px">
<?php
}
?>
</a>
<div class="thumb-icon style3"><?php
echo $player->number;
?>
示例6: theme_image_style
<?php
global $user;
if ($user->uid) {
?>
<div class="log-w">
<div class="pic-ct">
<?php
if (isset($variables['user']->picture->uri)) {
print theme_image_style(array('style_name' => 'thumbnail', 'path' => $variables['user']->picture->uri, 'attributes' => array('class' => 'avatar'), 'width' => NULL, 'height' => NULL, 'alt' => "img-" . $variables['user']->name));
} else {
?>
<img class="avatar" typeof="foaf:Image" src="<?php
print variable_get('user_picture_default');
?>
" alt="default-img">
<?php
}
?>
</div>
<div class="txt-ct">
<div class="tit-log">Bienvenido
</div>
<div class="name-t">
<?php
print $variables['user']->name;
?>
</div>
</div>
</div>
<?php
示例7: foreach
<div class="fotorama"
data-width='100%'
data-fit='contain'
data-height="439"
data-autoplay="true">
<?php
foreach ($node->field_title_image['und'] as $key => $value) {
?>
<div id="image_slider">
<?php
print theme_image_style(array('style_name' => 'photo_slider', 'path' => $node->field_image_gallery_['und'][$key]['uri'], 'alt' => $node->field_image_gallery_['und'][$key]['alt'], 'title' => $node->field_image_gallery_['und'][$key]['title'], 'width' => NULL, 'height' => NULL));
?>
<?php
if (isset($node->field_title_image['und'][$key]['value'])) {
?>
<div class="flexlider_background">
<div id="title_slider"> <?php
print $node->field_title_image['und'][$key]['value'];
?>
</div>
<div id="text_slider"> <?php
print $node->field_image_text['und'][$key]['value'];
?>
</div>
</div>
<?php
示例8: theme_image_style
<div class="media authorname">
<?php
if ($author->picture) {
?>
<div class="pull-left">
<?php
echo theme_image_style(array('style_name' => 'thumbnail', 'height' => '100', 'width' => '100', 'path' => $author->picture->uri, 'alt' => $author->name));
?>
</div>
<?php
}
?>
<div class="media-body">
<h4 class="media-heading">
<small>Written by</small><span itemprop="author" itemscope="" itemtype="http://schema.org/Person">
<span itemprop="name">
<?php
echo $author->name;
?>
</span>
</span>
<time class="<?php
echo $dateClass;
?>
" itemprop="datePublished">
<span class="c-date_day"><?php
echo date('j', $date);
?>
</span>
<span class="c-date_month"><?php
echo date('M', $date);
示例9: intranet_preprocess_node
/**
* Override or insert variables into the node template.
*/
function intranet_preprocess_node(&$variables)
{
$node = $variables['node'];
$field_items = field_get_items('node', $node, 'field_linktype');
$link_type = $field_items[0]['value'];
if ($variables['view_mode'] == 'full' && node_is_page($variables['node'])) {
$variables['classes_array'][] = 'node-full';
}
if ($variables['type'] == 'cluster_of_links' && $link_type == 'All Applications') {
$content_array = $variables['field_link_details'];
$field_items1 = field_get_items('node', $node, 'field_link_details');
foreach ($field_items1 as $key => $value) {
$multifield = _multifield_field_item_to_entity('field_link_details', $value);
$subfield_link = field_get_items('multifield', $multifield, 'field_link');
$subfield_icon = field_get_items('multifield', $multifield, 'field_clustor_link_icon');
$link_url = $subfield_link[0]['display_url'];
$link_title = $subfield_link[0]['title'];
$img_path = $subfield_icon[0]['uri'];
$image = array('style_name' => 'all_application', 'path' => $img_path, 'alt' => '', 'title' => '');
// link elements
$text = theme('image_style', $image);
// in your case it's an image
$path = $link_url;
$options = array('attributes' => array('target' => '_blank'), 'html' => true);
$items[] = array('data' => l($text, $path, $options), 'id' => 'all_app_list_' . $key);
}
$attributes = array('id' => 'all-app-list');
$links_html = theme_item_list(array('items' => $items, 'type' => 'ul', 'title' => '', 'attributes' => $attributes));
$variables['all_applications_record'] = $links_html;
$variables['theme_hook_suggestions'][] = 'node__teaser_all_app';
}
if ($variables['type'] == 'cluster_of_links' && $link_type == 'Quick Links' && ($variables['view_mode'] == 'teaser' || $variables['view_mode'] == 'full')) {
$variables['theme_hook_suggestions'][] = 'node__teaser_quick_links';
}
if ($variables['type'] == 'cxo_messages' && $variables['view_mode'] == 'full') {
$user = user_load($variables['user']->uid);
if ($user->picture) {
$variables['user_picture'] = theme_image_style(array('style_name' => 'cxo-message-user', 'path' => $user->picture->uri, 'attributes' => array('class' => 'avatar'), 'width' => "170", 'height' => "180"));
} else {
$variables['user_picture'] = theme_image_style(array('style_name' => 'cxo-message-user', 'path' => 'public://detail-user.png', 'attributes' => array('class' => 'avatar'), 'width' => "170", 'height' => "180"));
}
$variables['date'] = date("M j, Y", strtotime($variables['date']));
$variables['submitted'] = t('!username on !datetime', array('!username' => $variables['name'], '!datetime' => $variables['date']));
}
//Applying cxo style to user image on award detail page for consistency.
if ($variables['type'] == 'award' && $variables['view_mode'] == 'full') {
if ($variables['field_user_identity'][0]['entity']->picture) {
$variables['user_picture'] = theme_image_style(array('style_name' => 'cxo-message-user', 'path' => $variables['field_user_identity'][0]['entity']->picture->uri, 'attributes' => array('class' => 'avatar'), 'width' => "170", 'height' => "180"));
} else {
$variables['user_picture'] = theme_image_style(array('style_name' => 'cxo-message-user', 'path' => 'public://detail-user.png', 'attributes' => array('class' => 'avatar'), 'width' => "170", 'height' => "180"));
}
}
if ($variables['type'] == 'units' && $variables['view_mode'] == 'full') {
$variables['theme_hook_suggestions'][] = 'node__units';
}
}
示例10: viewAllNotifications
function viewAllNotifications()
{
global $user;
$UID = $user->uid;
// create page header, table, and dismiss all notifications button
$timezone = $user->timezone;
$notifications = dbGetNotificationsForUser($user->uid);
$markup = '<table><tr><td style="text-align:left"><h1><b>View All Notifications</b></h1></td>';
$markup .= '<td style="text-align:right"><a href="?q=dismissAllNotifications"><button>';
$markup .= 'Dismiss All</button></a></td></tr></table>';
// if user has no notifications
if (empty($notifications)) {
$markup .= '<table class="infoTable"><th></th><tr><td style="text-align:center" colspan="10"><em>No New Notifications!</em></td></tr></table>';
$_SESSION['notificationNIDsShown'] = array();
} else {
// if user has notifications
$markup .= '<table class="infoTable"><tr><th>Associated Picture</th><th>Notification Content</th><th></th></tr>';
foreach ($notifications as $notification) {
// used to prevent lack of page refresh issues
$_SESSION['notificationNIDsShown'][] = $notification['NID'];
$rawDate = $notification['dateTargeted'];
$rawDate = dbDateSQL2PHP($rawDate);
$date = date(TIME_FORMAT, $rawDate);
$markup .= "<tr><td>";
// generates picture for notification
if (!empty($notification['FID'])) {
$FID = $notification['FID'];
$file = file_load($FID);
$uri = $file->uri;
$variables = array('style_name' => 'all_notifications', 'path' => $uri, 'width' => '150', 'height' => '150');
$image = theme_image_style($variables);
$markup .= $image;
}
$markup .= '</td><td style="width:50% . "text-align:center">';
$markup .= '<br><b>' . $date . "</b><br>";
$markup .= '<i>' . $notification['message'] . "</i><br><br></td>";
$markup .= '<td>';
// buttons for viewing or dismissing a notification
if ($notification['bttnLink'] != null && $notification['bttnTitle'] != null) {
$markup .= "<a href=\"{$notification['bttnLink']}\">";
$markup .= '<button type="button">' . $notification['bttnTitle'] . '</button>';
}
$markup .= '<a href="?q=dismissNotification/' . $notification['NID'] . '&allnote">';
$markup .= '<button type="button"><img class="trashIcon" src="/images/icons/trashWhite.png"></button></a>' . ' ' . ' ';
$markup .= '</td></tr>';
}
$markup .= '</td></tr></table>';
}
$retArray = array();
$retArray['#markup'] = $markup;
return $retArray;
}
示例11: theme_image_style
<div class="o-media authorname">
<?php
if ($author->picture) {
?>
<div class="o-media_left">
<?php
echo theme_image_style(array('style_name' => 'thumbnail', 'height' => '100', 'width' => '100', 'path' => $author->picture->uri, 'alt' => $author->name, 'attributes' => array('class' => 'circle')));
?>
</div>
<?php
}
?>
<div class="o-media_body">
<?php
if ($author && $author->name != '') {
?>
<h4 class="c-title c-title-small">
<small>Written by</small><span itemprop="author" itemscope="" itemtype="http://schema.org/Person">
<span itemprop="name">
<?php
echo $author->name;
?>
</span>
</span>
<time class="<?php
echo $dateClass;
?>
" itemprop="datePublished">
<span class="c-date_day"><?php
echo date('j', $date);
?>
示例12: footmali_output_image
/**
* @param $style
* @param $imageEntity
* @return string
*/
function footmali_output_image($style, $imageEntity)
{
$variable = array('style_name' => $style, 'path' => $imageEntity[LANGUAGE_NONE][0]['uri'], 'width' => $imageEntity[LANGUAGE_NONE][0]['width'], 'height' => $imageEntity[LANGUAGE_NONE][0]['height']);
return theme_image_style($variable);
}
示例13: taxonomy_term_load
?>
<?php
global $theme_path;
$position = taxonomy_term_load($field_position[0]['tid']);
$height = '';
if (!empty($field_height[0]['value'])) {
$formatted_number = number_format($field_height[0]['value'], 2);
$height = explode('.', $formatted_number);
$height = $height[0] . 'm ' . $height[1];
}
$player_squad = footmali_get_player_squad($nid);
$default_player_profile = '/' . $theme_path . '/images/default_player_profile.png';
$player_profile = '<img src="' . $default_player_profile . '" width="300px" height="350px">';
if (count($field_image) > 0) {
$player_profile = theme_image_style(array('style_name' => 'player', 'path' => $field_image[0]['uri'], 'width' => '', 'height' => ''));
}
?>
<h1><?php
echo $title;
?>
</h1>
<div class="row">
<div id="player-image" class="col-md-6 col-sm-6 col-xs-12">
<?php
echo $player_profile;
?>
</div>
<div id="player-profile" class="col-md-6 col-sm-6 col-xs-12">
<div class="player-profile" style="width: 100%">
<h3><?php
示例14: theme_image_style
*
* @ingroup themeable
*/
?>
<li class="<?php
print $classes;
?>
"<?php
print $attributes;
?>
>
<?php
if ($node->type == "product") {
?>
<span class="search-image"><?php
print theme_image_style(array('path' => $node->field_blog_thumbnail['und']['0']['uri'], 'style_name' => 'thumbnail'));
?>
</span>
<?php
}
if (isset($content) && isset($content['field_products:product:field_normal_price'])) {
print $content['field_products:product:field_normal_price'][0]['#markup'];
}
?>
<?php
print render($title_prefix);
?>
<h3 class="title"<?php
print $title_attributes;
?>
>
示例15: theme_image_style
<?php
if (isset($node->field_image_header['und'][0]['uri'])) {
?>
<div id="content_header">
<div id="image_header"><?php
print theme_image_style(array('style_name' => 'image_header', 'path' => $node->field_image_header['und'][0]['uri'], 'width' => NULL, 'height' => NULL, 'alt' => $node->field_image_header['und'][0]['alt'], 'title' => $node->field_image_header['und'][0]['title'], 'attributes' => array('class' => 'img-responsive')));
?>
</div>
<div id="title_header"><?php
print $node->title;
?>
</div>
</div>
<?php
} else {
?>
<div class="title_blue_one"><?php
print $node->title;
?>
</div>
<?php
}