function ra_name($handle) { if (qa_opt('show_real_name')) { return strlen(ra_user_profile($handle, 'name')) ? ra_user_profile($handle, 'name') : $handle; } else { return $handle; } }
function sc_ra_user_cover() { if (qw_hook_exist(__FUNCTION__)) { $args = func_get_args(); array_unshift($args, $this); return qw_event_hook(__FUNCTION__, $args, NULL); } if (defined('QA_WORDPRESS_INTEGRATE_PATH')) { require_once QA_INCLUDE_DIR . 'qa-app-posts.php'; $handle = qa_post_userid_to_handle($this->content['raw']['userid']); $userid = $this->content['raw']['userid']; } else { $handle = $this->content['raw']['account']['handle']; $userid = $this->content['raw']['account']['userid']; } $user = ra_user_data($handle); $profile = ra_user_profile($handle); ob_start(); ?> <div class="user-top clearfix"> <?php if (qa_get_logged_in_userid() == $userid) { ?> <a id="upload-cover" class="btn btn-default"><?php ra_lang('Change cover'); ?> </a> <?php } ?> <div class="user-bar"> <div class="avatar pull-left"> <?php echo ra_get_avatar($handle, 150); ?> </div> </div> <div class="user-bar-holder"> <div class="user-stat pull-right"> <ul> <li class="points"><?php echo $user[0]['points']; ?> <span><?php ra_lang('Points'); ?> </span></li> <li class="followers"><?php ra_user_followers_count($handle, true); ?> <span><?php ra_lang('Followers'); ?> </span></li> </ul> </div> <div class="user-nag"> <div class="user-buttons pull-right"> <?php $this->favorite(); if (!defined('QA_WORDPRESS_INTEGRATE_PATH') && qa_opt('allow_private_messages') && qa_get_logged_in_userid() != $this->content['raw']['account']['userid'] && !($this->content['raw']['account']['flags'] & QA_USER_FLAGS_NO_MESSAGES)) { echo '<a class="btn btn-primary btn-sm icon-envelope-alt" href="' . qa_path_html('message/' . $handle) . '">' . _ra_lang('Send message') . '</a>'; } ?> </div> <h3 class="user-name"><?php echo ra_name($handle); ?> </h3> </div> </div> </div> <?php $this->output(ob_get_clean()); }