[ Index ]

PHP Cross Reference of GlotPress

title

Body

[close]

/gp-templates/ -> profile-public.php (source)

   1  <?php
   2  gp_title( __( 'Profile &lt; GlotPress', 'glotpress' ) );
   3  gp_breadcrumb( array( __( 'Profile', 'glotpress' ) ) );
   4  
   5  gp_tmpl_header();
   6  ?>
   7  
   8  <h2><?php echo esc_html( $user->display_name ); ?></h2>
   9  
  10  <div>
  11      <div class="user-card">
  12          <div class="user-avatar"><?php echo get_avatar( $user->user_email, 100 ); ?></div>
  13  
  14          <dl class="user-info">
  15              <dd>
  16                  <?php
  17                  $locale_keys       = array_keys( $locales );
  18                  $locale_keys_count = count( $locale_keys );
  19  
  20                  if ( 1 === $locale_keys_count ) {
  21                      printf(
  22                          /* translators: 1: display name of a user, 2: language */
  23                          __( '%1$s is a polyglot who contributes to %2$s.', 'glotpress' ),
  24                          esc_html( $user->display_name ),
  25                          esc_html( $locale_keys[0] )
  26                      );
  27                  } elseif ( 2 === $locale_keys_count ) {
  28                      printf(
  29                          /* translators: 1: display name of a user, 2: language, 3: language */
  30                          __( '%1$s is a polyglot who knows %2$s but also knows %3$s.', 'glotpress' ),
  31                          esc_html( $user->display_name ),
  32                          esc_html( $locale_keys[0] ),
  33                          esc_html( $locale_keys[1] )
  34                      );
  35                  } elseif ( $locale_keys_count > 2 ) {
  36                      printf(
  37                          /* translators: 1: display name of a user, 2: list of languages */
  38                          __( '%1$s is a polyglot who knows %2$s.', 'glotpress' ),
  39                          esc_html( $user->display_name ),
  40                          esc_html( wp_sprintf( '%l', $locale_keys ) )
  41                      );
  42                  }
  43                  ?>
  44              </dd>
  45              <dt><?php _e( 'Member Since', 'glotpress' ); ?></dt>
  46              <dd>
  47                  <?php
  48                      /* translators: public profile date format, see https://secure.php.net/date */
  49                      echo date_i18n( __( 'M j, Y', 'glotpress' ), strtotime( $user->user_registered ) );
  50                  ?>
  51              </dd>
  52          </dl>
  53      </div>
  54  </div>
  55  
  56  <div id="profile">
  57      <div class="recent-projects">
  58          <h3><?php _e( 'Recent Projects', 'glotpress' ); ?></h3>
  59  
  60          <ul>
  61          <?php foreach ( $recent_projects as $project ) : ?>
  62              <li>
  63                  <p>
  64                      <?php
  65                      echo gp_link_get( $project->project_url, $project->set_name ) . ': ';
  66                      echo gp_link_get(
  67                          $project->project_url . '?filters[status]=either&filters[user_login]=' . $user->user_login,
  68                          sprintf(
  69                              /* translators: %s: Count number. */
  70                              _n( '%s contribution', '%s contributions', $project->count, 'glotpress' ),
  71                              $project->count
  72                          )
  73                      );
  74                      ?>
  75                  </p>
  76                  <p class="ago">
  77                      <?php
  78                      printf(
  79                          /* translators: %s: Time since last update. */
  80                          __( 'last translation about %s ago (UTC)', 'glotpress' ),
  81                          human_time_diff( gp_gmt_strtotime( $project->last_updated ) )
  82                      );
  83                      ?>
  84                  </p>
  85              </li>
  86          <?php endforeach; ?>
  87          </ul>
  88      </div>
  89      <div class="validates-projects">
  90          <h3><?php _e( 'Validator to', 'glotpress' ); ?></h3>
  91  
  92          <?php if ( count( $permissions ) >= 1 ) : ?>
  93              <ul>
  94                  <?php foreach ( $permissions as $permission ) : ?>
  95                  <li>
  96                      <p> <?php echo gp_link_get( $permission->project_url, $permission->set_name ); ?> </p>
  97                  </li>
  98                  <?php endforeach; ?>
  99              </ul>
 100          <?php else : ?>
 101              <p>
 102                  <?php
 103                  printf(
 104                      /* translators: %s: User name. */
 105                      __( '%s is not validating any projects!', 'glotpress' ),
 106                      esc_html( $user->display_name )
 107                  );
 108                  ?>
 109              </p>
 110          <?php endif ?>
 111      </div>
 112  </div>
 113  
 114  <?php
 115  gp_tmpl_footer();


Generated: Sat Nov 23 01:01:06 2024 Cross-referenced by PHPXref 0.7.1