新的phpcms无论是静态还是动态页面还是会员中心的头像

<script>
            $(function(){
                $.ajax({
                    type:'GET',
                    url:'{siteurl($siteid)}/api.php?op=user',
                    dataType:'json',
                    success:function(msg){
                        if(msg.islogin){
                            $('.login_user').html("<div class='login_member'><a href='<?php echo APP_PATH;?>index.php?m=member&siteid=<?php echo $siteid;?>' class='userPhoto' target='_blank'><img src="+msg.portrait+" onerror=\"this.src='http://192.168.1.101/cp/phpsso_server/statics/images/member/nophoto.jpg'\"></a><ul class='user_menu'><li><a href='<?php echo APP_PATH;?>index.php?m=member&siteid=<?php echo $siteid;?>' target='_blank'>个人中心</a><ul class='user_subnav'><li><a href='<?php echo APP_PATH;?>index.php?m=member&siteid=<?php echo $siteid;?>' target='_blank'>个人中心</a></li><li><a href='<?php echo APP_PATH;?>index.php?m=member&c=index&a=logout&forward=<?php echo urlencode($_GET['forward']);?>&siteid=<?php echo $siteid;?>' target='_blank'>退出</a></li></ul></li></ul></div>");
                        }else{
                            $('.login_user').html("<div class='login_reg'><a role='button' href='<?php echo APP_PATH;?>index.php?m=member&c=index&a=register&siteid=<?php echo $siteid;?>' target='_blank'>注册</a> <a role='button' href='<?php echo APP_PATH;?>index.php?m=member&c=index&a=login&forward=<?php echo urlencode($_GET['forward']);?>&siteid=<?php echo $siteid;?>' target='_top'>登录</a></div>");
                        }
                    }
                });
            });
        </script>

 

posted @ 2018-02-03 14:39  水瓶君  阅读(878)  评论(0编辑  收藏  举报