Beispiel #1
0
        public ActionResult UserFilter(string firstLetter)
        {
            chosen = Convert.ToChar(firstLetter);

            ViewBag.FirstLetter = firstLetter.ToUpper();

            IntrepidStudios.SearchCloud.Cloud cloud1 = new IntrepidStudios.SearchCloud.Cloud();
            cloud1.DataIDField = "keyword_id";
            cloud1.DataKeywordField = "keyword_value";
            cloud1.DataCountField = "keyword_count";
            cloud1.DataURLField = "keyword_url";
            //cloud1.MinColor = "#000000";
            //cloud1.MaxColor = "#000000";

            DataSet theDS = new DataSet();

            theDS = Videos.GetAccountCloudByLetter(firstLetter);

            cloud1.DataSource = theDS;
            cloud1.MinFontSize = 14;
            cloud1.MaxFontSize = 30;
            cloud1.FontUnit = "px";

            foreach (char chl in letters)
            {
                if (chl == Convert.ToChar(firstLetter))
                {
                    chosen = chl;
                }
            }

            StringBuilder sb = new StringBuilder();

            sb.Append(@"<div class=""letter_group""><ul>");

            foreach (char ch2 in letters)
            {
                sb.Append("<li>");

                if (Convert.ToChar(ch2.ToString().ToLower()) == Convert.ToChar(chosen.ToString().ToLower()))
                {
                    sb.Append("<b>");
                    sb.Append(ch2);
                    sb.Append("</b>");
                }
                else
                {
                    sb.AppendFormat(@"<a href=""{0}"">{1}</a>", System.Web.VirtualPathUtility.ToAbsolute(
            "~/video/users/" + Convert.ToChar(ch2.ToString().ToLower())), Convert.ToChar(ch2.ToString() ));

                }

                sb.Append("</li>");
            }

            sb.Append("</ul></div>");

            ViewBag.LetterOfUsers = sb.ToString();

            ViewBag.CloudUsers = cloud1.HTML();

            return View();
        }
Beispiel #2
0
        private void LoadTagCloud()
        {
            string cacheName = "ArticleTagCloud";
            string htmlCloud = string.Empty;

            if (HttpContext.Cache[cacheName] == null)
            {
                IntrepidStudios.SearchCloud.Cloud cloud1 = new IntrepidStudios.SearchCloud.Cloud();
                cloud1.DataIDField = "keyword_id";
                cloud1.DataKeywordField = "keyword_value";
                cloud1.DataCountField = "keyword_count";
                cloud1.DataURLField = "keyword_url";

                DataSet theDS = new DataSet();

                theDS = Contents.GetContentTagsAll();

                cloud1.DataSource = theDS;
                cloud1.MinFontSize = 14;
                cloud1.MaxFontSize = 30;
                cloud1.FontUnit = "px";

                htmlCloud = cloud1.HTML();

                HttpContext.Cache.AddObjToCache(htmlCloud, cacheName);
            }
            else
            {
                htmlCloud = (string)HttpContext.Cache[cacheName];
            }

            ViewBag.CloudTags = htmlCloud;
        }