コード例 #1
0
        public static string Photo_Upload_Path(string username, int type)
        {
            // type: 0 --/ Default
            // type: 1 --/ Mid thumb
            // type: 2 --/ Thumb
            string pathsettings = "";

            switch (type)
            {
            case 1:
                pathsettings = "midthumbs";
                break;

            case 2:
                pathsettings = "thumbs";
                break;
            }
            return(SiteConfig.Environment.ContentRootPath + UtilityBLL.ParseUsername(SystemDirectoryPaths.UserDirectory, username) + "photos" + pathsettings);
        }
コード例 #2
0
        /// <summary>
        /// Prepare and return user profile photo link
        /// </summary>
        /// <param name="username"></param>
        /// <param name="picturename"></param>
        /// <param name="type"></param>
        /// <returns></returns>
        public static string ProfilePhoto(string username, string picturename, int type)
        {
            if (username == null)
            {
                return("");
            }

            string URL = "";

            if (picturename == null || picturename == "" || picturename == "none")
            {
                URL = GetDefaultPhoto();
            }
            else if (picturename.StartsWith("http")) // media stored in cloud storage
            {
                URL = PrepareHttpPhotoUrl(picturename, type);
            }
            else
            {
                // type = 0: thumb, 1: mid thumb, 2: original
                string Imagetype = ""; // original
                switch (type)
                {
                case 0:
                    Imagetype = "thumbs/";
                    break;

                case 1:
                    Imagetype = "midthumbs/";
                    break;
                }
                URL = Config.GetUrl(UtilityBLL.ParseUsername(SystemDirectoryPaths.UserUrlPath, username)) + "/ " + Imagetype + "" + picturename;
            }

            return(URL);
        }
コード例 #3
0
 public static string Upload_URL(string username, string foldername)
 {
     return(Config.GetUrl() + UtilityBLL.ParseUsername(SystemDirectoryPaths.UserDirectory, username) + foldername);
 }
コード例 #4
0
 public static string Upload_Path(string username, string foldername)
 {
     return(SiteConfig.Environment.ContentRootPath + UtilityBLL.ParseUsername(SystemDirectoryPaths.UserDirectory, username) + foldername);
 }