Exemplo n.º 1
0
        private void bindUserSingle(IBlock block, OnlineUser user)
        {
            String ip = ctx.viewer.IsAdministrator() ? user.Ip : user.GetIp(1);

            String lblValue = "【" + lang("ipAddress") + "】" + ip +
                              "\n【" + lang("osInfo") + "】" + user.Agent +
                              "\n【" + lang("startTime") + "】" + user.StartTime.ToString() +
                              "\n【" + lang("lastActive") + "】" + user.LastActive.ToString() +
                              "\n【" + lang("clocation") + "】" + user.Location;


            if (user.UserId > 0)
            {
                block.Set("u.Name", user.UserName);
                block.Set("u.Face", user.UserPicUrl);
                block.Set("u.Link", user.UserUrl);
            }
            else
            {
                block.Set("u.Name", UserFactory.Guest.Name);
                block.Set("u.Face", UserFactory.Guest.PicSmall);
                block.Set("u.Link", "javascript:;");
            }

            block.Set("u.Info", lblValue);
        }