Example #1
0
<span data-sign="1" id="user-reg" class="user-reg ie_pie"><?php 
        _e('注册', 'xiapistudio');
        ?>
</span><?php 
    }
    ?>
		</div>
<?php 
} else {
    global $current_user;
    get_currentuserinfo();
    ?>
			<div class="login-yet-click">
				<div class="login-yet-click-inner">
					<?php 
    echo fun_get_avatar($current_user->ID, '35', fun_get_avatar_type($current_user->ID));
    ?>
					<a href="<?php 
    bloginfo('url');
    ?>
/wp-admin/profile.php" title="<?php 
    _e('用户管理', 'xiapistudio');
    ?>
"><?php 
    echo $current_user->display_name;
    ?>
</a>
					<?php 
    $unread = intval(fun_get_message($current_user->ID, 'count', "msg_type='unread' OR msg_type='unrepm'"));
    if ($unread > 0) {
        ?>
Example #2
0
function fun_comment_quote($comment, $args, $depth)
{
    $GLOBALS['comment'] = $comment;
    global $commentcount_quote, $wpdb, $post;
    if (!$commentcount_quote) {
        $cnt = $wpdb->get_var("SELECT COUNT(comment_ID) FROM {$wpdb->comments} WHERE comment_post_ID = {$post->ID} AND (comment_type = 'trackback' OR comment_type = 'pingback') AND comment_approved = '1' AND !comment_parent");
        $page = get_query_var('cpage');
        $cpp = get_option('comments_per_page');
        if (ceil($cnt / $cpp) == 1 || $page > 1 && $page == ceil($cnt / $cpp)) {
            $commentcount_quote = $cnt + 1;
        } else {
            $commentcount_quote = $cpp * $page + 1;
        }
    }
    ?>
<li <?php 
    comment_class();
    ?>
 id="comment-<?php 
    comment_ID();
    ?>
">
   <div id="div-comment-<?php 
    comment_ID();
    ?>
" class="comment-body">
      <?php 
    $add_below = 'div-comment';
    ?>
		<div class="comment-author"><?php 
    $uid = get_user_by_email($comment->comment_author_email)->ID;
    echo fun_get_avatar($uid, 40, fun_get_avatar_type($uid));
    ?>
<div style="float:right">
	<span class="datetime">
 		<?php 
    comment_date('Y-m-d');
    comment_time();
    ?>
 	</span>
 </div>
 <span class="comment_author_link"><?php 
    if ($comment->user_id != 0) {
        echo '<a href="' . get_author_posts_url($comment->user_id) . '" class="name">' . $comment->comment_author . '</a>';
    } else {
        comment_author_link();
    }
    ?>
</span><span class="comment_author_ip"><?php 
    _e('[ 来自 ', 'tinection');
    ?>
<span><?php 
    echo convertip(get_comment_author_ip());
    ?>
</span>&nbsp;]
</span>
 </div>
		<?php 
    if ($comment->comment_approved == '0') {
        ?>
			<span style="color:#C00; font-style:inherit; margin-top:5px; line-height:25px;"><?php 
        $cpid = $comment->comment_parent;
        if ($cpid != 0) {
            echo '@';
        }
        comment_author_link($cpid);
        _e('您的评论正在等待审核中...', 'tinection');
        ?>
</span>
			<br />			
		<?php 
    }
    ?>
		<?php 
    if ($comment->comment_approved == '1') {
        ?>
		<?php 
        comment_text();
        ?>
		<?php 
    }
    ?>
        </div>
		<div class="clear"></div>
  
<?php 
}
Example #3
0
function fun_user_profile_widget()
{
    if (is_user_logged_in()) {
        $current_user = wp_get_current_user();
        $li_output = '';
        $li_output .= '<li style="line-height:36px;clear: both;">' . fun_get_avatar($current_user->ID, '36', fun_get_avatar_type($current_user->ID), false) . sprintf(__('登录者 <a href="%1$s">%2$s</a>', 'tinection'), get_edit_profile_url($current_user->ID), $current_user->display_name) . '<a href="' . wp_logout_url(fun_get_current_page_url()) . '" title="' . esc_attr__('登出本帐号') . '">' . __('登出 &raquo;') . '</a></li>';
        if (!filter_var($current_user->user_email, FILTER_VALIDATE_EMAIL)) {
            $li_output .= '<li><a href="' . fun_get_user_url('profile') . '#pass">' . __('【重要】请添加正确的邮箱以保证账户安全', 'tinection') . '</a></li>';
        }
        $shorcut_links[] = array('title' => __('个人主页', 'tinection'), 'url' => get_author_posts_url($current_user->ID));
        if (current_user_can('manage_options')) {
            $shorcut_links[] = array('title' => __('管理后台', 'tinection'), 'url' => admin_url());
        }
        $can_post_cat = ot_get_option('fun_can_post_cat');
        if (count($can_post_cat)) {
            $shorcut_links[] = array('title' => __('文章投稿', 'tinection'), 'url' => add_query_arg('action', 'new', fun_get_user_url('post')));
        }
        $shorcut_html = '<li class="active">';
        foreach ($shorcut_links as $shorcut) {
            $shorcut_html .= '<a href="' . $shorcut['url'] . '">' . $shorcut['title'] . ' &raquo;</a>';
        }
        $shorcut_html .= '</li>';
        $credit = intval(get_user_meta($current_user->ID, 'fun_credit', true));
        $credit_void = intval(get_user_meta($current_user->ID, 'fun_credit_void', true));
        $unread_count = intval(get_fun_message($current_user->ID, 'count', "( msg_type='unread' OR msg_type='unrepm' )"));
        $collects = get_user_meta($current_user->ID, 'fun_collect', true) ? get_user_meta($current_user->ID, 'fun_collect', true) : 0;
        $collects_array = explode(',', $collects);
        $collects_count = $collects != 0 ? count($collects_array) : 0;
        $info_array = array(array('title' => __('文章', 'tinection'), 'url' => fun_get_user_url('post'), 'count' => count_user_posts($current_user->ID)), array('title' => __('评论', 'tinection'), 'url' => fun_get_user_url('comment'), 'count' => get_comments(array('status' => '1', 'user_id' => $current_user->ID, 'count' => true))), array('title' => __('收藏', 'tinection'), 'url' => fun_get_user_url('collect'), 'count' => intval($collects_count)));
        if ($unread_count) {
            $info_array[] = array('title' => __('未读', 'tinection'), 'url' => fun_get_user_url('message'), 'count' => $unread_count);
        }
        $info_array[] = array('title' => __('积分', 'tinection'), 'url' => fun_get_user_url('credit'), 'count' => $credit);
        $info_html = '<li>';
        foreach ($info_array as $info) {
            $info_html .= $info['title'] . '<a href="' . $info['url'] . '"> ' . $info['count'] . '</a>';
        }
        $info_html .= fun_whether_signed($current_user->ID);
        $info_html .= '</li>';
        $friend_html = '
	<li>
		<div class="input-group">
			<span class="input-group-addon">' . __('本页推广链接', 'tinection') . '</span>
			<input class="fun_aff_url form-control" type="text" class="form-control" value="' . add_query_arg('aff', $current_user->ID, fun_canonical_url()) . '">
		</div>
	</li>
	';
        return $li_output . $shorcut_html . $info_html . $friend_html;
    } else {
        $html = '<li><span class="local-account"><a data-sign="0" class="btn btn-primary user-login"><i class="fa fa-wordpress"></i>' . __('本地帐号', 'tinection') . '</a></span>';
        if (ot_get_option('fun_open_qq') == 'on') {
            $html .= '<span class="other-sign"><a class="qqlogin btn" href="' . home_url('/?connect=qq&action=login&redirect=' . urlencode(fun_get_redirect_uri())) . '"><i class="fa fa-qq"></i><span>' . __('QQ 登 录', 'tinection') . '</span></a></span>';
        }
        if (ot_get_option('fun_open_weibo') == 'on') {
            $html .= '<span class="other-sign"><a class="weibologin btn" href="' . home_url('/?connect=weibo&action=login&redirect=' . urlencode(fun_get_redirect_uri())) . '"><i class="fa fa-weibo"></i><span>' . __('微博登录', 'tinection') . '</span></a></span>';
        }
        $html .= '</li>';
        return $html;
    }
}
/***************************************

	Theme Name: 	Change
	Theme URI: 		http://www.xiapistudio.com/change
	Description: 	Chage主题,WordPress多模板主题
	Version: 		1.0.1
	Author: 		虾皮工作室
	Author URI: 	http://www.xiapistudio.com/
	License:     	GPLv3
	
***************************************/
?>
<div class="sg-author clr">
	<div class="img"><?php 
echo fun_get_avatar(get_the_author_meta('ID'), '100', fun_get_avatar_type(get_the_author_meta('ID')));
?>
</div>
	<div class="sg-author-info">
		<div class="word">
			<div class="wordname"><?php 
_e('关于', 'xiapistudio');
the_author_posts_link();
?>
</div>
			<div class="authordes"><?php 
the_author_meta('description');
?>
</div>
			<div class="authorsocial">
			<?php 
function fun_open_profile_fields($user)
{
    $qq = fun_is_open_qq();
    $weibo = fun_is_open_weibo();
    $weixin = fun_is_open_weixin();
    if ($qq || $weibo || $weixin) {
        ?>
<table class="form-table">
	<?php 
        if ($qq) {
            ?>
	<tr>
		<th scope="row">QQ登录</th>
		<td>
	<?php 
            if (fun_is_open_qq($user->ID)) {
                ?>
		<p><?php 
                _e('已绑定', 'tinection');
                ?>
 <a href="<?php 
                echo home_url('/?connect=qq&action=logout');
                ?>
"><?php 
                _e('点击解绑', 'tinection');
                ?>
</a></p>
		<?php 
                echo fun_get_avatar($user->ID, '100', 'qq');
                ?>
	<?php 
            } else {
                ?>
		<a class="button button-primary" href="<?php 
                echo home_url('/?connect=qq&action=login');
                ?>
">绑定QQ账号</a>
	<?php 
            }
            ?>
		</td>
	</tr>
	<?php 
        }
        ?>
	<?php 
        if ($weibo) {
            ?>
	<tr>
		<th scope="row">微博登录</th>
		<td>
	<?php 
            if (fun_is_open_weibo($user->ID)) {
                ?>
		<p><?php 
                _e('已绑定', 'tinection');
                ?>
 <a href="<?php 
                echo home_url('/?connect=weibo&action=logout');
                ?>
"><?php 
                _e('点击解绑', 'tinection');
                ?>
</a></p>
		<?php 
                echo fun_get_avatar($user->ID, '100', 'weibo');
                ?>
	<?php 
            } else {
                ?>
		<a class="button button-primary" href="<?php 
                echo home_url('/?connect=weibo&action=login');
                ?>
">绑定微博账号</a>
	<?php 
            }
            ?>
		</td>
	</tr>
	<?php 
        }
        ?>
	<?php 
        if ($weixin) {
            ?>
	<tr>
		<th scope="row">微信登录</th>
		<td>
	<?php 
            if (fun_is_open_weixin($user->ID)) {
                ?>
		<p><?php 
                _e('已绑定', 'tinection');
                ?>
 <a href="<?php 
                echo home_url('/?connect=weixin&action=logout');
                ?>
"><?php 
                _e('点击解绑', 'tinection');
                ?>
</a></p>
		<?php 
                echo fun_get_avatar($user->ID, '100', 'weixin');
                ?>
	<?php 
            } else {
                ?>
		<a class="button button-primary" href="<?php 
                echo home_url('/?connect=weixino&action=login');
                ?>
">绑定微信账号</a>
	<?php 
            }
            ?>
		</td>
	</tr>
	<?php 
        }
        ?>
</table>
    <?php 
    }
}
Example #6
0
	<div class="author">
		<div id="real-avatar">
		<?php 
                if (isset($_COOKIE['comment_author_email_' . COOKIEHASH])) {
                    ?>
			<?php 
                    $uid = get_user_by_email($comment_author_email)->ID;
                    echo fun_get_avatar($uid, 40, fun_get_avatar_type($uid));
                    ?>
		<?php 
                } else {
                    ?>
			<?php 
                    global $user_email;
                    $uid = get_user_by_email($comment_author_email)->ID;
                    echo fun_get_avatar($uid, 40, fun_get_avatar_type($uid));
                    ?>
		<?php 
                }
                ?>
		</div>
		<div id="welcome"><?php 
                printf(__('欢迎回来 <strong style="color: #f00;">%s</strong>', 'xiapistudio'), $comment_author);
                ?>
		<a href="javascript:toggleCommentAuthorInfo();" id="toggle-comment-author-info"><?php 
                _e('更改', 'xiapistudio');
                ?>
</a></div>
	</div>
			<script type="text/javascript" charset="utf-8">
				var changeMsg = "<?php 
Example #7
0
			<div class="col-sm-9">
		<?php 
                if (fun_is_open_weibo($user_info->ID)) {
                    ?>
			<span class="help-block"><?php 
                    _e('已绑定', 'tin');
                    ?>
 <a href="<?php 
                    echo home_url('/?connect=weibo&action=logout');
                    ?>
"><?php 
                    _e('点击解绑', 'tin');
                    ?>
</a></span>
			<?php 
                    echo fun_get_avatar($user_info->ID, '100', 'weibo');
                    ?>
		<?php 
                } else {
                    ?>
			<a class="btn btn-danger" href="<?php 
                    echo home_url('/?connect=weibo&action=login&redirect=' . urlencode(get_edit_profile_url()));
                    ?>
"><?php 
                    _e('绑定微博账号', 'tin');
                    ?>
</a>
		<?php 
                }
                ?>
			</div>