</tr> <?php } ?> <!-- pm --> <?php if (class_exists('theme_custom_pm')) { ?> <tr> <th><?php echo ___('P.M.'); ?> </th> <td> <a href="<?php echo theme_custom_pm::get_user_pm_url($author); ?> "> <i class="fa fa-envelope"></i> <?php echo ___('Send P.M.'); ?> </a> </td> </tr> <?php } ?> </tbody> </table> </fieldset> </div>
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']; }
} ?> <!-- pm --> <?php if (class_exists('theme_custom_pm') && !theme_custom_pm::is_page() && theme_custom_pm::get_unread_count(theme_cache::get_current_user_id()) > 0) { ?> <a href="<?php echo theme_custom_pm::get_tabs('pm')['url']; ?> " class="tool tool-pm" title="<?php echo ___('You have new P.M.'); ?> "> <i class="fa fa-<?php echo theme_custom_pm::get_tabs('pm')['icon']; ?> fa-fw fa-spin"></i> </a> <?php } ?> <?php } /** end if mobile */ ?> <?php } else { ?> <a class="tool-login tool mx-account-btn" href="<?php echo esc_url(wp_login_url(get_current_url()));
public static function the_dialogs() { $current_user_id = theme_cache::get_current_user_id(); $pm_lists = self::get_lists($current_user_id); $history_users = theme_custom_pm::get_histories($current_user_id); $dialog_histories = []; if (empty($pm_lists)) { return false; } foreach ($pm_lists as $user_id) { if ($history_users && isset($history_users[$user_id])) { foreach ($history_users[$user_id] as $history) { if ($history->pm_author == $user_id || $history->pm_receiver == $user_id) { if (!isset($dialog_histories[$user_id])) { $dialog_histories[$user_id] = [$history->pm_id => $history]; } $dialog_histories[$user_id][$history->pm_id] = $history; } } } /** sort */ foreach ($pm_lists as $v) { if (isset($dialog_histories[$v])) { ksort($dialog_histories[$v]); } } } foreach ($pm_lists as $user_id) { ?> <form action="javascript:;" id="pm-dialog-<?php echo self::get_niceid($user_id); ?> " class="pm-dialog"> <div class="form-group pm-dialog-list"> <?php if (isset($history_users[$user_id])) { foreach ($dialog_histories[$user_id] as $history) { $name = $current_user_id == $history->pm_author ? ___('Me') : theme_cache::get_the_author_meta('display_name', $user_id); ?> <section class="pm-dialog-<?php echo $current_user_id == $history->pm_author ? 'me' : 'sender'; ?> "> <div class="pm-dialog-bg"> <h4> <span class="name"><a href="<?php echo theme_cache::get_author_posts_url($history->pm_author); ?> " target="_blank"><?php echo $name; ?> </a></span> <span class="date"><?php echo date('Y/m/d H:i:s', strtotime($history->pm_date)); ?> </span> </h4> <div class="media-content"> <?php echo $history->pm_content; ?> </div> </div> </section> <?php } /** end dialog loop */ } /** end if histories */ ?> </div> <div class="form-group"> <input type="text" id="pm-dialog-content-<?php echo self::get_niceid($user_id); ?> " name="content" class="pm-dialog-conteng form-control" placeholder="<?php echo ___('Enter to send P.M.'); ?> " required title="<?php echo ___('P.M. content'); ?> " autocomplete="off"> </div> <div class="form-group"> <button class="btn btn-success btn-block" type="submit"><i class="fa fa-check"></i> <?php echo ___('Send P.M.'); ?> </button> </div> </form> <?php } }
<div class="pm-dialog-container"> <!-- pm-new --> <form action="javascript:;" id="pm-dialog-new" class="pm-dialog"> <p class="well"><?php echo ___('Add a receiver UID to send private message.'); ?> </p> <div class="form-group"> <input type="number" name="pm[new-receiver-id]" id="pm-dialog-content-new" class="form-control text-center" placeholder="<?php echo ___('Receiver UID, e.g. 105844'); ?> " title="<?php echo ___('Please type receiver UID'); ?> " required min="1"> </div> <div class="form-group"> <button type="submit" class="btn btn-success btn-block"><?php echo ___('Next step'); ?> <i class="fa fa-chevron-right"></i></button> </div> </form> <?php theme_custom_pm::the_dialogs(); ?> </div> </div><!-- col --> </div><!-- .row --> </div> </div>