?> "><?php echo ___('Change my avatar'); ?> </legend> <!-- current avatar --> <div class="form-group"> <div class="control-label g-tablet-1-6"> <?php echo ___('Current avatar'); ?> </div> <div class="g-tablet-5-6"> <div class="current-avatar"> <?php echo theme_cache::get_avatar($current_user->ID, 100); ?> </div> </div> </div> <!-- new avatar --> <div class="form-group"> <div class="control-label g-tablet-1-6"> <?php echo ___('New avatar'); ?> </div> <div class="g-tablet-5-6"> <div class="row"> <div class="g-tablet-1-2"> <div id="cropper-container"></div>
/** * recent_comments_4_my_posts */ public static function recent_comments_4_my_posts() { ?> <!-- Recent comments for my posts --> <div class="dashboard-recent-comments-4-my-posts panel"> <div class="heading"> <i class="fa fa-comments"></i> <?php echo ___('Recent comments for my posts'); ?> </div> <?php /** * get comments */ $current_user_id = theme_cache::get_current_user_id(); $comments = get_comments(['post_author' => $current_user_id, 'author__not_in' => [$current_user_id], 'number' => 5, 'status' => '1']); if (empty($comments)) { ?> <div class="content"> <?php echo status_tip('info', ___('No comment for your post yet')); ?> </div> <?php } else { ?> <ul class="list-group"> <?php global $comment; foreach ($comments as $comment) { ?> <li class="list-group-item"> <div class="media"> <div class="media-left media-top"> <?php $comment_author_url = get_comment_author_url(); if ($comment_author_url) { ?> <a href="<?php echo esc_url($comment_author_url); ?> " <?php echo (int) $comment->user_id === 0 ? 'target="_blank"' : null; ?> > <?php echo theme_cache::get_avatar($comment, 50); ?> </a> <?php } else { echo theme_cache::get_avatar($comment, 50); } ?> </div> <div class="media-body"> <h4 class="media-heading"> <?php echo sprintf(___('%s commented your post "%s".'), '<span class="author">' . get_comment_author_link() . '</span>', '<a href="' . theme_cache::get_permalink($comment->comment_post_ID) . '">' . theme_cache::get_the_title($comment->comment_post_ID) . '</a>'); ?> </h4> <p class="excerpt-tx"> <?php comment_excerpt(); ?> </p> </div><!-- /.media-body --> </div><!-- /.media --> </li> <?php } ?> </ul> <?php } /** end have comment */ ?> </div> <?php }
function widget($args, $instance) { global $post; $author_id = $post->post_author; echo $args['before_widget']; /** * author profile page url */ if (class_exists('theme_custom_author_profile')) { $author_url = theme_custom_author_profile::get_tabs('profile', $author_id)['url']; } else { $author_url = theme_cache::get_author_posts_url($author_id); } $description = theme_cache::get_the_author_meta('description', $author_id); ?> <div id="widget-author-card" class="widget-container content"> <a href="<?php echo $author_url; ?> " class="author-link" title="<?php echo ___('Views the author information detail'); ?> "> <?php echo theme_cache::get_avatar($author_id, 100); ?> <h3 class="author-card-name"> <?php echo theme_cache::get_the_author_meta('display_name', $author_id); ?> </h3> <?php if (class_exists('theme_custom_author_profile')) { ?> <small class="label label-<?php echo theme_custom_author_profile::get_roles($author_id)['label']; ?> "><?php echo theme_custom_author_profile::get_roles($author_id)['name']; ?> </small> <?php } ?> </a><!-- ./author-link --> <p class="author-card-description" title="<?php echo $description; ?> " > <?php if (empty($description)) { echo ___('The author is lazy, nothing writes here.'); } else { echo $description; } ?> </p> <?php if (class_exists('theme_custom_author_profile')) { ?> <div class="author-card-meta-links"> <!-- works count --> <a class="tooltip" href="<?php echo theme_custom_author_profile::get_tabs('works', $author_id)['url']; ?> " title="<?php echo ___('Views author posts'); ?> " target="_blank"> <span class="tx"><i class="fa fa-fw fa-<?php echo theme_custom_author_profile::get_tabs('works', $author_id)['icon']; ?> "></i></span> <span class="count"><?php echo (int) theme_custom_author_profile::get_tabs('works', $author_id)['count']; ?> </span> </a> <!-- comments count --> <a class="tooltip" href="<?php echo theme_custom_author_profile::get_tabs('comments', $author_id)['url']; ?> " title="<?php echo ___('Views author comments'); ?> " target="_blank"> <span class="tx"><i class="fa fa-fw fa-<?php echo theme_custom_author_profile::get_tabs('comments', $author_id)['icon']; ?> "></i></span> <span class="count"><?php echo (int) theme_custom_author_profile::get_tabs('comments', $author_id)['count']; ?> </span> </a> <!-- point --> <?php if (class_exists('theme_custom_point_bomb')) { if (class_exists('number_user_nicename')) { $target_id = number_user_nicename::$prefix_number + $author_id; } else { $target_id = $author_id; } ?> <!-- followers count --> <a class="tooltip" href="<?php echo theme_custom_point_bomb::get_tabs('bomb', $target_id)['url']; ?> " rel="nofollow" title="<?php echo ___('Bomb!'); ?> " target="_blank"> <span class="tx"><i class="fa fa-fw fa-bomb"></i></span> <span class="count"><?php echo theme_custom_point::get_point($author_id); ?> </span> </a> <?php } ?> <!-- pm --> <?php if (class_exists('theme_custom_pm')) { ?> <a target="_blank" class="tooltip" href="<?php echo theme_custom_pm::get_user_pm_url($author_id); ?> " title="<?php echo ___('Send a private message.'); ?> "> <span class="tx"><i class="fa fa-<?php echo theme_custom_pm::get_tabs('pm')['icon']; ?> "></i></span><span class="count"><?php echo __x('P.M.', 'Widget author card PM.'); ?> </span> </a> <?php } ?> </div> <?php } ?> </div> <?php echo $args['after_widget']; }
public static function theme_comment($comment, $args, $depth) { global $post; $GLOBALS['comment'] = $comment; switch ($comment->comment_type) { default: $classes = ['media']; if (!empty($args['has_children'])) { $classes[] = 'parent'; } if ($comment->comment_approved == '0') { $classes[] = 'moderation'; } /** * post author checker */ if ($comment->user_id == $post->post_author) { $is_post_author = true; $classes[] = 'is-post-author'; } else { $is_post_author = false; } /** * check is my comment */ if ($comment->user_id != 0) { if (theme_cache::get_current_user_id() == $comment->user_id) { $classes[] = 'is-me'; } } /** * author url */ $author_url = get_comment_author_url(); if (!empty($author_url) && stripos($author_url, theme_cache::home_url()) === false) { $author_nofollow = ' rel="external nofollow" '; } else { $author_nofollow = null; } ?> <li <?php comment_class($classes); ?> id="comment-<?php echo $comment->comment_ID; ?> "> <div id="comment-body-<?php echo $comment->comment_ID; ?> " class="comment-body"> <?php if ($comment->comment_parent == 0) { ?> <div class="media-left"> <?php if ($author_url) { ?> <a href="<?php echo esc_url($author_url); ?> " class="avatar-link" target="_blank" <?php echo $author_nofollow; ?> > <?php echo theme_cache::get_avatar($comment, 50); ?> </a> <?php } else { echo theme_cache::get_avatar($comment, 50); } ?> </div><!-- /.media-left --> <?php } ?> <div class="media-body"> <div class="comment-content"> <?php comment_text(); ?> <?php if ($comment->comment_approved == '0') { ?> <div class="comment-awaiting-moderation"><?php echo status_tip('info', ___('Your comment is awaiting moderation.')); ?> </div> <?php } ?> </div> <h4 class="media-heading"> <span class="comment-meta-data author"> <?php if ($comment->comment_parent != 0) { echo theme_cache::get_avatar($comment, 50), ' '; } comment_author_link(); ?> </span> <time class="comment-meta-data time" datetime="<?php echo get_comment_time('c'); ?> "> <a href="<?php echo esc_url(get_comment_link($comment->comment_ID)); ?> "><?php echo friendly_date(get_comment_time('U')); ?> </a> </time> <?php if (!theme_cache::is_user_logged_in()) { /** * if needs register to comment */ if (theme_cache::get_option('comment_registration')) { static $reply_link; if (!$reply_link) { $reply_link = '<a rel="nofollow" class="comment-reply-login quick-login-btn" href="' . wp_login_url(theme_cache::get_permalink($comment->comment_post_ID)) . '">' . ___('Reply') . '</a>'; } } else { $reply_link = get_comment_reply_link(['add_below' => 'comment-body', 'depth' => $depth, 'max_depth' => $args['max_depth']], $comment, $post->ID); } } else { $reply_link = get_comment_reply_link(['add_below' => 'comment-body', 'depth' => $depth, 'max_depth' => $args['max_depth']], $comment, $post->ID); } $reply_link = preg_replace('/(href=)[^\\s]+/', '$1"javascript:;"', $reply_link); if (!empty($reply_link)) { ?> <span class="comment-meta-data comment-reply reply"> <?php echo $reply_link; ?> </span><!-- .reply --> <?php } ?> </h4> </div><!-- /.media-body --> </div><!-- /.comment-body --> <?php } }
<?php get_header(); global $author; $tab_active = get_query_var('tab'); $tabs = theme_custom_author_profile::get_tabs(null, $author); if (empty($tab_active) || !isset($tabs[$tab_active])) { $tab_active = 'profile'; } ?> <div class="g"> <h3 class="crumb-title"> <?php echo theme_cache::get_avatar($author); ?> <?php echo theme_cache::get_the_author_meta('display_name', $author); ?> - <small><?php echo $tabs[$tab_active]['text']; ?> </small> </h3> <nav class="nav"> <?php foreach ($tabs as $k => $v) { $class_active = $tab_active === $k ? ' active ' : null; ?> <a class="<?php echo $class_active; ?>