Ejemplo n.º 1
0
        public static string PrepareUrl(JGN_Wiki entity)
        {
            string _title = "";

            if (entity.term_complete == null && entity.term_complete == "")
            {
                _title = entity.term;
            }
            else
            {
                _title = entity.term_complete;
            }
            int maxium_length = Settings.Configs.GeneralSettings.maximum_dynamic_link_length;

            if (_title.Length > maxium_length && maxium_length > 0)
            {
                _title = _title.Substring(0, maxium_length);
            }
            else if (_title.Length < 3)
            {
                _title = "preview-post";
            }

            _title = UtilityBLL.ReplaceSpaceWithHyphin_v2(_title.Trim().ToLower());

            return(Config.GetUrl("wiki/" + _title));
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Prepare tag or label page link
        /// </summary>
        /// <param name="term"></param>
        /// <param name="path"></param>
        /// <returns></returns>
        public static string PrepareUrl(string term, string path)
        {
            if (term == null)
            {
                return("#");
            }

            string query = UtilityBLL.ReplaceSpaceWithHyphin_v2(term.Trim().ToLower());

            return(Config.GetUrl(path + "label/" + query));
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Prepare and return category page link
        /// </summary>
        /// <param name="entity"></param>
        /// <param name="path"></param>
        /// <returns></returns>
        public static string PrepareUrl(JGN_Categories entity, string path)
        {
            string _value = entity.term;

            if (_value == "")
            {
                _value = entity.title;
            }
            string query = UtilityBLL.ReplaceSpaceWithHyphin_v2(_value.Trim().ToLower());

            return(Config.GetUrl(path + "category/" + query));
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Prepare tag or label page link
        /// </summary>
        /// <param name="entity"></param>
        /// <param name="path"></param>
        /// <returns></returns>
        public static string PrepareUrl(JGN_Tags entity, string path)
        {
            var _tag = entity.term;

            if (_tag == "")
            {
                _tag = entity.title;
            }
            string query = UtilityBLL.ReplaceSpaceWithHyphin_v2(_tag.Trim().ToLower());

            return(Config.GetUrl(path + "label/" + query));
        }
Ejemplo n.º 5
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);
        }
Ejemplo n.º 6
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);
        }
Ejemplo n.º 7
0
 public static string Upload_URL(string username, string foldername)
 {
     return(Config.GetUrl() + UtilityBLL.ParseUsername(SystemDirectoryPaths.UserDirectory, username) + foldername);
 }
Ejemplo n.º 8
0
 public static string Upload_Path(string username, string foldername)
 {
     return(SiteConfig.Environment.ContentRootPath + UtilityBLL.ParseUsername(SystemDirectoryPaths.UserDirectory, username) + foldername);
 }