Beispiel #1
0
function blog_comments_post($logid, $ckname, $ckmail, $ckurl, $verifyCode, $allow_remark)
{
    if ($allow_remark == 'y') {
        ?>
	<div class="comment_post_wrap comment_post" id="comment-post">
		<a name="respond"></a>
		<form method="post" name="commentform" action="<?php 
        echo BLOG_URL;
        ?>
index.php?action=addcom" id="commentform">
			<input type="hidden" name="gid" id="comment-gid" value="<?php 
        echo $logid;
        ?>
" />
			<input type="hidden" name="pid" id="comment-pid" value="0"/>
			<div class="form-group form_textarea">
				<div class="comment_textare"><textarea name="comment" id="comment" placeholder="来盖楼吧~" title="来盖楼吧~"></textarea></div>
				<div class="form-group submit_container">
					<div class="comment_tools">
						<?php 
        #输入框提示逻辑
        if (ISLOGIN) {
            #站长、联合撰稿人
            global $userData;
            // dump($userData);
            $AdmType = $userData['role'] == 'writer' ? '联合撰稿人' : '站长';
            $ckname = !!$userData['nickname'] ? $userData['nickname'] : $AdmType;
            $ckmail = !!$userData['email'] ? $userData['email'] : '*****@*****.**';
            #可能新增的管理员木有邮箱木有昵称更木有头像
            $UserFigure = !!$userData['photo'] ? $userData['photo'] : J_getGravatar($ckmail);
            echo '<span class="comment_avator"><img src="' . $UserFigure . '" title="' . $ckname . '"><em class="commentUser_type reg_admin" title="' . $AdmType . '">' . $ckname . '</em></span>';
        } else {
            #登录会员
            $JuserInfo = Juser::isLogin();
            $isJuserLogin = !!$JuserInfo;
            if ($isJuserLogin) {
                $ckmail = $JuserInfo['mail'];
                switch ($JuserInfo['use_type']) {
                    case 'q':
                        $UserFigure = $JuserInfo['qq_figure'];
                        $ckname = $JuserInfo['qq_name'];
                        #昵称合法性在会员中心检测
                        break;
                    case 'w':
                        $UserFigure = $JuserInfo['sina_figure'];
                        $ckname = $JuserInfo['sina_name'];
                        #昵称合法性在会员中心检测
                        break;
                    default:
                        #默认情况:未设置 检测qq、wb头像是否存在 否则gravator
                        if ($JuserInfo['qq_openid']) {
                            $UserFigure = $JuserInfo['qq_figure'];
                            $ckname = $JuserInfo['qq_name'];
                        } else {
                            if ($JuserInfo['sina_openid']) {
                                $UserFigure = $JuserInfo['sina_figure'];
                                $ckname = $JuserInfo['sina_name'];
                            } else {
                                $UserFigure = J_getGravatar($JuserInfo['mail']);
                                $ckname = $JuserInfo['name'];
                            }
                        }
                        break;
                }
                # 此处不能再发送cookie header头已发出
                #Juser_setCommentCookie($ckname,$ckmail,$ckurl);
                echo '<span class="comment_avator"><img src="' . $UserFigure . '" title="' . $ckname . '"><em class="commentUser_type reg_user" title="注册会员">' . $ckname . '</em></span>';
            } else {
                #游客
                if (empty($ckmail)) {
                    echo '<span class="comment_avator"><img src="' . TEMPLATE_URL . 'images/noAvator.jpg" title="路人甲"><em class="commentUser_type none_user" title="游客">路人甲</em><a href="javascript:;" class="usign login">登录</a><a href="javascript:;" class="usign register">注册</a></span>';
                } else {
                    echo '<span class="comment_avator"><img src="' . J_getGravatar($ckmail) . '" title="' . $ckname . '"><em class="commentUser_type none_user" title="游客">' . $ckname . '</em><a href="javascript:;" class="usign login">登录</a><a href="javascript:;"  class="usign register">注册</a></span>';
                }
            }
        }
        ?>
						<span class="comment_face_btn"><i class="fa fa-smile-o"></i> 表情</span>
						<span class="cancel-reply" id="cancel-reply" style="display:none;">
							<a href="javascript:void(0);" onclick="cancelReply()">取消回复</a>
						</span>
						<div class="comment_submit_wrap">
							<?php 
        if (!empty($verifyCode)) {
            echo '<span class="comment_verfiy_container"><img src="' . BLOG_URL . 'include/lib/checkcode.php" class="c_code" alt="看不清楚?点图切换" title="看不清楚?点图切换"><input type="text" name="imgcode" class="comment_verfiy_code" placeholder="输入验证码" autocomplete="off" title="看不清楚?点图切换"></span>';
        }
        ?>
							<span class="comment_info">Ctrl+Enter快速提交</span>
							<button type="submit" name="submit" id="comment_submit" class="sub_btn"><i class="fa fa-check-circle-o"></i> 提交评论</button>
						</div>
					</div>
				</div>
			</div>
			<?php 
        if (ROLE == ROLE_VISITOR) {
            ?>
			<div class="comment_user_info" style="display:<?php 
            if ($isJuserLogin) {
                echo 'none';
            } else {
                echo 'block';
            }
            ?>
;">
				<div class="form-group">
					<input type="text" id="comname" name="comname" value="<?php 
            echo $ckname;
            ?>
" placeholder="昵称">
					<label for="comname">昵称(必填)</label>
				</div>
				<div class="form-group">
					<input type="text" id="commail" name="commail" value="<?php 
            echo $ckmail;
            ?>
" placeholder="邮箱">
					<label for="commail">邮箱(必填)</label>
				</div>
				<div class="form-group">
					<input type="text" id="comurl" name="comurl" value="<?php 
            echo $ckurl;
            ?>
" placeholder="网址">
					<label for="comurl">网址(选填)</label>
				</div>
			</div>
			<?php 
        }
        ?>
		</form>
	</div>
	<?php 
    }
}
Beispiel #2
0
/**
 * @des 前台微语界面输出发布微语框
 * @param null
 * @return string
 */
function showTwiter()
{
    if (!isUserLogin()) {
        return '';
    }
    //尚未登录直接返回
    //默认采用后台上传的头像图片 后台未上传图片或被删除 使用gravatar头像
    global $CACHE;
    $Usr = $CACHE->readCache('user');
    $Gravatar = BLOG_URL . $Usr[1]['avatar'];
    if (!$Usr[1]['avatar']) {
        $Gravatar = J_getGravatar($Usr[1]['mail'], 100);
    }
    $Token = LoginAuth::genToken();
    $BLOG_URL = BLOG_URL;
    $gav = '<div class="addTwiterContainer"><div class="addTwiterAvatar"><img src="' . $Gravatar . '" title="' . $Usr[1]['name'] . '"></div>';
    $addView = <<<STR
\t<div class="addTwiterContent">
\t\t<form method="post" action="{$BLOG_URL}admin/twitter.php?action=post" class="addTwiterForm">
\t\t\t<input name="token" id="token" value="{$Token}" type="hidden" />
\t\t\t<p class="addTwiterInput"><textarea id="addTwiter" title="来点碎碎念吧~" placeholder="来点碎碎念吧~" name="t"></textarea></p>
\t\t\t<p class="AddTwiterSubmit"><button type="submit" name="submit" class="sub_btn addTwiterBtn"><i class="fa fa-check-circle-o"></i> 发布微语</button><span class="addTwiterInfo">Ctrl+Enter快速提交</span></p>
\t\t</form>
\t</div>
\t</div>
STR;
    return $gav . $addView;
}
Beispiel #3
0
function blog_comments_post($logid, $ckname, $ckmail, $ckurl, $verifyCode, $allow_remark)
{
    if ($allow_remark == 'y') {
        ?>
	<div class="comment_post_wrap comment_post" id="comment-post">
		<h3 class="comment-header"><span class="cancel-reply" id="cancel-reply" style="display:none;"><a href="javascript:void(0);" onclick="cancelReply()">取消回复</a></span>发表评论<a name="respond"></a></h3>
		<form method="post" name="commentform" action="<?php 
        echo BLOG_URL;
        ?>
index.php?action=addcom" id="commentform">
			<input type="hidden" name="gid" id="comment-gid" value="<?php 
        echo $logid;
        ?>
" />
			<input type="hidden" name="pid" id="comment-pid" value="0"/>
			<div class="form-group form_textarea">
				<div class="comment_textare"><textarea name="comment" id="comment" placeholder="说点什么吧~" title="说点什么吧~"></textarea></div>
				<div class="form-group submit_container">
					<div class="comment_tools">
						<?php 
        if (empty($ckmail)) {
            echo '<span class="comment_avator"><img src="' . TEMPLATE_URL . 'images/noAvator.jpg" title="路人甲"><em>路人甲</em></span>';
        } else {
            echo '<span class="comment_avator"><img src="' . J_getGravatar($ckmail) . '" title="' . $ckname . '"><em>' . $ckname . '</em></span>';
        }
        ?>
						<span class="comment_face_btn"><i class="fa fa-smile-o"></i> 表情</span>
						<div class="comment_submit_wrap">
							<?php 
        if (!empty($verifyCode)) {
            echo '<span class="comment_verfiy_container"><img src="' . BLOG_URL . 'include/lib/checkcode.php" class="c_code" alt="看不清楚?点图切换" title="看不清楚?点图切换"><input type="text" name="imgcode" class="comment_verfiy_code" placeholder="输入验证码" autocomplete="off" title="看不清楚?点图切换"></span>';
        }
        ?>
							<span class="comment_info">Ctrl+Enter快速提交</span>
							<button type="submit" name="submit" id="comment_submit" class="sub_btn"><i class="fa fa-check-circle-o"></i> 提交评论</button>
						</div>
					</div>
				</div>
			</div>
			<?php 
        if (ROLE == ROLE_VISITOR) {
            ?>
			<div class="comment_user_info">
				<div class="form-group">
					<input type="text" id="comname" name="comname" value="<?php 
            echo $ckname;
            ?>
" placeholder="昵称">
					<label for="comname">昵称(必填)</label>
				</div>
				<div class="form-group">
					<input type="text" id="commail" name="commail" value="<?php 
            echo $ckmail;
            ?>
" placeholder="邮箱">
					<label for="commail">邮箱(必填)</label>
				</div>
				<div class="form-group">
					<input type="text" id="comurl" name="comurl" value="<?php 
            echo $ckurl;
            ?>
" placeholder="网址">
					<label for="comurl">网址(选填)</label>
				</div>
			</div>
			<?php 
        }
        ?>
		</form>
	</div>
	<?php 
    }
}
Beispiel #4
0
Datei: t.php Projekt: jjonline/J4
</a> <small>&gt;</small> <a href="<?php 
echo BLOG_URL;
?>
t">微语</a></div>
        <?php 
echo showTwiter();
?>
        <h2 class="content_title font_title twiter_title">最新微语</h2>
        <ul class="twiter">
            <?php 
foreach ($tws as $val) {
    //dump($val);
    $author = $user_cache[$val['author']]['name'];
    $avatar = empty($user_cache[$val['author']]['avatar']) ? BLOG_URL . 'admin/views/images/avatar.jpg' : BLOG_URL . $user_cache[$val['author']]['avatar'];
    if (empty($user_cache[$val['author']]['avatar'])) {
        $avatar = empty($user_cache[$val['author']]['mail']) ? TEMPLATE_URL . 'images/noAvator.jpg' : J_getGravatar($user_cache[$val['author']]['mail']);
    } else {
        $avatar = BLOG_URL . $user_cache[$val['author']]['avatar'];
    }
    $tid = (int) $val['id'];
    $img = empty($val['img']) ? "" : '<a title="查看图片" href="' . BLOG_URL . str_replace('thum-', '', $val['img']) . '" target="_blank"><img src="' . BLOG_URL . $val['img'] . '" alt="微语配图"/></a>';
    ?>
 
            <li class="twiter_list">
                <img src="<?php 
    echo $avatar;
    ?>
" alt="<?php 
    echo $author;
    ?>
" class="twiter_avatar" />