using System; using System.Text; using System.Data; using System.Text.RegularExpressions; using BlogEngine.Core; using BlogEngine.Core.Web.Controls; using System.Web; /// /// Summary description for retweet /// /// [Extension("Inserts retweet button at the end of the content posts or pages", "", "")] public class retweet { private static string _Html; private static string twitterUser = "geekiestnet"; // Your twitter user name will be used in the retweet private static string count = "horizondal"; // horizondal, vertical or none /// /// Gets the HTML used to inserts the retweet button code. /// public static string Html { get { if (_Html == null) { StringBuilder sb = new StringBuilder(); sb.Append(getstr()); _Html = sb.ToString(); } return _Html; } } public retweet() { Post.Serving += new EventHandler(Serving); Page.Serving += new EventHandler(Serving); } /// /// Serving retweet button code in post and page /// private static void Serving(object sender, ServingEventArgs e) { if ((e.Location == ServingLocation.SinglePost)) { string _adScript = Html; Post post = (Post)sender; e.Body += _adScript; } if (e.Location == ServingLocation.SinglePage) { string _adScript = Html; Page page = (Page)sender; e.Body += _adScript; } } private static string getstr() { string strr="

Tweet

"; strr=strr.Replace("###un###",twitterUser); strr=strr.Replace("#Count#",count); return (strr); } }