Example #1
0
        protected override void AfterCommit()
        {
            base.AfterCommit();

            //Update the number of posts per category
            CategoryController.UpdatePostCounts();
            //PostController.UpdateVersionCount(Id);

            //Save tags per post
            Tag.Destroy(Tag.Columns.PostId, Id);
            if(TagList != null)
            {
                foreach(string t in Util.ConvertStringToList(TagList))
                {
                    Tag tag = new Tag();
                    tag.Name = t.Trim();
                    tag.PostId = Id;
                    tag.Save();
                }
            }

            WritePages();

            ZCache.RemoveByPattern("Posts-");
            ZCache.RemoveCache("Post-" + Id);
        }
Example #2
0
        public Tag[] getTags(string blogid, string username, string password)
        {
            if (ValidateUser(username, password))
            {
                var wpGetTagsList = new List<Tag>();
                var tags = TagWeightCollection.FetchAll();
                foreach (var tag in tags)
                {
                    var metablogTag = new Tag();
                    metablogTag.tag_id = tag.Name.GetHashCode();
                    metablogTag.count = tag.Count;
                    metablogTag.name = tag.Name;
                    metablogTag.slug = tag.Name;
                    metablogTag.html_url = tag.Url;
                    metablogTag.rss_url = tag.Url + "feed/";
                    wpGetTagsList.Add(metablogTag);

                }

                return wpGetTagsList.ToArray();
            }

            throw new XmlRpcFaultException(0, "User does not exist");
        }