function gitp_preprocess_node__blog(&$variables) { $author_uid = $variables['uid']; $author = profile2_load_by_user($author_uid); $variables['author_thumbnail_profile'] = entity_view('profile2', $author, 'thumbnail_profile'); $variables['author_profile'] = entity_view('profile2', $author, 'author_profile'); }
function nesi_bootstrap_menu_tree__user_menu($variables) { global $base_url; global $user; $user_data = user_load($user->uid); $profile_data = profile2_load_by_user($user_data->uid); $admin_links = ''; if (user_access('nesi website config')) { $admin_links .= '<li><a href="' . $base_url . '/nesi-config">Administration Dashboard</a></li>'; } $output = ''; $output .= '<ul id="nesi-user-profile-dropdown" class="dropdown-menu pull-right">'; $output .= '<li id="nesi-user-picture"><div class="nesi-user-picture"><div class="pull-left">' . theme('user_picture', array('account' => $user)) . '</div> <h2>' . format_username($user_data) . '</h2> <h3>Institution</h3> <p>' . $profile_data['researcher_profile']->field_user_institution[LANGUAGE_NONE][0]['value'] . '</p> <p><em>Member for ' . format_interval(REQUEST_TIME - $user_data->created) . '</em></p> </div></li>'; $output .= $admin_links; $output .= $variables['tree']; $output .= '<li id="nesi-base-actions"><ul class="nav nav-pills nesi-base-actions"><li class="pull-left"><a href="' . $base_url . '/user">Profile</a></li><li class="pull-right"><a href="/user/logout">Log out</a></li></ul></li>'; $output .= '</ul>'; return $output; }
* Where the html is handled for the group. * @see user-profile-item.tpl.php * Where the html is handled for each item in the group. * @see template_preprocess_user_profile() * * @ingroup themeable */ //print l('Submit a proposal', 'apply/nojs/create-proposal', array('attributes' => array('id' => 'submit-proposal', 'class' => 'btn'))); ?> <div class="profile"<?php print $attributes; ?> > <?php $account = menu_get_object('user'); $r_profile = profile2_load_by_user($account->uid); ?> <div class="module-wrapper module-wrapper-first"> <h2>Account information</h2> <div class="module module-account"> <div class="account-photo"><?php print render($user_profile['user_picture']); ?> </div> <div class="account-name"><?php print format_username($account); ?> </div> <div class="account-mail"><?php print $account->mail; ?>
function devis_page_alter(&$page) { global $user; $path = current_path(); $args = arg(); // If admin viewing user pages, set a message to make him understand. if (in_array('manager', $user->roles) && isset($args[0]) && $args[0] == 'user' && isset($args[1]) && $args[1] != $user->uid) { drupal_set_message(t('Viewing as admin'), 'admin'); } if (in_array('provider', $user->roles)) { $billing_id = commerce_addressbook_get_default_profile_id($user->uid, 'billing'); $link = 'user/' . $user->uid . '/addressbook/billing/delete/' . $billing_id; if (isset($args[5]) && $args[5] == $billing_id && $path == $link) { watchdog('devis', t('Malicious user trying to delete address. User has been redirected.'), array(), WATCHDOG_ALERT, $link); drupal_goto('user/' . $user->uid . '/addressbook/billing/edit/' . $billing_id); } } // Delete message after setting password which gives the user the same message again. // Set the first step message on the account edit. if (strpos($_SERVER['QUERY_STRING'], 'pass-reset-token') === false) { // First stage message. if (in_array('provider', $user->roles)) { if ($path == 'user/' . $user->uid . '/edit-profile' || $path == 'user/' . $user->uid) { $messages = drupal_get_messages('status'); if (isset($messages['status'])) { foreach ($messages['status'] as $msg) { if (strpos($msg, "Vous venez d'utiliser votre lien de connexion unique.") === false) { drupal_set_message($msg, 'status'); } } } } $profile = profile2_load_by_user($user); if (!$profile && $path == 'user/' . $user->uid . '/edit-profile') { drupal_set_message(t(variable_get('trois_devis_first_step_message')), 'warning'); } } } }
<?php $uid = user_load($node->uid); if (module_exists('profile2')) { $profile = profile2_load_by_user($uid, 'main'); } global $parent_root; ?> <?php if ($teaser) { ?> <article id="node-<?php print $node->nid; ?> " class="gallery-teaser-display block-gallery <?php print $classes; ?> post post-medium-image"<?php print $attributes; ?> > <div class="post-block"> <div class="post-image post-gallery"> <?php if (render($content['field_gallery_thumbnail'])) { ?> <?php print render($content['field_gallery_thumbnail']); ?> <?php
function ecogig_neat_views_pre_render(&$view) { $display_name = ''; global $user; if ($view->name == 'my_references') { $uid = arg(2); if (!empty($uid)) { $profile = profile2_load_by_user($uid, 'main'); if (!empty($profile)) { $first_name = ''; $last_name = ''; if (!empty($profile->field_first_name['und'])) { $first_name = $profile->field_first_name['und'][0]['value']; } if (!empty($profile->field_last_name['und'])) { $last_name = $profile->field_last_name['und'][0]['value']; } if (!empty($first_name) && !empty($last_name) && $user->uid != $uid) { $display_name = $first_name . ' ' . $last_name . "'s "; } } } if (!empty($display_name)) { $current_title = !empty($view->build_info['title']) ? $view->build_info['title'] : ''; $title = str_replace('My', $display_name, $current_title); $view->build_info['title'] = $title; } } if ($view->name == 'dataset_progress_report') { drupal_add_js(drupal_get_path('theme', 'ecogig_neat') . '/js/moment.min.js', 'file'); } }
?> </span></div> </div> <?php if ($display_submitted) { ?> <div class="submitted-info-wrapper"> <?php // get author first and last name $author = user_load_by_name($node->name); $author_name = format_username($author); // get author city $r_profile = profile2_load_by_user($author->uid); $field_user_city_key = $r_profile['researcher_profile']->field_user_city[LANGUAGE_NONE][0]['value']; $field_user_city_object = field_info_field('field_user_city'); $author_city = $field_user_city_object['settings']['allowed_values'][$field_user_city_key]; ?> <div class="author-picture"><?php print theme('image_style', array('style_name' => 'blog-author-thumbnail', 'path' => $author->picture->uri)); ?> </div> <div class="sub-info-wrapper"> <p class="author-info"><span class="name"><?php print $author_name; ?>
?> </td> </tr> <?php //</div> ?> <?php } ?> </tbody> </table> </div> <!-- end team-members --> <?php } else { ?> <p><?php foreach ($items as $delta => $item) { $team_member_profile = profile2_load_by_user($item['#options']['entity']->uid); if (!empty($team_member_profile['researcher_profile'])) { $name = $team_member_profile['researcher_profile']->field_user_firstname[LANGUAGE_NONE][0]['value'] . ' ' . $team_member_profile['researcher_profile']->field_user_lastname[LANGUAGE_NONE][0]['value']; print $name . '<br />'; } //print $item['#title'].'<br />'; } ?> </p><?php } ?> </div> </div>