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));
        }